[ceph-client:tls_logger 4/5] fs/ceph/debugfs.c:512:21: warning: unused variable 'idx'

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

 



tree:   https://github.com/ceph/ceph-client.git tls_logger
head:   b980c3ea5fcc54aa543fd5e96212b7fb892d42a5
commit: 284eb81c9d23609f54d9e015ce2c40076e8d8a87 [4/5] TLS logger
config: arc-randconfig-001-20250302 (https://download.01.org/0day-ci/archive/20250302/202503020611.ushnPNHC-lkp@xxxxxxxxx/config)
compiler: arceb-elf-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250302/202503020611.ushnPNHC-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/202503020611.ushnPNHC-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

   fs/ceph/debugfs.c: In function 'ceph_san_tls_show':
>> fs/ceph/debugfs.c:512:21: warning: unused variable 'idx' [-Wunused-variable]
     512 |                 int idx = 0;
         |                     ^~~


vim +/idx +512 fs/ceph/debugfs.c

   490	
   491	static int ceph_san_tls_show(struct seq_file *s, void *p)
   492	{
   493		struct tls_ceph_san_context *ctx;
   494		struct ceph_san_tls_logger *logger;
   495		struct ceph_san_log_entry_tls *entry;
   496		unsigned long flags;
   497		int count = 0;
   498	
   499		seq_printf(s, "All Ceph SAN TLS logs from all contexts:\n");
   500		seq_printf(s, "%-8s %-16s %-20s %-8s %-s\n",
   501				   "PID", "Task", "Timestamp", "Index", "Log Message");
   502		seq_printf(s, "-------------------------------------------------------------------------\n");
   503	
   504		spin_lock_irqsave(&g_ceph_san_contexts_lock, flags);
   505	
   506		list_for_each_entry(ctx, &g_ceph_san_contexts, list) {
   507			logger = &ctx->logger;
   508			count++;
   509	
   510			seq_printf(s, "\n=== Context for PID %d ===\n", logger->pid);
   511	
 > 512			int idx = 0;
   513			int head_idx = logger->head_idx & (CEPH_SAN_MAX_LOGS - 1);
   514			int tail_idx = (head_idx + 1) & (CEPH_SAN_MAX_LOGS - 1);
   515	
   516			for (int i = tail_idx; (i & (CEPH_SAN_MAX_LOGS - 1)) != head_idx; i++) {
   517				struct timespec64 ts;
   518				entry = &logger->logs[i & (CEPH_SAN_MAX_LOGS - 1)];
   519	
   520				if (entry->ts == 0 || !entry->buf) {
   521					continue;
   522				}
   523	
   524				jiffies_to_timespec64(entry->ts, &ts);
   525	
   526				seq_printf(s, "%-8d %-16s %lld.%09ld\n",
   527						  logger->pid,
   528						  logger->comm,
   529						  (long long)ts.tv_sec,
   530						  ts.tv_nsec);
   531			}
   532	
   533			seq_printf(s, "\n");
   534		}
   535	
   536		spin_unlock_irqrestore(&g_ceph_san_contexts_lock, flags);
   537	
   538		if (count == 0) {
   539			seq_printf(s, "No TLS contexts found.\n");
   540		} else {
   541			seq_printf(s, "\nTotal contexts: %d\n", count);
   542		}
   543	
   544		return 0;
   545	}
   546	

-- 
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