Skip to contentSkip to conversation

scsi: elx: efct: Driver initialization routines

bug report Dan Carpenter 1 participant 1 message Jun 18, 2021 SCSI

lore
Share & tools
lore
#0 lore raw

Hello James Smart,

The patch 4df84e846624: "scsi: elx: efct: Driver initialization routines" from Jun 1, 2021, leads to the following static checker warning:

drivers/scsi/elx/efct/efct_hw.c:348 efct_hw_iotype_is_originator()
warn: signedness bug returning '(-5)'

drivers/scsi/elx/efct/efct_hw.c
341 static u8 efct_hw_iotype_is_originator(u16 io_type)

               ^^
   342  {
   343          switch (io_type) {
   344          case EFCT_HW_FC_CT:
   345          case EFCT_HW_ELS_REQ:
   346                  return 0;
   347          default:
   348                  return -EIO;
                        ^^^^^^^^^^^^
   349          }
   350  }

Looking at the comments at the call site and the name of this function, I wonder if it's supposed to be a boolean function which returns true if it's the originator.

regards,
dan carpenter