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

2019-10-21 Thread kbuild test robot
Hi Hannes,

I love your patch! Yet something to improve:

[auto build test ERROR on mkp-scsi/for-next]
[cannot apply to v5.4-rc4 next-20191021]
[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/scsi-Revamp-result-values/20191022-004918
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
config: powerpc-defconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 7.4.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
GCC_VERSION=7.4.0 make.cross ARCH=powerpc 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot 

All errors (new ones prefixed by >>):

   drivers/scsi/ibmvscsi/ibmvscsi.c: In function 'handle_cmd_rsp':
>> drivers/scsi/ibmvscsi/ibmvscsi.c:989:39: error: 'CHECK_CONDITION' undeclared 
>> (first use in this function); did you mean 'H_MR_CONDITION'?
  if (((cmnd->result >> 1) & 0x1f) == CHECK_CONDITION)
  ^~~
  H_MR_CONDITION
   drivers/scsi/ibmvscsi/ibmvscsi.c:989:39: note: each undeclared identifier is 
reported only once for each function it appears in

vim +989 drivers/scsi/ibmvscsi/ibmvscsi.c

^1da177e4c3f41 Linus Torvalds  2005-04-16   968  
^1da177e4c3f41 Linus Torvalds  2005-04-16   969  /**
^1da177e4c3f41 Linus Torvalds  2005-04-16   970   * handle_cmd_rsp: -  Handle 
responses from commands
^1da177e4c3f41 Linus Torvalds  2005-04-16   971   * @evt_struct:
srp_event_struct to be handled
^1da177e4c3f41 Linus Torvalds  2005-04-16   972   *
^1da177e4c3f41 Linus Torvalds  2005-04-16   973   * Used as a callback by when 
sending scsi cmds.
^1da177e4c3f41 Linus Torvalds  2005-04-16   974   * Gets called by 
ibmvscsi_handle_crq()
^1da177e4c3f41 Linus Torvalds  2005-04-16   975  */
^1da177e4c3f41 Linus Torvalds  2005-04-16   976  static void 
handle_cmd_rsp(struct srp_event_struct *evt_struct)
^1da177e4c3f41 Linus Torvalds  2005-04-16   977  {
^1da177e4c3f41 Linus Torvalds  2005-04-16   978 struct srp_rsp *rsp = 
&evt_struct->xfer_iu->srp.rsp;
^1da177e4c3f41 Linus Torvalds  2005-04-16   979 struct scsi_cmnd *cmnd 
= evt_struct->cmnd;
^1da177e4c3f41 Linus Torvalds  2005-04-16   980  
ef265673434680 FUJITA Tomonori 2006-03-26   981 if 
(unlikely(rsp->opcode != SRP_RSP)) {
^1da177e4c3f41 Linus Torvalds  2005-04-16   982 if 
(printk_ratelimit())
6c0a60ec52042e Brian King  2007-06-13   983 
dev_warn(evt_struct->hostdata->dev,
15c9274699e8b6 Tyrel Datwyler  2016-12-07   984 
 "bad SRP RSP type %#02x\n", rsp->opcode);
^1da177e4c3f41 Linus Torvalds  2005-04-16   985 }
^1da177e4c3f41 Linus Torvalds  2005-04-16   986 
^1da177e4c3f41 Linus Torvalds  2005-04-16   987 if (cmnd) {
c3a3b55ae80a0d Brian King  2008-04-25   988 cmnd->result |= 
rsp->status;
^1da177e4c3f41 Linus Torvalds  2005-04-16  @989 if 
(((cmnd->result >> 1) & 0x1f) == CHECK_CONDITION)
^1da177e4c3f41 Linus Torvalds  2005-04-16   990 
memcpy(cmnd->sense_buffer,
ef265673434680 FUJITA Tomonori 2006-03-26   991
rsp->data,
72264eb6dbb909 Anton Blanchard 2013-09-03   992
be32_to_cpu(rsp->sense_data_len));
^1da177e4c3f41 Linus Torvalds  2005-04-16   993 
unmap_cmd_data(&evt_struct->iu.srp.cmd, 
4dddbc26c3895e James Bottomley 2005-09-06   994
evt_struct, 
^1da177e4c3f41 Linus Torvalds  2005-04-16   995
evt_struct->hostdata->dev);
^1da177e4c3f41 Linus Torvalds  2005-04-16   996  
ef265673434680 FUJITA Tomonori 2006-03-26   997 if (rsp->flags 
& SRP_RSP_FLAG_DOOVER)
72264eb6dbb909 Anton Blanchard 2013-09-03   998 
scsi_set_resid(cmnd,
72264eb6dbb909 Anton Blanchard 2013-09-03   999 
   be32_to_cpu(rsp->data_out_res_cnt));
ef265673434680 FUJITA Tomonori 2006-03-26  1000 else if 
(rsp->flags & SRP_RSP_FLAG_DIOVER)
72264eb6dbb909 Anton Blanchard 2013-09-03  1001 
scsi_set_resid(cmnd, be32_to_cpu(rsp->data_in_res_cnt));
^1da177e4c3f41 Linus Torvalds  2005-04-16  1002 }
^1da177e4c3f41 Linus Torvalds  2005-04-16  1003  
^1da177e4c3f41 Linus Torvalds  2005-04-16  1004 if 
(evt_struct->cmnd_done)
^1da177e4c3f41 Linus Torvalds  2005-04-16  1005 
evt_struct->cmnd_done(cmnd);
^1da177e4c3f41 Linus Torvalds  2005-04-16  1006

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

2019-10-21 Thread kbuild test robot
Hi Hannes,

I love your patch! Yet something to improve:

[auto build test ERROR on mkp-scsi/for-next]
[cannot apply to v5.4-rc4 next-20191021]
[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/scsi-Revamp-result-values/20191022-004918
base:   https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-gcc (GCC) 7.4.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
GCC_VERSION=7.4.0 make.cross ARCH=sh 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot 

All errors (new ones prefixed by >>):

   drivers/scsi/pcmcia/nsp_cs.c: In function 'nsp_queuecommand_lck':
>> drivers/scsi/pcmcia/nsp_cs.c:226:22: error: 'CHECK_CONDITION' undeclared 
>> (first use in this function); did you mean 'SEC_CONVERSION'?
 SCpnt->SCp.Status = CHECK_CONDITION;
 ^~~
 SEC_CONVERSION
   drivers/scsi/pcmcia/nsp_cs.c:226:22: note: each undeclared identifier is 
reported only once for each function it appears in

vim +226 drivers/scsi/pcmcia/nsp_cs.c

^1da177e4c3f41 Linus Torvalds 2005-04-16  221  
^1da177e4c3f41 Linus Torvalds 2005-04-16  222   show_command(SCpnt);
^1da177e4c3f41 Linus Torvalds 2005-04-16  223  
^1da177e4c3f41 Linus Torvalds 2005-04-16  224   data->CurrentSC = SCpnt;
^1da177e4c3f41 Linus Torvalds 2005-04-16  225  
^1da177e4c3f41 Linus Torvalds 2005-04-16 @226   SCpnt->SCp.Status   = 
CHECK_CONDITION;
^1da177e4c3f41 Linus Torvalds 2005-04-16  227   SCpnt->SCp.Message  = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16  228   SCpnt->SCp.have_data_in = 
IO_UNKNOWN;
^1da177e4c3f41 Linus Torvalds 2005-04-16  229   SCpnt->SCp.sent_command = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16  230   SCpnt->SCp.phase= 
PH_UNDETERMINED;
040cd23242413a Boaz Harrosh   2007-08-16  231   scsi_set_resid(SCpnt, 
scsi_bufflen(SCpnt));
^1da177e4c3f41 Linus Torvalds 2005-04-16  232  
^1da177e4c3f41 Linus Torvalds 2005-04-16  233   /* setup scratch area
^1da177e4c3f41 Linus Torvalds 2005-04-16  234  SCp.ptr  : 
buffer pointer
^1da177e4c3f41 Linus Torvalds 2005-04-16  235  SCp.this_residual: 
buffer length
^1da177e4c3f41 Linus Torvalds 2005-04-16  236  SCp.buffer   : next 
buffer
^1da177e4c3f41 Linus Torvalds 2005-04-16  237  SCp.buffers_residual : left 
buffers in list
^1da177e4c3f41 Linus Torvalds 2005-04-16  238  SCp.phase: 
current state of the command */
040cd23242413a Boaz Harrosh   2007-08-16  239   if (scsi_bufflen(SCpnt)) {
040cd23242413a Boaz Harrosh   2007-08-16  240   SCpnt->SCp.buffer   
= scsi_sglist(SCpnt);
^1da177e4c3f41 Linus Torvalds 2005-04-16  241   SCpnt->SCp.ptr  
= BUFFER_ADDR;
^1da177e4c3f41 Linus Torvalds 2005-04-16  242   
SCpnt->SCp.this_residual= SCpnt->SCp.buffer->length;
040cd23242413a Boaz Harrosh   2007-08-16  243   
SCpnt->SCp.buffers_residual = scsi_sg_count(SCpnt) - 1;
^1da177e4c3f41 Linus Torvalds 2005-04-16  244   } else {
040cd23242413a Boaz Harrosh   2007-08-16  245   SCpnt->SCp.ptr  
= NULL;
040cd23242413a Boaz Harrosh   2007-08-16  246   
SCpnt->SCp.this_residual= 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16  247   SCpnt->SCp.buffer   
= NULL;
^1da177e4c3f41 Linus Torvalds 2005-04-16  248   
SCpnt->SCp.buffers_residual = 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16  249   }
^1da177e4c3f41 Linus Torvalds 2005-04-16  250  
^1da177e4c3f41 Linus Torvalds 2005-04-16  251   if 
(nsphw_start_selection(SCpnt) == FALSE) {
^1da177e4c3f41 Linus Torvalds 2005-04-16  252   
nsp_dbg(NSP_DEBUG_QUEUECOMMAND, "selection fail");
^1da177e4c3f41 Linus Torvalds 2005-04-16  253   SCpnt->result   = 
DID_BUS_BUSY << 16;
^1da177e4c3f41 Linus Torvalds 2005-04-16  254   nsp_scsi_done(SCpnt);
^1da177e4c3f41 Linus Torvalds 2005-04-16  255   return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16  256   }
^1da177e4c3f41 Linus Torvalds 2005-04-16  257  
^1da177e4c3f41 Linus Torvalds 2005-04-16  258  
^1da177e4c3f41 Linus Torvalds 2005-04-16  259   
//nsp_dbg(NSP_DEBUG_QUEUECOMMAND, "out");
^1da177e4c3f41 Linus Torvalds 2005-04-16  260  #ifdef NSP_DEBUG
^1da177e4c3f41 Linus Torvalds 2005-04-16  261   data->CmdId++;
^1da177e4c3f41 Linus Torvalds 2005-04-16  262  #endif
^1da177e4c3f41 Linus Torvalds 2005-04-16  263   return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16  264  }
^1da177e4c3f41 Linus Torvalds 2005-04-16  265  

:: The code at line 226 

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

2019-10-21 Thread Hannes Reinecke
After several years it's time to finally kill them.

Signed-off-by: Hannes Reinecke 
---
 include/scsi/scsi_proto.h | 19 ---
 1 file changed, 19 deletions(-)

diff --git a/include/scsi/scsi_proto.h b/include/scsi/scsi_proto.h
index c36860111932..660f37ce8721 100644
--- a/include/scsi/scsi_proto.h
+++ b/include/scsi/scsi_proto.h
@@ -202,25 +202,6 @@ struct scsi_varlen_cdb_hdr {
 #define SAM_STAT_ACA_ACTIVE  0x30
 #define SAM_STAT_TASK_ABORTED0x40
 
-/*
- *  Status codes. These are deprecated as they are shifted 1 bit right
- *  from those found in the SCSI standards. This causes confusion for
- *  applications that are ported to several OSes. Prefer SAM Status codes
- *  above.
- */
-
-#define GOOD 0x00
-#define CHECK_CONDITION  0x01
-#define CONDITION_GOOD   0x02
-#define BUSY 0x04
-#define INTERMEDIATE_GOOD0x08
-#define INTERMEDIATE_C_GOOD  0x0a
-#define RESERVATION_CONFLICT 0x0c
-#define COMMAND_TERMINATED   0x11
-#define QUEUE_FULL   0x14
-#define ACA_ACTIVE   0x18
-#define TASK_ABORTED 0x20
-
 #define STATUS_MASK  0xfe
 
 /*
-- 
2.16.4