diff mbox

qlogic_stub: Fixup NULL argument to host_reset()

Message ID 20180504114838.39646-1-hare@suse.de (mailing list archive)
State Changes Requested
Headers show

Commit Message

Hannes Reinecke May 4, 2018, 11:48 a.m. UTC
The PCMCIA stub calls host_reset() with a NULL argument, which
is always wrong. So build a dummy scsi command to restore
functionality.

Fixes: 4a56c1c166b6: "scsi: qlogicfas: move bus_reset to host_reset"
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hannes Reinecke <hare@suse.com>
---
 drivers/scsi/pcmcia/qlogic_stub.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

Comments

kernel test robot May 5, 2018, 10:16 a.m. UTC | #1
Hi Hannes,

I love your patch! Yet something to improve:

[auto build test ERROR on mkp-scsi/for-next]
[also build test ERROR on v4.17-rc3 next-20180504]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Hannes-Reinecke/qlogic_stub-Fixup-NULL-argument-to-host_reset/20180505-172602
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
config: parisc-allmodconfig (attached as .config)
compiler: hppa-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=parisc 

All errors (new ones prefixed by >>):

   drivers/scsi/pcmcia/qlogic_stub.c: In function 'qlogic_resume':
>> drivers/scsi/pcmcia/qlogic_stub.c:270:6: error: invalid type argument of '->' (have 'struct scsi_cmnd')
     scmd->device = &sdev;
         ^~
>> drivers/scsi/pcmcia/qlogic_stub.c:272:26: error: incompatible type for argument 1 of 'qlogicfas408_host_reset'
     qlogicfas408_host_reset(scmd);
                             ^~~~
   In file included from drivers/scsi/pcmcia/qlogic_stub.c:49:0:
   drivers/scsi/pcmcia/../qlogicfas408.h:112:12: note: expected 'struct scsi_cmnd *' but argument is of type 'struct scsi_cmnd'
    extern int qlogicfas408_host_reset(struct scsi_cmnd *cmd);
               ^~~~~~~~~~~~~~~~~~~~~~~

vim +270 drivers/scsi/pcmcia/qlogic_stub.c

   253	
   254	static int qlogic_resume(struct pcmcia_device *link)
   255	{
   256		scsi_info_t *info = link->priv;
   257		/* Dummy command for host_reset function */
   258		struct scsi_cmnd scmd;
   259		struct scsi_device sdev;
   260	
   261		pcmcia_enable_device(link);
   262		if ((info->manf_id == MANFID_MACNICA) ||
   263		    (info->manf_id == MANFID_PIONEER) ||
   264		    (info->manf_id == 0x0098)) {
   265			outb(0x80, link->resource[0]->start + 0xd);
   266			outb(0x24, link->resource[0]->start + 0x9);
   267			outb(0x04, link->resource[0]->start + 0xd);
   268		}
   269		sdev.host = info->host;
 > 270		scmd->device = &sdev;
   271	
 > 272		qlogicfas408_host_reset(scmd);
   273	
   274		return 0;
   275	}
   276	

---
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/pcmcia/qlogic_stub.c b/drivers/scsi/pcmcia/qlogic_stub.c
index 0556054764dc..6a3b71e3f351 100644
--- a/drivers/scsi/pcmcia/qlogic_stub.c
+++ b/drivers/scsi/pcmcia/qlogic_stub.c
@@ -254,6 +254,9 @@  static void qlogic_release(struct pcmcia_device *link)
 static int qlogic_resume(struct pcmcia_device *link)
 {
 	scsi_info_t *info = link->priv;
+	/* Dummy command for host_reset function */
+	struct scsi_cmnd scmd;
+	struct scsi_device sdev;
 
 	pcmcia_enable_device(link);
 	if ((info->manf_id == MANFID_MACNICA) ||
@@ -263,8 +266,10 @@  static int qlogic_resume(struct pcmcia_device *link)
 		outb(0x24, link->resource[0]->start + 0x9);
 		outb(0x04, link->resource[0]->start + 0xd);
 	}
-	/* Ugggglllyyyy!!! */
-	qlogicfas408_host_reset(NULL);
+	sdev.host = info->host;
+	scmd->device = &sdev;
+
+	qlogicfas408_host_reset(scmd);
 
 	return 0;
 }