All of lore.kernel.org
 help / color / mirror / Atom feed
* [hch-misc:remove-scsi_request 3/3] drivers/usb/storage/cypress_atacb.c:180:27: error: assignment to expression with array type
@ 2022-02-10 11:13 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-02-10 11:13 UTC (permalink / raw)
  To: kbuild-all

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

tree:   git://git.infradead.org/users/hch/misc.git remove-scsi_request
head:   5677caa4ec3d9eab6e96ed17cd19f3b82589caf0
commit: 5677caa4ec3d9eab6e96ed17cd19f3b82589caf0 [3/3] scsi: remove the cdb field from struct scsi_request
config: h8300-randconfig-r035-20220210 (https://download.01.org/0day-ci/archive/20220210/202202101930.FPTl9w8H-lkp(a)intel.com/config)
compiler: h8300-linux-gcc (GCC) 11.2.0
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
        git remote add hch-misc git://git.infradead.org/users/hch/misc.git
        git fetch --no-tags hch-misc remove-scsi_request
        git checkout 5677caa4ec3d9eab6e96ed17cd19f3b82589caf0
        # save the config file to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=h8300 SHELL=/bin/bash drivers/usb/storage/

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

All errors (new ones prefixed by >>):

   drivers/usb/storage/cypress_atacb.c: In function 'cypress_atacb_passthrough':
>> drivers/usb/storage/cypress_atacb.c:180:27: error: assignment to expression with array type
     180 |                 srb->cmnd = ses.cmnd;
         |                           ^


vim +180 drivers/usb/storage/cypress_atacb.c

fcdb51401f7f69 Alan Stern      2009-02-12   64  
fcdb51401f7f69 Alan Stern      2009-02-12   65  
d277064e7e16d0 Matthieu CASTET 2008-03-19   66  /*
d277064e7e16d0 Matthieu CASTET 2008-03-19   67   * ATACB is a protocol used on cypress usb<->ata bridge to
d277064e7e16d0 Matthieu CASTET 2008-03-19   68   * send raw ATA command over mass storage
d277064e7e16d0 Matthieu CASTET 2008-03-19   69   * There is a ATACB2 protocol that support LBA48 on newer chip.
d277064e7e16d0 Matthieu CASTET 2008-03-19   70   * More info that be found on cy7c68310_8.pdf and cy7c68300c_8.pdf
d277064e7e16d0 Matthieu CASTET 2008-03-19   71   * datasheet from cypress.com.
d277064e7e16d0 Matthieu CASTET 2008-03-19   72   */
fcdb51401f7f69 Alan Stern      2009-02-12   73  static void cypress_atacb_passthrough(struct scsi_cmnd *srb, struct us_data *us)
d277064e7e16d0 Matthieu CASTET 2008-03-19   74  {
d277064e7e16d0 Matthieu CASTET 2008-03-19   75  	unsigned char save_cmnd[MAX_COMMAND_SIZE];
d277064e7e16d0 Matthieu CASTET 2008-03-19   76  
d277064e7e16d0 Matthieu CASTET 2008-03-19   77  	if (likely(srb->cmnd[0] != ATA_16 && srb->cmnd[0] != ATA_12)) {
d277064e7e16d0 Matthieu CASTET 2008-03-19   78  		usb_stor_transparent_scsi_command(srb, us);
d277064e7e16d0 Matthieu CASTET 2008-03-19   79  		return;
d277064e7e16d0 Matthieu CASTET 2008-03-19   80  	}
d277064e7e16d0 Matthieu CASTET 2008-03-19   81  
d277064e7e16d0 Matthieu CASTET 2008-03-19   82  	memcpy(save_cmnd, srb->cmnd, sizeof(save_cmnd));
64a87b244b9297 Boaz Harrosh    2008-04-30   83  	memset(srb->cmnd, 0, MAX_COMMAND_SIZE);
d277064e7e16d0 Matthieu CASTET 2008-03-19   84  
d277064e7e16d0 Matthieu CASTET 2008-03-19   85  	/* check if we support the command */
d277064e7e16d0 Matthieu CASTET 2008-03-19   86  	if (save_cmnd[1] >> 5) /* MULTIPLE_COUNT */
d277064e7e16d0 Matthieu CASTET 2008-03-19   87  		goto invalid_fld;
d277064e7e16d0 Matthieu CASTET 2008-03-19   88  	/* check protocol */
d277064e7e16d0 Matthieu CASTET 2008-03-19   89  	switch ((save_cmnd[1] >> 1) & 0xf) {
d277064e7e16d0 Matthieu CASTET 2008-03-19   90  	case 3: /*no DATA */
d277064e7e16d0 Matthieu CASTET 2008-03-19   91  	case 4: /* PIO in */
d277064e7e16d0 Matthieu CASTET 2008-03-19   92  	case 5: /* PIO out */
d277064e7e16d0 Matthieu CASTET 2008-03-19   93  		break;
d277064e7e16d0 Matthieu CASTET 2008-03-19   94  	default:
d277064e7e16d0 Matthieu CASTET 2008-03-19   95  		goto invalid_fld;
d277064e7e16d0 Matthieu CASTET 2008-03-19   96  	}
d277064e7e16d0 Matthieu CASTET 2008-03-19   97  
d277064e7e16d0 Matthieu CASTET 2008-03-19   98  	/* first build the ATACB command */
d277064e7e16d0 Matthieu CASTET 2008-03-19   99  	srb->cmd_len = 16;
d277064e7e16d0 Matthieu CASTET 2008-03-19  100  
f0183a338e4f90 Felipe Balbi    2016-04-18  101  	srb->cmnd[0] = 0x24; /*
f0183a338e4f90 Felipe Balbi    2016-04-18  102  			      * bVSCBSignature : vendor-specific command
f0183a338e4f90 Felipe Balbi    2016-04-18  103  			      * this value can change, but most(all ?) manufacturers
f0183a338e4f90 Felipe Balbi    2016-04-18  104  			      * keep the cypress default : 0x24
f0183a338e4f90 Felipe Balbi    2016-04-18  105  			      */
d277064e7e16d0 Matthieu CASTET 2008-03-19  106  	srb->cmnd[1] = 0x24; /* bVSCBSubCommand : 0x24 for ATACB */
d277064e7e16d0 Matthieu CASTET 2008-03-19  107  
f0183a338e4f90 Felipe Balbi    2016-04-18  108  	srb->cmnd[3] = 0xff - 1; /*
f0183a338e4f90 Felipe Balbi    2016-04-18  109  				  * features, sector count, lba low, lba med
f0183a338e4f90 Felipe Balbi    2016-04-18  110  				  * lba high, device, command are valid
f0183a338e4f90 Felipe Balbi    2016-04-18  111  				  */
d277064e7e16d0 Matthieu CASTET 2008-03-19  112  	srb->cmnd[4] = 1; /* TransferBlockCount : 512 */
d277064e7e16d0 Matthieu CASTET 2008-03-19  113  
d277064e7e16d0 Matthieu CASTET 2008-03-19  114  	if (save_cmnd[0] == ATA_16) {
d277064e7e16d0 Matthieu CASTET 2008-03-19  115  		srb->cmnd[ 6] = save_cmnd[ 4]; /* features */
d277064e7e16d0 Matthieu CASTET 2008-03-19  116  		srb->cmnd[ 7] = save_cmnd[ 6]; /* sector count */
d277064e7e16d0 Matthieu CASTET 2008-03-19  117  		srb->cmnd[ 8] = save_cmnd[ 8]; /* lba low */
d277064e7e16d0 Matthieu CASTET 2008-03-19  118  		srb->cmnd[ 9] = save_cmnd[10]; /* lba med */
d277064e7e16d0 Matthieu CASTET 2008-03-19  119  		srb->cmnd[10] = save_cmnd[12]; /* lba high */
d277064e7e16d0 Matthieu CASTET 2008-03-19  120  		srb->cmnd[11] = save_cmnd[13]; /* device */
d277064e7e16d0 Matthieu CASTET 2008-03-19  121  		srb->cmnd[12] = save_cmnd[14]; /* command */
d277064e7e16d0 Matthieu CASTET 2008-03-19  122  
d277064e7e16d0 Matthieu CASTET 2008-03-19  123  		if (save_cmnd[1] & 0x01) {/* extended bit set for LBA48 */
d277064e7e16d0 Matthieu CASTET 2008-03-19  124  			/* this could be supported by atacb2 */
d277064e7e16d0 Matthieu CASTET 2008-03-19  125  			if (save_cmnd[3] || save_cmnd[5] || save_cmnd[7] || save_cmnd[9]
d277064e7e16d0 Matthieu CASTET 2008-03-19  126  					|| save_cmnd[11])
d277064e7e16d0 Matthieu CASTET 2008-03-19  127  				goto invalid_fld;
d277064e7e16d0 Matthieu CASTET 2008-03-19  128  		}
e9c585907f962a Bas Peters      2015-02-07  129  	} else { /* ATA12 */
d277064e7e16d0 Matthieu CASTET 2008-03-19  130  		srb->cmnd[ 6] = save_cmnd[3]; /* features */
d277064e7e16d0 Matthieu CASTET 2008-03-19  131  		srb->cmnd[ 7] = save_cmnd[4]; /* sector count */
d277064e7e16d0 Matthieu CASTET 2008-03-19  132  		srb->cmnd[ 8] = save_cmnd[5]; /* lba low */
d277064e7e16d0 Matthieu CASTET 2008-03-19  133  		srb->cmnd[ 9] = save_cmnd[6]; /* lba med */
d277064e7e16d0 Matthieu CASTET 2008-03-19  134  		srb->cmnd[10] = save_cmnd[7]; /* lba high */
d277064e7e16d0 Matthieu CASTET 2008-03-19  135  		srb->cmnd[11] = save_cmnd[8]; /* device */
d277064e7e16d0 Matthieu CASTET 2008-03-19  136  		srb->cmnd[12] = save_cmnd[9]; /* command */
d277064e7e16d0 Matthieu CASTET 2008-03-19  137  
d277064e7e16d0 Matthieu CASTET 2008-03-19  138  	}
d277064e7e16d0 Matthieu CASTET 2008-03-19  139  	/* Filter SET_FEATURES - XFER MODE command */
d277064e7e16d0 Matthieu CASTET 2008-03-19  140  	if ((srb->cmnd[12] == ATA_CMD_SET_FEATURES)
d277064e7e16d0 Matthieu CASTET 2008-03-19  141  			&& (srb->cmnd[6] == SETFEATURES_XFER))
d277064e7e16d0 Matthieu CASTET 2008-03-19  142  		goto invalid_fld;
d277064e7e16d0 Matthieu CASTET 2008-03-19  143  
d277064e7e16d0 Matthieu CASTET 2008-03-19  144  	if (srb->cmnd[12] == ATA_CMD_ID_ATA || srb->cmnd[12] == ATA_CMD_ID_ATAPI)
d277064e7e16d0 Matthieu CASTET 2008-03-19  145  		srb->cmnd[2] |= (1<<7); /* set  IdentifyPacketDevice for these cmds */
d277064e7e16d0 Matthieu CASTET 2008-03-19  146  
d277064e7e16d0 Matthieu CASTET 2008-03-19  147  
d277064e7e16d0 Matthieu CASTET 2008-03-19  148  	usb_stor_transparent_scsi_command(srb, us);
d277064e7e16d0 Matthieu CASTET 2008-03-19  149  
f0183a338e4f90 Felipe Balbi    2016-04-18  150  	/* if the device doesn't support ATACB */
d277064e7e16d0 Matthieu CASTET 2008-03-19  151  	if (srb->result == SAM_STAT_CHECK_CONDITION &&
d277064e7e16d0 Matthieu CASTET 2008-03-19  152  			memcmp(srb->sense_buffer, usb_stor_sense_invalidCDB,
d277064e7e16d0 Matthieu CASTET 2008-03-19  153  				sizeof(usb_stor_sense_invalidCDB)) == 0) {
191648d03d2022 Joe Perches     2013-04-19  154  		usb_stor_dbg(us, "cypress atacb not supported ???\n");
d277064e7e16d0 Matthieu CASTET 2008-03-19  155  		goto end;
d277064e7e16d0 Matthieu CASTET 2008-03-19  156  	}
d277064e7e16d0 Matthieu CASTET 2008-03-19  157  
f0183a338e4f90 Felipe Balbi    2016-04-18  158  	/*
f0183a338e4f90 Felipe Balbi    2016-04-18  159  	 * if ck_cond flags is set, and there wasn't critical error,
d277064e7e16d0 Matthieu CASTET 2008-03-19  160  	 * build the special sense
d277064e7e16d0 Matthieu CASTET 2008-03-19  161  	 */
d277064e7e16d0 Matthieu CASTET 2008-03-19  162  	if ((srb->result != (DID_ERROR << 16) &&
d277064e7e16d0 Matthieu CASTET 2008-03-19  163  				srb->result != (DID_ABORT << 16)) &&
d277064e7e16d0 Matthieu CASTET 2008-03-19  164  			save_cmnd[2] & 0x20) {
d277064e7e16d0 Matthieu CASTET 2008-03-19  165  		struct scsi_eh_save ses;
d277064e7e16d0 Matthieu CASTET 2008-03-19  166  		unsigned char regs[8];
d277064e7e16d0 Matthieu CASTET 2008-03-19  167  		unsigned char *sb = srb->sense_buffer;
d277064e7e16d0 Matthieu CASTET 2008-03-19  168  		unsigned char *desc = sb + 8;
d277064e7e16d0 Matthieu CASTET 2008-03-19  169  		int tmp_result;
d277064e7e16d0 Matthieu CASTET 2008-03-19  170  
f0183a338e4f90 Felipe Balbi    2016-04-18  171  		/* build the command for reading the ATA registers */
1f4159c1620f74 Boaz Harrosh    2009-02-11  172  		scsi_eh_prep_cmnd(srb, &ses, NULL, 0, sizeof(regs));
1f4159c1620f74 Boaz Harrosh    2009-02-11  173  
f0183a338e4f90 Felipe Balbi    2016-04-18  174  		/*
f0183a338e4f90 Felipe Balbi    2016-04-18  175  		 * we use the same command as before, but we set
d277064e7e16d0 Matthieu CASTET 2008-03-19  176  		 * the read taskfile bit, for not executing atacb command,
d277064e7e16d0 Matthieu CASTET 2008-03-19  177  		 * but reading register selected in srb->cmnd[4]
d277064e7e16d0 Matthieu CASTET 2008-03-19  178  		 */
1f4159c1620f74 Boaz Harrosh    2009-02-11  179  		srb->cmd_len = 16;
1f4159c1620f74 Boaz Harrosh    2009-02-11 @180  		srb->cmnd = ses.cmnd;
d277064e7e16d0 Matthieu CASTET 2008-03-19  181  		srb->cmnd[2] = 1;
d277064e7e16d0 Matthieu CASTET 2008-03-19  182  
d277064e7e16d0 Matthieu CASTET 2008-03-19  183  		usb_stor_transparent_scsi_command(srb, us);
1f4159c1620f74 Boaz Harrosh    2009-02-11  184  		memcpy(regs, srb->sense_buffer, sizeof(regs));
d277064e7e16d0 Matthieu CASTET 2008-03-19  185  		tmp_result = srb->result;
d277064e7e16d0 Matthieu CASTET 2008-03-19  186  		scsi_eh_restore_cmnd(srb, &ses);
d277064e7e16d0 Matthieu CASTET 2008-03-19  187  		/* we fail to get registers, report invalid command */
d277064e7e16d0 Matthieu CASTET 2008-03-19  188  		if (tmp_result != SAM_STAT_GOOD)
d277064e7e16d0 Matthieu CASTET 2008-03-19  189  			goto invalid_fld;
d277064e7e16d0 Matthieu CASTET 2008-03-19  190  
d277064e7e16d0 Matthieu CASTET 2008-03-19  191  		/* build the sense */
d277064e7e16d0 Matthieu CASTET 2008-03-19  192  		memset(sb, 0, SCSI_SENSE_BUFFERSIZE);
d277064e7e16d0 Matthieu CASTET 2008-03-19  193  
d277064e7e16d0 Matthieu CASTET 2008-03-19  194  		/* set sk, asc for a good command */
d277064e7e16d0 Matthieu CASTET 2008-03-19  195  		sb[1] = RECOVERED_ERROR;
d277064e7e16d0 Matthieu CASTET 2008-03-19  196  		sb[2] = 0; /* ATA PASS THROUGH INFORMATION AVAILABLE */
d277064e7e16d0 Matthieu CASTET 2008-03-19  197  		sb[3] = 0x1D;
d277064e7e16d0 Matthieu CASTET 2008-03-19  198  
f0183a338e4f90 Felipe Balbi    2016-04-18  199  		/*
f0183a338e4f90 Felipe Balbi    2016-04-18  200  		 * XXX we should generate sk, asc, ascq from status and error
d277064e7e16d0 Matthieu CASTET 2008-03-19  201  		 * regs
1f4159c1620f74 Boaz Harrosh    2009-02-11  202  		 * (see 11.1 Error translation ATA device error to SCSI error
1f4159c1620f74 Boaz Harrosh    2009-02-11  203  		 * map, and ata_to_sense_error from libata.)
d277064e7e16d0 Matthieu CASTET 2008-03-19  204  		 */
d277064e7e16d0 Matthieu CASTET 2008-03-19  205  
d277064e7e16d0 Matthieu CASTET 2008-03-19  206  		/* Sense data is current and format is descriptor. */
d277064e7e16d0 Matthieu CASTET 2008-03-19  207  		sb[0] = 0x72;
d277064e7e16d0 Matthieu CASTET 2008-03-19  208  		desc[0] = 0x09; /* ATA_RETURN_DESCRIPTOR */
d277064e7e16d0 Matthieu CASTET 2008-03-19  209  
d277064e7e16d0 Matthieu CASTET 2008-03-19  210  		/* set length of additional sense data */
d277064e7e16d0 Matthieu CASTET 2008-03-19  211  		sb[7] = 14;
d277064e7e16d0 Matthieu CASTET 2008-03-19  212  		desc[1] = 12;
d277064e7e16d0 Matthieu CASTET 2008-03-19  213  
d277064e7e16d0 Matthieu CASTET 2008-03-19  214  		/* Copy registers into sense buffer. */
d277064e7e16d0 Matthieu CASTET 2008-03-19  215  		desc[ 2] = 0x00;
d277064e7e16d0 Matthieu CASTET 2008-03-19  216  		desc[ 3] = regs[1];  /* features */
d277064e7e16d0 Matthieu CASTET 2008-03-19  217  		desc[ 5] = regs[2];  /* sector count */
d277064e7e16d0 Matthieu CASTET 2008-03-19  218  		desc[ 7] = regs[3];  /* lba low */
d277064e7e16d0 Matthieu CASTET 2008-03-19  219  		desc[ 9] = regs[4];  /* lba med */
d277064e7e16d0 Matthieu CASTET 2008-03-19  220  		desc[11] = regs[5];  /* lba high */
d277064e7e16d0 Matthieu CASTET 2008-03-19  221  		desc[12] = regs[6];  /* device */
d277064e7e16d0 Matthieu CASTET 2008-03-19  222  		desc[13] = regs[7];  /* command */
d277064e7e16d0 Matthieu CASTET 2008-03-19  223  
464a00c9e0ad45 Hannes Reinecke 2021-04-27  224  		srb->result = SAM_STAT_CHECK_CONDITION;
d277064e7e16d0 Matthieu CASTET 2008-03-19  225  	}
d277064e7e16d0 Matthieu CASTET 2008-03-19  226  	goto end;
d277064e7e16d0 Matthieu CASTET 2008-03-19  227  invalid_fld:
464a00c9e0ad45 Hannes Reinecke 2021-04-27  228  	srb->result = SAM_STAT_CHECK_CONDITION;
d277064e7e16d0 Matthieu CASTET 2008-03-19  229  
d277064e7e16d0 Matthieu CASTET 2008-03-19  230  	memcpy(srb->sense_buffer,
d277064e7e16d0 Matthieu CASTET 2008-03-19  231  			usb_stor_sense_invalidCDB,
d277064e7e16d0 Matthieu CASTET 2008-03-19  232  			sizeof(usb_stor_sense_invalidCDB));
d277064e7e16d0 Matthieu CASTET 2008-03-19  233  end:
d277064e7e16d0 Matthieu CASTET 2008-03-19  234  	memcpy(srb->cmnd, save_cmnd, sizeof(save_cmnd));
d277064e7e16d0 Matthieu CASTET 2008-03-19  235  	if (srb->cmnd[0] == ATA_12)
d277064e7e16d0 Matthieu CASTET 2008-03-19  236  		srb->cmd_len = 12;
d277064e7e16d0 Matthieu CASTET 2008-03-19  237  }
fcdb51401f7f69 Alan Stern      2009-02-12  238  

:::::: The code at line 180 was first introduced by commit
:::::: 1f4159c1620f74377e26d8a569d10ca5907ef475 USB: fix USB_STORAGE_CYPRESS_ATACB

:::::: TO: Boaz Harrosh <bharrosh@panasas.com>
:::::: CC: Greg Kroah-Hartman <gregkh@suse.de>

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

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

only message in thread, other threads:[~2022-02-10 11:13 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-10 11:13 [hch-misc:remove-scsi_request 3/3] drivers/usb/storage/cypress_atacb.c:180:27: error: assignment to expression with array type 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.