Skip to contentSkip to conversation

lpfc: problems with -Werror

DISCUSSION Fengguang Wu 4 participants 4 messages Jun 21, 2012 – Jun 22, 2012

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

Hi Alex,

In commit d438bd3aef ("Add -Werror compilation flag") you added this:

+ccflags-y += -Werror

Now I run into a number of gcc errors when running randconfig tests. They smell like false warnings. I don't quite understand why you made that "-Werror" conditional and only fail on CONFIG_SCSI_LPFC=y. But if you prefer to keep that -Werror, I'll send a (perhaps silly) patch to quiet these error messages.

drivers/scsi/lpfc/lpfc_sli.c:3654:3: error: 'resp_data' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/scsi/lpfc/lpfc_sli.c:3637:2: error: 'ha_copy' may be used uninitialized in this function [-Werror=maybe-uninitialized] arch/x86/include/asm/io.h:63:1: error: 'hc_copy' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/scsi/lpfc/lpfc_sli.c:3510:18: error: 'status' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/scsi/lpfc/lpfc_sli.c:4068:17: error: 'status' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/scsi/lpfc/lpfc_sli.c:3777:23: error: 'ha_copy' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/scsi/lpfc/lpfc_sli.c:3742:9: error: 'status' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/scsi/lpfc/lpfc_sli.c:6694:21: error: 'ha_copy' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/scsi/lpfc/lpfc_sli.c:6693:18: error: 'word0' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/scsi/lpfc/lpfc_sli.c:9718:12: error: 'creg_val' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/scsi/lpfc/lpfc_sli.c:9872:2: error: 'ha_copy' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/scsi/lpfc/lpfc_sli.c:10235:14: error: 'control' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/scsi/lpfc/lpfc_sli.c:10176:9: error: 'hc_copy' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/scsi/lpfc/lpfc_sli.c:10152:12: error: 'ha_copy' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/scsi/lpfc/lpfc_sli.c:10447:9: error: 'ha_copy' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/scsi/lpfc/lpfc_sli.c:10551:8: error: 'hc_copy' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/scsi/lpfc/lpfc_els.c:95:2: error: 'ha_copy' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/scsi/lpfc/lpfc_els.c:4731:11: error: 'cmd' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/scsi/lpfc/lpfc_els.c:4731:11: error: 'length' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/scsi/lpfc/lpfc_init.c:522:9: error: 'status' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/scsi/lpfc/lpfc_attr.c:1491:12: error: 'creg_val' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/scsi/lpfc/lpfc_bsg.c:358:12: error: 'creg_val' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/scsi/lpfc/lpfc_bsg.c:615:12: error: 'creg_val' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/scsi/lpfc/lpfc_bsg.c:1385:12: error: 'creg_val' may be used uninitialized in this function [-Werror=maybe-uninitialized]

Thanks,
Fengguang

#1 lore raw
Quoted 11 lines · Fengguang Wu

Hi Alex,

In commit d438bd3aef ("Add -Werror compilation flag") you added this:

+ccflags-y += -Werror

Now I run into a number of gcc errors when running randconfig tests. They smell like false warnings. I don't quite understand why you made that "-Werror" conditional and only fail on CONFIG_SCSI_LPFC=y. But if you prefer to keep that -Werror, I'll send a (perhaps silly) patch to quiet these error messages.

They're all bogus, but we can't really have the build break because gcc is fragile.

James and Alex, how about this: It's the aic7xxx solution: it allows you to build the kernel with make WARNINGS_BECOME_ERRORS=1 to get -Werror but it's not on by default?

James

---

drivers/scsi/lpfc/Makefile +2 -0
index fe5d396..e2516ba 100644
@@ -22,7 +22,9 @@
 ccflags-$(GCOV) := -fprofile-arcs -ftest-coverage
 ccflags-$(GCOV) += -O0
 
+ifdef WARNINGS_BECOME_ERRORS
 ccflags-y += -Werror
+endif
 
 obj-$(CONFIG_SCSI_LPFC) := lpfc.o
 
#2 lore raw

drivers/scsi/lpfc/Makefile line 29

Quoted 9 lines · James Bottomley
drivers/scsi/lpfc/Makefile +2 -0
@@ -22,7 +22,9 @@
 ccflags-$(GCOV) := -fprofile-arcs -ftest-coverage
 ccflags-$(GCOV) += -O0
 
+ifdef WARNINGS_BECOME_ERRORS
 ccflags-y += -Werror
+endif
 
 obj-$(CONFIG_SCSI_LPFC) := lpfc.o

Why not more simply:

ccflags-$(WARNINGS_BECOME_ERRORS) += -Werror

Quoted 1 line

N?????r??y????b?X????v?^?)??{.n?+????{???"?{ay?

?????,j??f???h???z?
?w???
???j:+v???w?j?m????????zZ+???????j"??!

That's some nasty line noise on your modem there, James.

Signature · 4 lines
Matthew Wilcox				Intel Open Source Technology Centre
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."
maintainer
#3 lore raw
Quoted 9 lines · Matthew Wilcox
Quoted 8 lines · James Bottomley
drivers/scsi/lpfc/Makefile +2 -0
@@ -22,7 +22,9 @@
 ccflags-$(GCOV) := -fprofile-arcs -ftest-coverage
 ccflags-$(GCOV) += -O0
 
+ifdef WARNINGS_BECOME_ERRORS
 ccflags-y += -Werror
+endif
 
Quoted 5 lines

drivers/scsi/lpfc/Makefile line 29

Quoted 1 line
drivers/scsi/lpfc/Makefile +0 -0
 obj-$(CONFIG_SCSI_LPFC) := lpfc.o

Why not more simply:

ccflags-$(WARNINGS_BECOME_ERRORS) += -Werror

Because it's not a config option, it's a makefile option. If we go with what you propose, the format of make has to be

make WARNINGS_BECOME_ERRORS=y

which is a bit non intuitive.

Quoted 1 line
Quoted 1 line

N?????r??y????b?X????v?^?)??{.n?+????{???"?{ay?

?????,j??f???h???z?
?w???
???j:+v???w?j?m????????zZ+???????j"??!

Quoted 2 lines

That's some nasty line noise on your modem there, James.

No, it's because majordomo has some issue doing base64.

James