Skip to contentSkip to conversation

linux-next: build warning after merge of the cifs tree

DISCUSSION Stephen Rothwell 2 participants 3 messages Jan 3, 2018 – Jan 4, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

Hi all,

After merging the cifs tree, today's linux-next build (x86_64 allmodconfig) produced this warning:

In file included from include/linux/seqlock.h:36:0,
from include/linux/time.h:6,
from include/linux/stat.h:19,
from include/linux/module.h:10,
from fs/cifs/smbdirect.c:16:
fs/cifs/smbdirect.c: In function 'smbd_recv_buf':
include/linux/spinlock.h:260:3: warning: 'flags' may be used uninitialized in this function [-Wmaybe-uninitialized]
_raw_spin_unlock_irqrestore(lock, flags); \
^
fs/cifs/smbdirect.c:1865:16: note: 'flags' was declared here

  unsigned long flags;
                ^

Introduced by commit

ac69f66e54ca ("CIFS: SMBD: Implement function to receive data via RDMA receive")

OK, this is a false positive, but annoying.

I am using gcc 5.2.0.

Signature · 2 lines
Cheers,
Stephen Rothwell
#1 lore raw

I don't see this with gcc 5.4

Stephen,
Harmless to initialize flags here ... even if unneeded ... so if it makes your life easier I don't mind initializes to 0. Let me know. Wonder why it doesn't generate the warning on the various other places in the fs that do the same thing?

Quoted 29 lines · Stephen Rothwell

Hi all,

After merging the cifs tree, today's linux-next build (x86_64 allmodconfig) produced this warning:

In file included from include/linux/seqlock.h:36:0,
from include/linux/time.h:6,
from include/linux/stat.h:19,
from include/linux/module.h:10,
from fs/cifs/smbdirect.c:16:
fs/cifs/smbdirect.c: In function 'smbd_recv_buf':
include/linux/spinlock.h:260:3: warning: 'flags' may be used uninitialized in this function [-Wmaybe-uninitialized]

   _raw_spin_unlock_irqrestore(lock, flags); \
   ^
fs/cifs/smbdirect.c:1865:16: note: 'flags' was declared here
  unsigned long flags;
                ^

Introduced by commit

ac69f66e54ca ("CIFS: SMBD: Implement function to receive data via RDMA receive")

OK, this is a false positive, but annoying.

I am using gcc 5.2.0.

--
Cheers,
Stephen Rothwell

Signature · 3 lines
Thanks,

Steve
#2 lore raw

Hi Steve,

Quoted 2 lines · On Wed, 3 Jan 2018 16:44:59 -0600 Steve French…

I don't see this with gcc 5.4

Good to know.

Quoted 4 lines

Harmless to initialize flags here ... even if unneeded ... so if it makes your life easier I don't mind initializes to 0. Let me know. Wonder why it doesn't generate the warning on the various other places in the fs that do the same thing?

I might just take the hint to upgrade my cross compilers :-) Thanks anyway.

In the mean time, my scripts will automatically skip reporting this warning to me.

Signature · 2 lines
Cheers,
Stephen Rothwell