Skip to contentSkip to conversation

drivers/scsi/lpfc/lpfc_scsi.c and CONFIG_SCSI_LPFC_DEBUG_FS

DISCUSSION Jonathan Nieder 1 participant 1 message Jun 18, 2012 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi,

Quoted 8 lines · Gabor Z. Papp

Greg,

please consider to add this fix to drivers/scsi/lpfc/lpfc_scsi.c, it can't be compiled if CONFIG_SCSI_LPFC_DEBUG_FS didn't set.

lpfc_scsi.c line 1902

Quoted 6 lines
lpfc_scsi.c renamed from usr/src/linux-3.4.3/drivers/scsi/lpfc/lpfc_scsi.c +2 -0
@@ -1897,7 +1897,9 @@
 	dma_addr_t physaddr;
 	int i = 0, num_bde = 0, status;
 	int datadir = sc->sc_data_direction;
+#ifdef CONFIG_SCSI_LPFC_DEBUG_FS
 	uint32_t rc;
+#endif

[...]

Cc-ing James, James, and Alex to let them know about the regression. This regression was introduced by

d438bd3aef8e [SCSI] lpfc 8.3.30: Add -Werror compilation flag

It is worked around in mainline by

0829a19a6142 [SCSI] lpfc 8.3.31: Fix build warnings when debugfs is not defined

and is still unfixed in 3.4.y.

Unfortunately, that warning fix still leaves the build brittle and depending on details of the compiler implementation. A less fragile fix which should be more acceptable for stable would be the following. Just my opinion, though...

-- >8 --
Subject: lpfc: disable -Werror

Using -Werror means that whenever a compiler developer gets a bright idea for a new warning, your build is broken. Great fun as a linting tool in a controlled build environment during development; not so much fun when the person compiling is a non-developer just trying to deploy the driver using whatever compiler is lying around.

In particular, 3.4.y kernels need this change to avoid -Werror=unused-variable build failures when compiling without CONFIG_SCSI_LPFC_DEBUG_FS set.

---
 drivers/scsi/lpfc/Makefile | 2 --
 1 file changed, 2 deletions(-)
drivers/scsi/lpfc/Makefile +0 -2
index fe5d396aca73..d40b29d83c75 100644
@@ -22,8 +22,6 @@
 ccflags-$(GCOV) := -fprofile-arcs -ftest-coverage
 ccflags-$(GCOV) += -O0
 
-ccflags-y += -Werror
-
 obj-$(CONFIG_SCSI_LPFC) := lpfc.o
 
 lpfc-objs := lpfc_mem.o lpfc_sli.o lpfc_ct.o lpfc_els.o lpfc_hbadisc.o	\
Signature · 1 line
1.7.11.rc3