All of lore.kernel.org
 help / color / mirror / Atom feed
* [mkp-scsi:for-next 88/112] drivers/scsi/qlogicfas408.c:410:21: warning: variable 'result' is uninitialized when used here
@ 2021-05-26 10:08 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-05-26 10:08 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 7363 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
head:   46ded13dd3821d96fee65f0cef4bd8f0184607ab
commit: e8a04ec2098f2880995a9d8aa6580e6a7cb04824 [88/112] scsi: qlogicfas408: make Ml_pcmd() a void function
config: x86_64-randconfig-a014-20210526 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 99155e913e9bad5f7f8a247f8bb3a3ff3da74af1)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git/commit/?id=e8a04ec2098f2880995a9d8aa6580e6a7cb04824
        git remote add mkp-scsi https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git
        git fetch --no-tags mkp-scsi for-next
        git checkout e8a04ec2098f2880995a9d8aa6580e6a7cb04824
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

>> drivers/scsi/qlogicfas408.c:410:21: warning: variable 'result' is uninitialized when used here [-Wuninitialized]
           set_host_byte(cmd, result);
                              ^~~~~~
   drivers/scsi/qlogicfas408.c:263:21: note: initialize the variable 'result' to silence this warning
           unsigned int result;    /* ultimate return result */
                              ^
                               = 0
   1 warning generated.


vim +/result +410 drivers/scsi/qlogicfas408.c

   254	
   255	/*
   256	 *	Process scsi command - usually after interrupt 
   257	 */
   258	
   259	static void ql_pcmd(struct scsi_cmnd *cmd)
   260	{
   261		unsigned int i, j;
   262		unsigned long k;
   263		unsigned int result;	/* ultimate return result */
   264		unsigned int status;	/* scsi returned status */
   265		unsigned int message;	/* scsi returned message */
   266		unsigned int phase;	/* recorded scsi phase */
   267		unsigned int reqlen;	/* total length of transfer */
   268		char *buf;
   269		struct qlogicfas408_priv *priv = get_priv_by_cmd(cmd);
   270		int qbase = priv->qbase;
   271		int int_type = priv->int_type;
   272	
   273		rtrc(1)
   274		j = inb(qbase + 6);
   275		i = inb(qbase + 5);
   276		if (i == 0x20) {
   277			set_host_byte(cmd, DID_NO_CONNECT);
   278			return;
   279		}
   280		i |= inb(qbase + 5);	/* the 0x10 bit can be set after the 0x08 */
   281		if (i != 0x18) {
   282			printk(KERN_ERR "Ql:Bad Interrupt status:%02x\n", i);
   283			ql_zap(priv);
   284			set_host_byte(cmd, DID_BAD_INTR);
   285			return;
   286		}
   287		j &= 7;			/* j = inb( qbase + 7 ) >> 5; */
   288	
   289		/* correct status is supposed to be step 4 */
   290		/* it sometimes returns step 3 but with 0 bytes left to send */
   291		/* We can try stuffing the FIFO with the max each time, but we will get a
   292		   sequence of 3 if any bytes are left (but we do flush the FIFO anyway */
   293	
   294		if (j != 3 && j != 4) {
   295			printk(KERN_ERR "Ql:Bad sequence for command %d, int %02X, cmdleft = %d\n",
   296			     j, i, inb(qbase + 7) & 0x1f);
   297			ql_zap(priv);
   298			set_host_byte (cmd, DID_ERROR);
   299			return;
   300		}
   301	
   302		if (inb(qbase + 7) & 0x1f)	/* if some bytes in fifo */
   303			outb(1, qbase + 3);	/* clear fifo */
   304		/* note that request_bufflen is the total xfer size when sg is used */
   305		reqlen = scsi_bufflen(cmd);
   306		/* note that it won't work if transfers > 16M are requested */
   307		if (reqlen && !((phase = inb(qbase + 4)) & 6)) {	/* data phase */
   308			struct scatterlist *sg;
   309			rtrc(2)
   310			outb(reqlen, qbase);	/* low-mid xfer cnt */
   311			outb(reqlen >> 8, qbase + 1);	/* low-mid xfer cnt */
   312			outb(reqlen >> 16, qbase + 0xe);	/* high xfer cnt */
   313			outb(0x90, qbase + 3);	/* command do xfer */
   314			/* PIO pseudo DMA to buffer or sglist */
   315			REG1;
   316	
   317			scsi_for_each_sg(cmd, sg, scsi_sg_count(cmd), i) {
   318				if (priv->qabort) {
   319					REG0;
   320					set_host_byte(cmd,
   321						      priv->qabort == 1 ?
   322						      DID_ABORT : DID_RESET);
   323				}
   324				buf = sg_virt(sg);
   325				if (ql_pdma(priv, phase, buf, sg->length))
   326					break;
   327			}
   328			REG0;
   329			rtrc(2);
   330			/*
   331			 *	Wait for irq (split into second state of irq handler
   332			 *	if this can take time) 
   333			 */
   334			if ((k = ql_wai(priv))) {
   335				set_host_byte(cmd, k);
   336				return;
   337			}
   338			k = inb(qbase + 5);	/* should be 0x10, bus service */
   339		}
   340	
   341		/*
   342		 *	Enter Status (and Message In) Phase 
   343		 */
   344		 
   345		k = jiffies + WATCHDOG;
   346	
   347		while (time_before(jiffies, k) && !priv->qabort &&
   348							!(inb(qbase + 4) & 6))
   349			cpu_relax();	/* wait for status phase */
   350	
   351		if (time_after_eq(jiffies, k)) {
   352			ql_zap(priv);
   353			set_host_byte(cmd, DID_TIME_OUT);
   354			return;
   355		}
   356	
   357		/* FIXME: timeout ?? */
   358		while (inb(qbase + 5))
   359			cpu_relax();	/* clear pending ints */
   360	
   361		if (priv->qabort) {
   362			set_host_byte(cmd,
   363				      priv->qabort == 1 ? DID_ABORT : DID_RESET);
   364			return;
   365		}
   366	
   367		outb(0x11, qbase + 3);	/* get status and message */
   368		if ((k = ql_wai(priv))) {
   369			set_host_byte(cmd, k);
   370			return;
   371		}
   372		i = inb(qbase + 5);	/* get chip irq stat */
   373		j = inb(qbase + 7) & 0x1f;	/* and bytes rec'd */
   374		status = inb(qbase + 2);
   375		message = inb(qbase + 2);
   376	
   377		/*
   378		 *	Should get function complete int if Status and message, else 
   379		 *	bus serv if only status 
   380		 */
   381		if (!((i == 8 && j == 2) || (i == 0x10 && j == 1))) {
   382			printk(KERN_ERR "Ql:Error during status phase, int=%02X, %d bytes recd\n", i, j);
   383			set_host_byte(cmd, DID_ERROR);
   384		}
   385		outb(0x12, qbase + 3);	/* done, disconnect */
   386		rtrc(1);
   387		if ((k = ql_wai(priv))) {
   388			set_host_byte(cmd, k);
   389			return;
   390		}
   391	
   392		/*
   393		 *	Should get bus service interrupt and disconnect interrupt 
   394		 */
   395		 
   396		i = inb(qbase + 5);	/* should be bus service */
   397		while (!priv->qabort && ((i & 0x20) != 0x20)) {
   398			barrier();
   399			cpu_relax();
   400			i |= inb(qbase + 5);
   401		}
   402		rtrc(0);
   403	
   404		if (priv->qabort) {
   405			set_host_byte(cmd,
   406				      priv->qabort == 1 ? DID_ABORT : DID_RESET);
   407			return;
   408		}
   409	
 > 410		set_host_byte(cmd, result);
   411		set_msg_byte(cmd, message);
   412		set_status_byte(cmd, status);
   413		return;
   414	}
   415	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 37529 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-05-26 10:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-26 10:08 [mkp-scsi:for-next 88/112] drivers/scsi/qlogicfas408.c:410:21: warning: variable 'result' is uninitialized when used here kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.