public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* [bcachefs:bcachefs-testing 90/93] fs/bcachefs/thread_with_file.c:375:2: warning: label followed by a declaration is a C23 extension
@ 2024-05-30 22:14 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-05-30 22:14 UTC (permalink / raw)
  To: Kent Overstreet; +Cc: llvm, oe-kbuild-all, Kent Overstreet

tree:   https://evilpiepirate.org/git/bcachefs.git bcachefs-testing
head:   ce6297d0475422fa2de0db1d4f955633ba70d031
commit: 21091985987e4fcc4580030d896ac35906041d22 [90/93] bcachefs: bch2_stdio_redirect_readline_timeout()
config: s390-defconfig (https://download.01.org/0day-ci/archive/20240531/202405310602.WxfwdaAA-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project bafda89a0944d947fc4b3b5663185e07a397ac30)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240531/202405310602.WxfwdaAA-lkp@intel.com/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@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202405310602.WxfwdaAA-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from fs/bcachefs/thread_with_file.c:4:
   In file included from fs/bcachefs/bcachefs.h:188:
   In file included from include/linux/bio.h:10:
   In file included from include/linux/blk_types.h:10:
   In file included from include/linux/bvec.h:10:
   In file included from include/linux/highmem.h:10:
   In file included from include/linux/mm.h:2253:
   include/linux/vmstat.h:500:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     500 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     501 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:507:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     507 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     508 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:514:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     514 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   include/linux/vmstat.h:519:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     519 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     520 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:528:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     528 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     529 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
>> fs/bcachefs/thread_with_file.c:375:2: warning: label followed by a declaration is a C23 extension [-Wc23-extensions]
     375 |         unsigned long t = timeout != MAX_SCHEDULE_TIMEOUT
         |         ^
   6 warnings generated.


vim +375 fs/bcachefs/thread_with_file.c

   366	
   367	int bch2_stdio_redirect_readline_timeout(struct stdio_redirect *stdio,
   368						 darray_char *line,
   369						 unsigned long timeout)
   370	{
   371		unsigned long until = jiffies + timeout;
   372		struct stdio_buf *buf = &stdio->input;
   373		size_t seen = 0;
   374	again:
 > 375		unsigned long t = timeout != MAX_SCHEDULE_TIMEOUT
   376			? max_t(long, until - jiffies, 0)
   377			: timeout;
   378	
   379		t = min(t, sysctl_hung_task_timeout_secs * HZ / 2);
   380	
   381		wait_event_timeout(buf->wait, stdio_redirect_has_more_input(stdio, seen), t);
   382	
   383		if (stdio->done)
   384			return -1;
   385	
   386		spin_lock(&buf->lock);
   387		seen = buf->buf.nr;
   388		char *n = memchr(buf->buf.data, '\n', seen);
   389	
   390		if (!n && timeout != MAX_SCHEDULE_TIMEOUT && jiffies >= until) {
   391			spin_unlock(&buf->lock);
   392			return -ETIME;
   393		}
   394	
   395		if (!n) {
   396			buf->waiting_for_line = true;
   397			spin_unlock(&buf->lock);
   398			goto again;
   399		}
   400	
   401		size_t b = n + 1 - buf->buf.data;
   402		if (b > line->size) {
   403			spin_unlock(&buf->lock);
   404			int ret = darray_resize(line, b);
   405			if (ret)
   406				return ret;
   407			seen = 0;
   408			goto again;
   409		}
   410	
   411		buf->buf.nr -= b;
   412		memcpy(line->data, buf->buf.data, b);
   413		memmove(buf->buf.data,
   414			buf->buf.data + b,
   415			buf->buf.nr);
   416		line->nr = b;
   417	
   418		buf->waiting_for_line = false;
   419		spin_unlock(&buf->lock);
   420	
   421		wake_up(&buf->wait);
   422		return 0;
   423	}
   424	

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-05-30 22:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-30 22:14 [bcachefs:bcachefs-testing 90/93] fs/bcachefs/thread_with_file.c:375:2: warning: label followed by a declaration is a C23 extension kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox