Re: [PATCH 09/24] scsi: Kill obsolete linux-specific status codes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Hannes,

I love your patch! Yet something to improve:

[auto build test ERROR on mkp-scsi/for-next]
[also build test ERROR on v5.4-rc5 next-20191031]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Hannes-Reinecke/Revamp-SCSI-result-values/20191102-095955
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
config: i386-randconfig-a002-201943 (attached as .config)
compiler: gcc-6 (Debian 6.3.0-18+deb9u1) 6.3.0 20170516
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

   drivers/scsi/nsp32.c: In function 'nsp32_queuecommand_lck':
>> drivers/scsi/nsp32.c:938:25: error: 'CHECK_CONDITION' undeclared (first use in this function)
     SCpnt->SCp.Status    = CHECK_CONDITION;
                            ^~~~~~~~~~~~~~~
   drivers/scsi/nsp32.c:938:25: note: each undeclared identifier is reported only once for each function it appears in

vim +/CHECK_CONDITION +938 drivers/scsi/nsp32.c

^1da177e4c3f41 Linus Torvalds  2005-04-16   896  
f281233d3eba15 Jeff Garzik     2010-11-16   897  static int nsp32_queuecommand_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *))
^1da177e4c3f41 Linus Torvalds  2005-04-16   898  {
^1da177e4c3f41 Linus Torvalds  2005-04-16   899  	nsp32_hw_data *data = (nsp32_hw_data *)SCpnt->device->host->hostdata;
^1da177e4c3f41 Linus Torvalds  2005-04-16   900  	nsp32_target *target;
^1da177e4c3f41 Linus Torvalds  2005-04-16   901  	nsp32_lunt   *cur_lunt;
^1da177e4c3f41 Linus Torvalds  2005-04-16   902  	int ret;
^1da177e4c3f41 Linus Torvalds  2005-04-16   903  
^1da177e4c3f41 Linus Torvalds  2005-04-16   904  	nsp32_dbg(NSP32_DEBUG_QUEUECOMMAND,
fc3850458c176a Hans Wennborg   2014-08-05   905  		  "enter. target: 0x%x LUN: 0x%llx cmnd: 0x%x cmndlen: 0x%x "
^1da177e4c3f41 Linus Torvalds  2005-04-16   906  		  "use_sg: 0x%x reqbuf: 0x%lx reqlen: 0x%x",
^1da177e4c3f41 Linus Torvalds  2005-04-16   907  		  SCpnt->device->id, SCpnt->device->lun, SCpnt->cmnd[0], SCpnt->cmd_len,
2e91724658d5d6 FUJITA Tomonori 2007-05-26   908  		  scsi_sg_count(SCpnt), scsi_sglist(SCpnt), scsi_bufflen(SCpnt));
^1da177e4c3f41 Linus Torvalds  2005-04-16   909  
^1da177e4c3f41 Linus Torvalds  2005-04-16   910  	if (data->CurrentSC != NULL) {
^1da177e4c3f41 Linus Torvalds  2005-04-16   911  		nsp32_msg(KERN_ERR, "Currentsc != NULL. Cancel this command request");
^1da177e4c3f41 Linus Torvalds  2005-04-16   912  		data->CurrentSC = NULL;
^1da177e4c3f41 Linus Torvalds  2005-04-16   913  		SCpnt->result   = DID_NO_CONNECT << 16;
^1da177e4c3f41 Linus Torvalds  2005-04-16   914  		done(SCpnt);
^1da177e4c3f41 Linus Torvalds  2005-04-16   915  		return 0;
^1da177e4c3f41 Linus Torvalds  2005-04-16   916  	}
^1da177e4c3f41 Linus Torvalds  2005-04-16   917  
^1da177e4c3f41 Linus Torvalds  2005-04-16   918  	/* check target ID is not same as this initiator ID */
422c0d61d591cb Jeff Garzik     2005-10-24   919  	if (scmd_id(SCpnt) == SCpnt->device->host->this_id) {
9b13494c916dc0 Masanari Iida   2014-08-06   920  		nsp32_dbg(NSP32_DEBUG_QUEUECOMMAND, "target==host???");
^1da177e4c3f41 Linus Torvalds  2005-04-16   921  		SCpnt->result = DID_BAD_TARGET << 16;
^1da177e4c3f41 Linus Torvalds  2005-04-16   922  		done(SCpnt);
^1da177e4c3f41 Linus Torvalds  2005-04-16   923  		return 0;
^1da177e4c3f41 Linus Torvalds  2005-04-16   924  	}
^1da177e4c3f41 Linus Torvalds  2005-04-16   925  
^1da177e4c3f41 Linus Torvalds  2005-04-16   926  	/* check target LUN is allowable value */
^1da177e4c3f41 Linus Torvalds  2005-04-16   927  	if (SCpnt->device->lun >= MAX_LUN) {
^1da177e4c3f41 Linus Torvalds  2005-04-16   928  		nsp32_dbg(NSP32_DEBUG_QUEUECOMMAND, "no more lun");
^1da177e4c3f41 Linus Torvalds  2005-04-16   929  		SCpnt->result = DID_BAD_TARGET << 16;
^1da177e4c3f41 Linus Torvalds  2005-04-16   930  		done(SCpnt);
^1da177e4c3f41 Linus Torvalds  2005-04-16   931  		return 0;
^1da177e4c3f41 Linus Torvalds  2005-04-16   932  	}
^1da177e4c3f41 Linus Torvalds  2005-04-16   933  
^1da177e4c3f41 Linus Torvalds  2005-04-16   934  	show_command(SCpnt);
^1da177e4c3f41 Linus Torvalds  2005-04-16   935  
^1da177e4c3f41 Linus Torvalds  2005-04-16   936  	SCpnt->scsi_done     = done;
^1da177e4c3f41 Linus Torvalds  2005-04-16   937  	data->CurrentSC      = SCpnt;
^1da177e4c3f41 Linus Torvalds  2005-04-16  @938  	SCpnt->SCp.Status    = CHECK_CONDITION;
^1da177e4c3f41 Linus Torvalds  2005-04-16   939  	SCpnt->SCp.Message   = 0;
2e91724658d5d6 FUJITA Tomonori 2007-05-26   940  	scsi_set_resid(SCpnt, scsi_bufflen(SCpnt));
^1da177e4c3f41 Linus Torvalds  2005-04-16   941  
2e91724658d5d6 FUJITA Tomonori 2007-05-26   942  	SCpnt->SCp.ptr		    = (char *)scsi_sglist(SCpnt);
2e91724658d5d6 FUJITA Tomonori 2007-05-26   943  	SCpnt->SCp.this_residual    = scsi_bufflen(SCpnt);
^1da177e4c3f41 Linus Torvalds  2005-04-16   944  	SCpnt->SCp.buffer	    = NULL;
^1da177e4c3f41 Linus Torvalds  2005-04-16   945  	SCpnt->SCp.buffers_residual = 0;
^1da177e4c3f41 Linus Torvalds  2005-04-16   946  
^1da177e4c3f41 Linus Torvalds  2005-04-16   947  	/* initialize data */
^1da177e4c3f41 Linus Torvalds  2005-04-16   948  	data->msgout_len	= 0;
^1da177e4c3f41 Linus Torvalds  2005-04-16   949  	data->msgin_len		= 0;
^1da177e4c3f41 Linus Torvalds  2005-04-16   950  	cur_lunt		= &(data->lunt[SCpnt->device->id][SCpnt->device->lun]);
^1da177e4c3f41 Linus Torvalds  2005-04-16   951  	cur_lunt->SCpnt		= SCpnt;
^1da177e4c3f41 Linus Torvalds  2005-04-16   952  	cur_lunt->save_datp	= 0;
^1da177e4c3f41 Linus Torvalds  2005-04-16   953  	cur_lunt->msgin03	= FALSE;
^1da177e4c3f41 Linus Torvalds  2005-04-16   954  	data->cur_lunt		= cur_lunt;
^1da177e4c3f41 Linus Torvalds  2005-04-16   955  	data->cur_id		= SCpnt->device->id;
^1da177e4c3f41 Linus Torvalds  2005-04-16   956  	data->cur_lun		= SCpnt->device->lun;
^1da177e4c3f41 Linus Torvalds  2005-04-16   957  
^1da177e4c3f41 Linus Torvalds  2005-04-16   958  	ret = nsp32_setup_sg_table(SCpnt);
^1da177e4c3f41 Linus Torvalds  2005-04-16   959  	if (ret == FALSE) {
^1da177e4c3f41 Linus Torvalds  2005-04-16   960  		nsp32_msg(KERN_ERR, "SGT fail");
^1da177e4c3f41 Linus Torvalds  2005-04-16   961  		SCpnt->result = DID_ERROR << 16;
^1da177e4c3f41 Linus Torvalds  2005-04-16   962  		nsp32_scsi_done(SCpnt);
^1da177e4c3f41 Linus Torvalds  2005-04-16   963  		return 0;
^1da177e4c3f41 Linus Torvalds  2005-04-16   964  	}
^1da177e4c3f41 Linus Torvalds  2005-04-16   965  
^1da177e4c3f41 Linus Torvalds  2005-04-16   966  	/* Build IDENTIFY */
^1da177e4c3f41 Linus Torvalds  2005-04-16   967  	nsp32_build_identify(SCpnt);
^1da177e4c3f41 Linus Torvalds  2005-04-16   968  
^1da177e4c3f41 Linus Torvalds  2005-04-16   969  	/* 
^1da177e4c3f41 Linus Torvalds  2005-04-16   970  	 * If target is the first time to transfer after the reset
^1da177e4c3f41 Linus Torvalds  2005-04-16   971  	 * (target don't have SDTR_DONE and SDTR_INITIATOR), sync
^1da177e4c3f41 Linus Torvalds  2005-04-16   972  	 * message SDTR is needed to do synchronous transfer.
^1da177e4c3f41 Linus Torvalds  2005-04-16   973  	 */
422c0d61d591cb Jeff Garzik     2005-10-24   974  	target = &data->target[scmd_id(SCpnt)];
^1da177e4c3f41 Linus Torvalds  2005-04-16   975  	data->cur_target = target;
^1da177e4c3f41 Linus Torvalds  2005-04-16   976  
^1da177e4c3f41 Linus Torvalds  2005-04-16   977  	if (!(target->sync_flag & (SDTR_DONE | SDTR_INITIATOR | SDTR_TARGET))) {
^1da177e4c3f41 Linus Torvalds  2005-04-16   978  		unsigned char period, offset;
^1da177e4c3f41 Linus Torvalds  2005-04-16   979  
^1da177e4c3f41 Linus Torvalds  2005-04-16   980  		if (trans_mode != ASYNC_MODE) {
^1da177e4c3f41 Linus Torvalds  2005-04-16   981  			nsp32_set_max_sync(data, target, &period, &offset);
^1da177e4c3f41 Linus Torvalds  2005-04-16   982  			nsp32_build_sdtr(SCpnt, period, offset);
^1da177e4c3f41 Linus Torvalds  2005-04-16   983  			target->sync_flag |= SDTR_INITIATOR;
^1da177e4c3f41 Linus Torvalds  2005-04-16   984  		} else {
^1da177e4c3f41 Linus Torvalds  2005-04-16   985  			nsp32_set_async(data, target);
^1da177e4c3f41 Linus Torvalds  2005-04-16   986  			target->sync_flag |= SDTR_DONE;
^1da177e4c3f41 Linus Torvalds  2005-04-16   987  		}
^1da177e4c3f41 Linus Torvalds  2005-04-16   988  
^1da177e4c3f41 Linus Torvalds  2005-04-16   989  		nsp32_dbg(NSP32_DEBUG_QUEUECOMMAND,
^1da177e4c3f41 Linus Torvalds  2005-04-16   990  			  "SDTR: entry: %d start_period: 0x%x offset: 0x%x\n",
^1da177e4c3f41 Linus Torvalds  2005-04-16   991  			  target->limit_entry, period, offset);
^1da177e4c3f41 Linus Torvalds  2005-04-16   992  	} else if (target->sync_flag & SDTR_INITIATOR) {
^1da177e4c3f41 Linus Torvalds  2005-04-16   993  		/*
^1da177e4c3f41 Linus Torvalds  2005-04-16   994  		 * It was negotiating SDTR with target, sending from the
^1da177e4c3f41 Linus Torvalds  2005-04-16   995  		 * initiator, but there are no chance to remove this flag.
^1da177e4c3f41 Linus Torvalds  2005-04-16   996  		 * Set async because we don't get proper negotiation.
^1da177e4c3f41 Linus Torvalds  2005-04-16   997  		 */
^1da177e4c3f41 Linus Torvalds  2005-04-16   998  		nsp32_set_async(data, target);
^1da177e4c3f41 Linus Torvalds  2005-04-16   999  		target->sync_flag &= ~SDTR_INITIATOR;
^1da177e4c3f41 Linus Torvalds  2005-04-16  1000  		target->sync_flag |= SDTR_DONE;
^1da177e4c3f41 Linus Torvalds  2005-04-16  1001  
^1da177e4c3f41 Linus Torvalds  2005-04-16  1002  		nsp32_dbg(NSP32_DEBUG_QUEUECOMMAND,
^1da177e4c3f41 Linus Torvalds  2005-04-16  1003  			  "SDTR_INITIATOR: fall back to async");
^1da177e4c3f41 Linus Torvalds  2005-04-16  1004  	} else if (target->sync_flag & SDTR_TARGET) {
^1da177e4c3f41 Linus Torvalds  2005-04-16  1005  		/*
^1da177e4c3f41 Linus Torvalds  2005-04-16  1006  		 * It was negotiating SDTR with target, sending from target,
^1da177e4c3f41 Linus Torvalds  2005-04-16  1007  		 * but there are no chance to remove this flag.  Set async
^1da177e4c3f41 Linus Torvalds  2005-04-16  1008  		 * because we don't get proper negotiation.
^1da177e4c3f41 Linus Torvalds  2005-04-16  1009  		 */
^1da177e4c3f41 Linus Torvalds  2005-04-16  1010  		nsp32_set_async(data, target);
^1da177e4c3f41 Linus Torvalds  2005-04-16  1011  		target->sync_flag &= ~SDTR_TARGET;
^1da177e4c3f41 Linus Torvalds  2005-04-16  1012  		target->sync_flag |= SDTR_DONE;
^1da177e4c3f41 Linus Torvalds  2005-04-16  1013  
^1da177e4c3f41 Linus Torvalds  2005-04-16  1014  		nsp32_dbg(NSP32_DEBUG_QUEUECOMMAND,
^1da177e4c3f41 Linus Torvalds  2005-04-16  1015  			  "Unknown SDTR from target is reached, fall back to async.");
^1da177e4c3f41 Linus Torvalds  2005-04-16  1016  	}
^1da177e4c3f41 Linus Torvalds  2005-04-16  1017  
^1da177e4c3f41 Linus Torvalds  2005-04-16  1018  	nsp32_dbg(NSP32_DEBUG_TARGETFLAG,
^1da177e4c3f41 Linus Torvalds  2005-04-16  1019  		  "target: %d sync_flag: 0x%x syncreg: 0x%x ackwidth: 0x%x",
^1da177e4c3f41 Linus Torvalds  2005-04-16  1020  		  SCpnt->device->id, target->sync_flag, target->syncreg,
^1da177e4c3f41 Linus Torvalds  2005-04-16  1021  		  target->ackwidth);
^1da177e4c3f41 Linus Torvalds  2005-04-16  1022  
^1da177e4c3f41 Linus Torvalds  2005-04-16  1023  	/* Selection */
^1da177e4c3f41 Linus Torvalds  2005-04-16  1024  	if (auto_param == 0) {
^1da177e4c3f41 Linus Torvalds  2005-04-16  1025  		ret = nsp32_selection_autopara(SCpnt);
^1da177e4c3f41 Linus Torvalds  2005-04-16  1026  	} else {
^1da177e4c3f41 Linus Torvalds  2005-04-16  1027  		ret = nsp32_selection_autoscsi(SCpnt);
^1da177e4c3f41 Linus Torvalds  2005-04-16  1028  	}
^1da177e4c3f41 Linus Torvalds  2005-04-16  1029  
^1da177e4c3f41 Linus Torvalds  2005-04-16  1030  	if (ret != TRUE) {
^1da177e4c3f41 Linus Torvalds  2005-04-16  1031  		nsp32_dbg(NSP32_DEBUG_QUEUECOMMAND, "selection fail");
^1da177e4c3f41 Linus Torvalds  2005-04-16  1032  		nsp32_scsi_done(SCpnt);
^1da177e4c3f41 Linus Torvalds  2005-04-16  1033  	}
^1da177e4c3f41 Linus Torvalds  2005-04-16  1034  
^1da177e4c3f41 Linus Torvalds  2005-04-16  1035  	return 0;
^1da177e4c3f41 Linus Torvalds  2005-04-16  1036  }
^1da177e4c3f41 Linus Torvalds  2005-04-16  1037  

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

:::::: TO: Linus Torvalds <torvalds@xxxxxxxxxxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux