[ceph-client:wip-tls-tracing-parent-fix 6/8] fs/ceph/debugfs.c:366:19: warning: variable 'seconds' set but not used

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://github.com/ceph/ceph-client.git wip-tls-tracing-parent-fix
head:   e9538aee9a1876fc317762d0ace8078e96c897af
commit: e442fc60cf71f159f1138f01ad70d70305ff05d5 [6/8] ceph fs debugfs code
config: i386-buildonly-randconfig-003-20250801 (https://download.01.org/0day-ci/archive/20250801/202508010753.ulnHM0RZ-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14+deb12u1) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250801/202508010753.ulnHM0RZ-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202508010753.ulnHM0RZ-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

   In file included from arch/x86/include/asm/current.h:5,
                    from include/linux/sched.h:12,
                    from include/linux/ceph/ceph_san_logger.h:5,
                    from include/linux/ceph/ceph_debug.h:9,
                    from fs/ceph/debugfs.c:2:
   include/linux/ceph/ceph_san_ser.h: In function 'write_null_str':
   include/linux/build_bug.h:78:41: error: static assertion failed: "null_str.str size must match unsigned long for proper alignment"
      78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
         |                                         ^~~~~~~~~~~~~~
   include/linux/build_bug.h:77:34: note: in expansion of macro '__static_assert'
      77 | #define static_assert(expr, ...) __static_assert(expr, ##__VA_ARGS__, #expr)
         |                                  ^~~~~~~~~~~~~~~
   include/linux/ceph/ceph_san_ser.h:116:5: note: in expansion of macro 'static_assert'
     116 |     static_assert(sizeof(null_str.str) == sizeof(unsigned long),
         |     ^~~~~~~~~~~~~
   fs/ceph/debugfs.c: In function 'jiffies_to_formatted_time':
>> fs/ceph/debugfs.c:366:19: warning: variable 'seconds' set but not used [-Wunused-but-set-variable]
     366 |     unsigned long seconds;
         |                   ^~~~~~~


vim +/seconds +366 fs/ceph/debugfs.c

   358	
   359	/* @buffer: The buffer to store the formatted date and time string.
   360	 * @buffer_len: The length of the buffer.
   361	 *
   362	 * Returns: The number of characters written to the buffer, or a negative error code.
   363	 */
   364	static int jiffies_to_formatted_time(unsigned long jiffies_value, char *buffer, size_t buffer_len)
   365	{
 > 366	    unsigned long seconds;
   367	    unsigned long subsec_jiffies;
   368	    unsigned long microseconds;
   369	    struct tm tm_time;
   370	    time64_t timestamp;
   371	
   372	    // Convert jiffies to seconds since boot
   373	    seconds = jiffies_value / HZ;
   374	
   375	    // Calculate remaining jiffies for subsecond precision
   376	    subsec_jiffies = jiffies_value % HZ;
   377	    microseconds = (subsec_jiffies * 1000) / HZ;
   378	
   379	    // Get current time and calculate absolute timestamp
   380	    // Using boottime as reference to convert relative jiffies to absolute time
   381	    timestamp = ktime_get_real_seconds() - (jiffies - jiffies_value) / HZ;
   382	
   383	    // Convert to broken-down time
   384	    time64_to_tm(timestamp, 0, &tm_time);
   385	
   386	    // Format the time into the buffer with millisecond precision
   387	    return snprintf(buffer, buffer_len, "%04ld-%02d-%02d %02d:%02d:%02d.%03lu",
   388	                   tm_time.tm_year + 1900, tm_time.tm_mon + 1, tm_time.tm_mday,
   389	                   tm_time.tm_hour, tm_time.tm_min, tm_time.tm_sec, microseconds);
   390	}
   391	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Ceph Dev]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux