diff mbox

[v2] scsi: kconfig: When possible, compile drivers with COMPILE_TEST

Message ID 1444865769-3380-1-git-send-email-luisbg@osg.samsung.com (mailing list archive)
State New, archived
Headers show

Commit Message

Luis de Bethencourt Oct. 14, 2015, 11:36 p.m. UTC
These drivers only have runtime but no build time dependencies, so they can
be built for testing purposes if the Kconfig COMPILE_TEST option is enabled.

This is useful to have more build coverage and make sure that drivers are
not affected by changes that could cause build regressions.

Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
---

Hi,

This version corrects a typo pointed out by Randy Dunlap.

The validity of the patch is still in question after the comments by James
Bottomley. [0]

I just wanted to send a correct version as a thank you to Randy.

Thanks,
Luis

[0] https://lkml.org/lkml/2015/10/14/995

 drivers/scsi/Kconfig | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

Comments

kernel test robot Oct. 15, 2015, 3:02 a.m. UTC | #1
Hi Luis,

[auto build test WARNING on scsi/for-next -- if it's inappropriate base, please suggest rules for selecting the more suitable base]

url:    https://github.com/0day-ci/linux/commits/Luis-de-Bethencourt/scsi-kconfig-When-possible-compile-drivers-with-COMPILE_TEST/20151015-073819
config: sh-allmodconfig (attached as .config)
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=sh 

All warnings (new ones prefixed by >>):

   drivers/scsi/pas16.c: In function 'NCR5380_pread':
>> drivers/scsi/pas16.c:500:18: warning: unused variable 'i' [-Wunused-variable]
>> drivers/scsi/pas16.c:498:29: warning: unused variable 'reg' [-Wunused-variable]
>> drivers/scsi/pas16.c:497:30: warning: unused variable 'd' [-Wunused-variable]
   drivers/scsi/pas16.c: In function 'NCR5380_pwrite':
   drivers/scsi/pas16.c:537:18: warning: unused variable 'i' [-Wunused-variable]
   drivers/scsi/pas16.c:536:29: warning: unused variable 'reg' [-Wunused-variable]
>> drivers/scsi/pas16.c:535:29: warning: unused variable 's' [-Wunused-variable]

vim +/i +500 drivers/scsi/pas16.c

^1da177e Linus Torvalds 2005-04-16  491   * Returns : 0 on success, non zero on a failure such as a watchdog 
^1da177e Linus Torvalds 2005-04-16  492   * 	timeout.
^1da177e Linus Torvalds 2005-04-16  493   */
^1da177e Linus Torvalds 2005-04-16  494  
^1da177e Linus Torvalds 2005-04-16  495  static inline int NCR5380_pread (struct Scsi_Host *instance, unsigned char *dst,
^1da177e Linus Torvalds 2005-04-16  496      int len) {
^1da177e Linus Torvalds 2005-04-16 @497      register unsigned char  *d = dst;
^1da177e Linus Torvalds 2005-04-16 @498      register unsigned short reg = (unsigned short) (instance->io_port + 
^1da177e Linus Torvalds 2005-04-16  499  	P_DATA_REG_OFFSET);
^1da177e Linus Torvalds 2005-04-16 @500      register int i = len;
^1da177e Linus Torvalds 2005-04-16  501      int ii = 0;
a9c2dc43 Finn Thain     2014-11-12  502      struct NCR5380_hostdata *hostdata = shost_priv(instance);
^1da177e Linus Torvalds 2005-04-16  503  
^1da177e Linus Torvalds 2005-04-16  504      while ( !(inb(instance->io_port + P_STATUS_REG_OFFSET) & P_ST_RDY) )
^1da177e Linus Torvalds 2005-04-16  505  	 ++ii;
^1da177e Linus Torvalds 2005-04-16  506  
^1da177e Linus Torvalds 2005-04-16  507      insb( reg, d, i );
^1da177e Linus Torvalds 2005-04-16  508  
^1da177e Linus Torvalds 2005-04-16  509      if ( inb(instance->io_port + P_TIMEOUT_STATUS_REG_OFFSET) & P_TS_TIM) {
^1da177e Linus Torvalds 2005-04-16  510  	outb( P_TS_CT, instance->io_port + P_TIMEOUT_STATUS_REG_OFFSET);
^1da177e Linus Torvalds 2005-04-16  511  	printk("scsi%d : watchdog timer fired in NCR5380_pread()\n",
^1da177e Linus Torvalds 2005-04-16  512  	    instance->host_no);
^1da177e Linus Torvalds 2005-04-16  513  	return -1;
^1da177e Linus Torvalds 2005-04-16  514      }
a9c2dc43 Finn Thain     2014-11-12  515      if (ii > hostdata->spin_max_r)
a9c2dc43 Finn Thain     2014-11-12  516          hostdata->spin_max_r = ii;
^1da177e Linus Torvalds 2005-04-16  517      return 0;
^1da177e Linus Torvalds 2005-04-16  518  }
^1da177e Linus Torvalds 2005-04-16  519  
^1da177e Linus Torvalds 2005-04-16  520  /*
^1da177e Linus Torvalds 2005-04-16  521   * Function : int NCR5380_pwrite (struct Scsi_Host *instance, 
^1da177e Linus Torvalds 2005-04-16  522   *	unsigned char *src, int len)
^1da177e Linus Torvalds 2005-04-16  523   *
^1da177e Linus Torvalds 2005-04-16  524   * Purpose : Fast 5380 pseudo-dma write function, transfers len bytes from
^1da177e Linus Torvalds 2005-04-16  525   *	src
^1da177e Linus Torvalds 2005-04-16  526   * 
^1da177e Linus Torvalds 2005-04-16  527   * Inputs : src = source, len = length in bytes
^1da177e Linus Torvalds 2005-04-16  528   *
^1da177e Linus Torvalds 2005-04-16  529   * Returns : 0 on success, non zero on a failure such as a watchdog 
^1da177e Linus Torvalds 2005-04-16  530   * 	timeout.
^1da177e Linus Torvalds 2005-04-16  531   */
^1da177e Linus Torvalds 2005-04-16  532  
^1da177e Linus Torvalds 2005-04-16  533  static inline int NCR5380_pwrite (struct Scsi_Host *instance, unsigned char *src,
^1da177e Linus Torvalds 2005-04-16  534      int len) {
^1da177e Linus Torvalds 2005-04-16 @535      register unsigned char *s = src;
^1da177e Linus Torvalds 2005-04-16  536      register unsigned short reg = (instance->io_port + P_DATA_REG_OFFSET);
^1da177e Linus Torvalds 2005-04-16  537      register int i = len;
^1da177e Linus Torvalds 2005-04-16  538      int ii = 0;

:::::: The code at line 500 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
kernel test robot Oct. 16, 2015, 3:59 a.m. UTC | #2
Hi Luis,

[auto build test ERROR on scsi/for-next -- if it's inappropriate base, please suggest rules for selecting the more suitable base]

url:    https://github.com/0day-ci/linux/commits/Luis-de-Bethencourt/scsi-kconfig-When-possible-compile-drivers-with-COMPILE_TEST/20151015-073819
config: um-allmodconfig (attached as .config)
reproduce:
        # save the attached .config to linux build tree
        make ARCH=um 

All error/warnings (new ones prefixed by >>):

   drivers/scsi/aha152x.c: In function 'aha152x_init':
>> drivers/scsi/aha152x.c:3261:22: error: implicit declaration of function 'ioremap' [-Werror=implicit-function-declaration]
       void __iomem *p = ioremap(addresses[i], 0x4000);
                         ^
>> drivers/scsi/aha152x.c:3261:22: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
>> drivers/scsi/aha152x.c:3267:4: error: implicit declaration of function 'iounmap' [-Werror=implicit-function-declaration]
       iounmap(p);
       ^
   cc1: some warnings being treated as errors
--
   drivers/scsi/in2000.c: In function 'probe_bios':
>> drivers/scsi/in2000.c:1903:20: error: implicit declaration of function 'ioremap' [-Werror=implicit-function-declaration]
     void __iomem *p = ioremap(addr, 0x34);
                       ^
>> drivers/scsi/in2000.c:1903:20: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
>> drivers/scsi/in2000.c:1910:3: error: implicit declaration of function 'iounmap' [-Werror=implicit-function-declaration]
      iounmap(p);
      ^
   cc1: some warnings being treated as errors
--
   In file included from drivers/scsi/g_NCR5380_mmio.c:9:0:
   drivers/scsi/g_NCR5380.c: In function 'generic_NCR5380_detect':
>> drivers/scsi/g_NCR5380.c:399:11: error: implicit declaration of function 'ioremap' [-Werror=implicit-function-declaration]
      iomem = ioremap(base, NCR5380_region_size);
              ^
>> drivers/scsi/g_NCR5380.c:399:9: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
      iomem = ioremap(base, NCR5380_region_size);
            ^
>> drivers/scsi/g_NCR5380.c:410:4: error: implicit declaration of function 'iounmap' [-Werror=implicit-function-declaration]
       iounmap(iomem);
       ^
   cc1: some warnings being treated as errors
--
   drivers/scsi/t128.c: In function 't128_detect':
>> drivers/scsi/t128.c:180:10: error: implicit declaration of function 'ioremap' [-Werror=implicit-function-declaration]
         p = ioremap(bases[current_base].address, 0x2000);
             ^
>> drivers/scsi/t128.c:180:8: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
         p = ioremap(bases[current_base].address, 0x2000);
           ^
   drivers/scsi/t128.c:190:5: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
      p = ioremap(bases[current_base].address, 0x2000);
        ^
>> drivers/scsi/t128.c:203:3: error: implicit declaration of function 'iounmap' [-Werror=implicit-function-declaration]
      iounmap(p);
      ^
   cc1: some warnings being treated as errors
--
   drivers/scsi/dtc.c: In function 'dtc_detect':
>> drivers/scsi/dtc.c:203:11: error: implicit declaration of function 'ioremap' [-Werror=implicit-function-declaration]
       base = ioremap(addr, 0x2000);
              ^
>> drivers/scsi/dtc.c:203:9: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
       base = ioremap(addr, 0x2000);
            ^
   drivers/scsi/dtc.c:213:10: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
        base = ioremap(bases[current_base].address, 0x2000);
             ^
>> drivers/scsi/dtc.c:225:5: error: implicit declaration of function 'iounmap' [-Werror=implicit-function-declaration]
        iounmap(base);
        ^
   cc1: some warnings being treated as errors

vim +/ioremap +3261 drivers/scsi/aha152x.c

^1da177e Linus Torvalds  2005-04-16  3255  
^1da177e Linus Torvalds  2005-04-16  3256  #if defined(AUTOCONF)
^1da177e Linus Torvalds  2005-04-16  3257  	if (setup_count<ARRAY_SIZE(setup)) {
^1da177e Linus Torvalds  2005-04-16  3258  #if !defined(SKIP_BIOSTEST)
^1da177e Linus Torvalds  2005-04-16  3259  		ok = 0;
^1da177e Linus Torvalds  2005-04-16  3260  		for (i = 0; i < ARRAY_SIZE(addresses) && !ok; i++) {
^1da177e Linus Torvalds  2005-04-16 @3261  			void __iomem *p = ioremap(addresses[i], 0x4000);
^1da177e Linus Torvalds  2005-04-16  3262  			if (!p)
^1da177e Linus Torvalds  2005-04-16  3263  				continue;
^1da177e Linus Torvalds  2005-04-16  3264  			for (j = 0; j<ARRAY_SIZE(signatures) && !ok; j++)
^1da177e Linus Torvalds  2005-04-16  3265  				ok = check_signature(p + signatures[j].sig_offset,
^1da177e Linus Torvalds  2005-04-16  3266  								signatures[j].signature, signatures[j].sig_length);
^1da177e Linus Torvalds  2005-04-16 @3267  			iounmap(p);
^1da177e Linus Torvalds  2005-04-16  3268  		}
^1da177e Linus Torvalds  2005-04-16  3269  		if (!ok && setup_count == 0)
ad2fa42d James Bottomley 2008-05-10  3270  			return -ENODEV;

:::::: The code at line 3261 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@ppc970.osdl.org>
:::::: CC: Linus Torvalds <torvalds@ppc970.osdl.org>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox

Patch

diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig
index d2f480b..e90e0ca 100644
--- a/drivers/scsi/Kconfig
+++ b/drivers/scsi/Kconfig
@@ -416,7 +416,7 @@  config SCSI_ACARD
 
 config SCSI_AHA152X
 	tristate "Adaptec AHA152X/2825 support"
-	depends on ISA && SCSI
+	depends on (ISA || COMPILE_TEST) && SCSI
 	select SCSI_SPI_ATTRS
 	select CHECK_SIGNATURE
 	---help---
@@ -509,7 +509,7 @@  config SCSI_ADVANSYS
 
 config SCSI_IN2000
 	tristate "Always IN2000 SCSI support"
-	depends on ISA && SCSI
+	depends on (ISA || COMPILE_TEST) && SCSI
 	help
 	  This is support for an ISA bus SCSI host adapter.  You'll find more
 	  information in <file:Documentation/scsi/in2000.txt>. If it doesn't work
@@ -657,7 +657,7 @@  config SCSI_DMX3191D
 
 config SCSI_DTC3280
 	tristate "DTC3180/3280 SCSI support"
-	depends on ISA && SCSI
+	depends on (ISA || COMPILE_TEST) && SCSI
 	select SCSI_SPI_ATTRS
 	select CHECK_SIGNATURE
 	help
@@ -776,7 +776,7 @@  config SCSI_ISCI
 
 config SCSI_GENERIC_NCR5380
 	tristate "Generic NCR5380/53c400 SCSI PIO support"
-	depends on ISA && SCSI
+	depends on (ISA || COMPILE_TEST) && SCSI
 	select SCSI_SPI_ATTRS
 	---help---
 	  This is a driver for the old NCR 53c80 series of SCSI controllers
@@ -796,7 +796,7 @@  config SCSI_GENERIC_NCR5380
 
 config SCSI_GENERIC_NCR5380_MMIO
 	tristate "Generic NCR5380/53c400 SCSI MMIO support"
-	depends on ISA && SCSI
+	depends on (ISA || COMPILE_TEST) && SCSI
 	select SCSI_SPI_ATTRS
 	---help---
 	  This is a driver for the old NCR 53c80 series of SCSI controllers
@@ -970,7 +970,7 @@  config SCSI_IZIP_SLOW_CTR
 
 config SCSI_NCR53C406A
 	tristate "NCR53c406a SCSI support"
-	depends on ISA && SCSI
+	depends on (ISA || COMPILE_TEST) && SCSI
 	help
 	  This is support for the NCR53c406a SCSI host adapter.  For user
 	  configurable parameters, check out <file:drivers/scsi/NCR53c406a.c>
@@ -1238,7 +1238,7 @@  config SCSI_NCR53C8XX_NO_DISCONNECT
 
 config SCSI_PAS16
 	tristate "PAS16 SCSI support"
-	depends on ISA && SCSI
+	depends on (ISA || COMPILE_TEST) && SCSI
 	select SCSI_SPI_ATTRS
 	---help---
 	  This is support for a SCSI host adapter.  It is explained in section
@@ -1252,7 +1252,7 @@  config SCSI_PAS16
 
 config SCSI_QLOGIC_FAS
 	tristate "Qlogic FAS SCSI support"
-	depends on ISA && SCSI
+	depends on (ISA || COMPILE_TEST) && SCSI
 	---help---
 	  This is a driver for the ISA, VLB, and PCMCIA versions of the Qlogic
 	  FastSCSI! cards as well as any other card based on the FASXX chip
@@ -1321,7 +1321,7 @@  config SCSI_SIM710
 
 config SCSI_SYM53C416
 	tristate "Symbios 53c416 SCSI support"
-	depends on ISA && SCSI
+	depends on (ISA || COMPILE_TEST) && SCSI
 	---help---
 	  This is support for the sym53c416 SCSI host adapter, the SCSI
 	  adapter that comes with some HP scanners. This driver requires that
@@ -1372,7 +1372,7 @@  config SCSI_AM53C974
 
 config SCSI_T128
 	tristate "Trantor T128/T128F/T228 SCSI support"
-	depends on ISA && SCSI
+	depends on (ISA || COMPILE_TEST) && SCSI
 	select SCSI_SPI_ATTRS
 	select CHECK_SIGNATURE
 	---help---