Skip to contentSkip to conversation

scsi: dc395x: enabling debug causes build to fail

DISCUSSION Colin King (gmail) 1 participant 1 message Apr 22, 2025 SCSI

lore
Share & tools
lore
#0 lore raw

Hi,

Enabling debug in drivers/scsi/dc395x.c such as the following..

#define DEBUG_MASK DBG_0

..causes the build to fail. This seems to fail pre- linux v6.0, so it's been broken a very long time.

make drivers/scsi/dc395x.o -j 28 -k
DESCEND objtool
INSTALL libsubcmd_headers

  UPD     include/config/kernel.release
  UPD     include/generated/utsrelease.h
  CALL    scripts/checksyscalls.sh
  CC [M]  drivers/scsi/dc395x.o
In file included from ./include/asm-generic/bug.h:23,
                 from ./arch/x86/include/asm/bug.h:114,
                 from ./include/linux/bug.h:5,
                 from ./arch/x86/include/asm/paravirt.h:19,
                 from ./arch/x86/include/asm/cpuid/api.h:57,
                 from ./arch/x86/include/asm/cpuid.h:6,
                 from ./arch/x86/include/asm/processor.h:19,
                 from ./arch/x86/include/asm/timex.h:5,
                 from ./include/linux/timex.h:67,
                 from ./include/linux/time32.h:13,
                 from ./include/linux/time.h:60,
                 from ./include/linux/stat.h:19,
                 from ./include/linux/module.h:13,
                 from drivers/scsi/dc395x.c:49:

drivers/scsi/dc395x.c: In function ‘build_srb’:
drivers/scsi/dc395x.c:893:31: error: ‘struct scsi_cmnd’ has no member named ‘bufflen’
893 | cmd->bufflen, scsi_sglist(cmd),
scsi_sg_count(cmd),
| ^~
./include/linux/printk.h:479:33: note: in definition of macro ‘printk_index_wrap’

  479 |                 _p_func(_fmt, ##__VA_ARGS__); 
        \
      |                                 ^~~~~~~~~~~
drivers/scsi/dc395x.c:113:5: note: in expansion of macro ‘printk’
  113 |     printk(level DC395X_NAME ": " format , ## arg)
      |     ^~~~~~
drivers/scsi/dc395x.c:126:25: note: in expansion of macro ‘dprintkl’
  126 |                         dprintkl(KERN_DEBUG , format , ## arg); \
      |                         ^~~~~~~~
drivers/scsi/dc395x.c:891:17: note: in expansion of macro ‘dprintkdbg’
  891 |                 dprintkdbg(DBG_0,
      |                 ^~~~~~~~~~
./include/linux/kern_levels.h:5:25: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘dma_addr_t’ {aka ‘long long unsigned int’} [-Werror=format=]
    5 | #define KERN_SOH        "\001"          /* ASCII Start Of Header */
      |                         ^~~~~~
./include/linux/printk.h:479:25: note: in definition of macro ‘printk_index_wrap’
  479 |                 _p_func(_fmt, ##__VA_ARGS__); 
        \
      |                         ^~~~
drivers/scsi/dc395x.c:113:5: note: in expansion of macro ‘printk’
  113 |     printk(level DC395X_NAME ": " format , ## arg)
      |     ^~~~~~

... etc

I stumbled upon this because of a spelling mistake in the following line in function srb_done():

        dprintkdbg(DBG_SG, "srb_done: srb=%p sg=%i(%i/%i) buf=%p\n",
                   srb, scsi_sg_count(cmd), srb->sg_index, srb->sg_count,
                   scsi_sgtalbe(cmd));

scsi_sgtalbe should be scsi_sgtable(), and this was introduced into the driver back in commit:

a862ea31655a3 (FUJITA Tomonori 2007-05-26 02:07:09 +0900 3162

Colin