tree:
https://github.com/bvanassche/linux scsi-status
head: e3e8aaedcd689d1a2ae20024ed467d127bbe060a
commit: 87559dd4d6d375d2a9ac620763b0643fa80bd002 [14/15] Introduce struct scsi_status
config: mips-randconfig-r016-20210409 (attached as .config)
compiler: clang version 13.0.0 (
https://github.com/llvm/llvm-project
dd453a1389b6a7e6d9214b449d3c54981b1a89b6)
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 mips cross compiling tool for clang build
# apt-get install binutils-mips-linux-gnu
#
https://github.com/bvanassche/linux/commit/87559dd4d6d375d2a9ac620763b064...
git remote add bvanassche
https://github.com/bvanassche/linux
git fetch --no-tags bvanassche scsi-status
git checkout 87559dd4d6d375d2a9ac620763b0643fa80bd002
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
> drivers/ide/ide-ioctls.c:141:30: error: used type 'struct
scsi_status' where arithmetic or pointer type is required
err
= scsi_req(rq)->result ? -EIO : 0;
~~~~~~~~~~~~~~~~~~~~ ^
> drivers/ide/ide-ioctls.c:239:6: error: assigning to 'int'
from incompatible type 'struct scsi_status'
ret =
scsi_req(rq)->result;
^ ~~~~~~~~~~~~~~~~~~~~
2 errors generated.
--
> drivers/ide/ide-io.c:154:24: error: assigning to 'struct
scsi_status' from incompatible type 'int'
scsi_req(rq)->result = 0;
^ ~
drivers/ide/ide-io.c:157:25: error: assigning to 'struct scsi_status' from
incompatible type 'int'
scsi_req(rq)->result = IDE_DRV_ERROR_GENERAL;
^ ~~~~~~~~~~~~~~~~~~~~~
> drivers/ide/ide-io.c:158:62: error: invalid operands to binary
expression ('struct scsi_status' and 'int')
else
if (blk_rq_is_passthrough(rq) && scsi_req(rq)->result == 0)
~~~~~~~~~~~~~~~~~~~~ ^ ~
drivers/ide/ide-io.c:159:25: error: assigning to 'struct scsi_status' from
incompatible type 'int'
scsi_req(rq)->result = -EIO;
^ ~~~~
drivers/ide/ide-io.c:287:23: error: assigning to 'struct scsi_status' from
incompatible type 'int'
scsi_req(rq)->result = 0;
^ ~
5 errors generated.
--
> drivers/ide/ide-taskfile.c:282:29: error: assigning to
'struct scsi_status' from incompatible type 'int'
scsi_req(cmd->rq)->result = 0;
^ ~
> drivers/ide/ide-taskfile.c:324:23: error: assigning to
'struct scsi_status' from incompatible type 'u8' (aka 'unsigned
char')
scsi_req(rq)->result = err;
^ ~~~
> drivers/ide/ide-taskfile.c:447:31: error: used type 'struct
scsi_status' where arithmetic or pointer type is required
error =
scsi_req(rq)->result ? -EIO : 0;
~~~~~~~~~~~~~~~~~~~~ ^
3 errors generated.
--
> drivers/ide/ide-pm.c:31:29: error: used type 'struct
scsi_status' where arithmetic or pointer type is required
ret =
scsi_req(rq)->result ? -EIO : 0;
~~~~~~~~~~~~~~~~~~~~ ^
> drivers/ide/ide-pm.c:49:24: error: assigning to 'struct
scsi_status' from incompatible type 'int'
scsi_req(rq)->result = -ENXIO;
^ ~~~~~~
drivers/ide/ide-pm.c:55:30: error: used type 'struct scsi_status' where
arithmetic or pointer type is required
return scsi_req(rq)->result ? -EIO : 0;
~~~~~~~~~~~~~~~~~~~~ ^
3 errors generated.
--
> drivers/ide/ide-park.c:41:28: error: used type 'struct
scsi_status' where arithmetic or pointer type is required
rc =
scsi_req(rq)->result ? -EIO : 0;
~~~~~~~~~~~~~~~~~~~~ ^
1 error generated.
--
> drivers/ide/ide-devsets.c:177:6: error: assigning to
'int' from incompatible type 'struct scsi_status'
ret =
scsi_req(rq)->result;
^ ~~~~~~~~~~~~~~~~~~~~
> drivers/ide/ide-devsets.c:189:24: error: assigning to 'struct
scsi_status' from incompatible type 'int'
scsi_req(rq)->result = err;
^ ~~~
2 errors generated.
--
> drivers/ide/ide-eh.c:16:24: error: invalid operands to binary
expression ('struct scsi_status' and 'int')
scsi_req(rq)->result |= ERROR_RESET;
~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
> drivers/ide/ide-eh.c:29:25: error: assigning to 'struct
scsi_status' from incompatible type 'int'
scsi_req(rq)->result = ERROR_MAX;
^ ~~~~~~~~~
drivers/ide/ide-eh.c:32:25: error: invalid operands to binary expression ('struct
scsi_status' and 'int')
scsi_req(rq)->result |= ERROR_RECAL;
~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
drivers/ide/ide-eh.c:43:27: error: invalid operands to binary expression ('struct
scsi_status' and 'int')
if (scsi_req(rq)->result >= ERROR_MAX || blk_noretry_request(rq)) {
~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~
drivers/ide/ide-eh.c:49:24: error: invalid operands to binary expression ('struct
scsi_status' and 'int')
scsi_req(rq)->result |= ERROR_RESET;
~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
drivers/ide/ide-eh.c:51:28: error: invalid operands to binary expression ('struct
scsi_status' and 'int')
if ((scsi_req(rq)->result & ERROR_RESET) == ERROR_RESET) {
~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
> drivers/ide/ide-eh.c:52:3: error: cannot increment value of type
'struct scsi_status'
++scsi_req(rq)->result;
^ ~~~~~~~~~~~~~~~~~~~~
drivers/ide/ide-eh.c:56:28: error: invalid operands to binary expression ('struct
scsi_status' and 'int')
if ((scsi_req(rq)->result & ERROR_RECAL) == ERROR_RECAL)
~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
drivers/ide/ide-eh.c:59:2: error: cannot increment value of type 'struct
scsi_status'
++scsi_req(rq)->result;
^ ~~~~~~~~~~~~~~~~~~~~
drivers/ide/ide-eh.c:72:24: error: invalid operands to binary expression ('struct
scsi_status' and 'int')
scsi_req(rq)->result |= ERROR_RESET;
~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
drivers/ide/ide-eh.c:81:27: error: invalid operands to binary expression ('struct
scsi_status' and 'int')
if (scsi_req(rq)->result >= ERROR_MAX) {
~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~
drivers/ide/ide-eh.c:84:29: error: invalid operands to binary expression ('struct
scsi_status' and 'int')
if ((scsi_req(rq)->result & ERROR_RESET) == ERROR_RESET) {
~~~~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~
drivers/ide/ide-eh.c:85:4: error: cannot increment value of type 'struct
scsi_status'
++scsi_req(rq)->result;
^ ~~~~~~~~~~~~~~~~~~~~
drivers/ide/ide-eh.c:88:3: error: cannot increment value of type 'struct
scsi_status'
++scsi_req(rq)->result;
^ ~~~~~~~~~~~~~~~~~~~~
drivers/ide/ide-eh.c:134:25: error: assigning to 'struct scsi_status' from
incompatible type 'int'
scsi_req(rq)->result = 1;
^ ~
> drivers/ide/ide-eh.c:138:24: error: assigning to 'struct
scsi_status' from incompatible type 'u8' (aka 'unsigned char')
scsi_req(rq)->result = err;
^ ~~~
drivers/ide/ide-eh.c:153:40: error: invalid operands to binary expression ('struct
scsi_status' and 'int')
if (err <= 0 && scsi_req(rq)->result == 0)
~~~~~~~~~~~~~~~~~~~~ ^ ~
drivers/ide/ide-eh.c:154:25: error: assigning to 'struct scsi_status' from
incompatible type 'int'
scsi_req(rq)->result = -EIO;
^ ~~~~
18 errors generated.
vim +141 drivers/ide/ide-ioctls.c
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 126
1df23c6fe5b065 Arnd Bergmann 2019-11-28 127 static int
ide_cmd_ioctl(ide_drive_t *drive, void __user *argp)
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 128 {
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 129 u8 *buf = NULL;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 130 int bufsize = 0, err = 0;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 131 u8 args[4], xfer_rate = 0;
22aa4b32a19b1f Bartlomiej Zolnierkiewicz 2009-03-27 132 struct ide_cmd cmd;
22aa4b32a19b1f Bartlomiej Zolnierkiewicz 2009-03-27 133 struct ide_taskfile *tf =
&cmd.tf;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 134
1df23c6fe5b065 Arnd Bergmann 2019-11-28 135 if (NULL == argp) {
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 136 struct request *rq;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 137
ff005a066240ef Christoph Hellwig 2018-05-09 138 rq =
blk_get_request(drive->queue, REQ_OP_DRV_IN, 0);
2f5a8e80f79dc8 Christoph Hellwig 2017-01-31 139 ide_req(rq)->type =
ATA_PRIV_TASKFILE;
684da7628d93bb Guoqing Jiang 2021-01-25 140 blk_execute_rq(NULL, rq, 0);
17d5363b83f8c7 Christoph Hellwig 2017-04-20 @141 err = scsi_req(rq)->result
? -EIO : 0;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 142 blk_put_request(rq);
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 143
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 144 return err;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 145 }
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 146
1df23c6fe5b065 Arnd Bergmann 2019-11-28 147 if (copy_from_user(args, argp,
4))
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 148 return -EFAULT;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 149
22aa4b32a19b1f Bartlomiej Zolnierkiewicz 2009-03-27 150 memset(&cmd, 0,
sizeof(cmd));
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 151 tf->feature = args[2];
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 152 if (args[0] == ATA_CMD_SMART)
{
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 153 tf->nsect = args[3];
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 154 tf->lbal = args[1];
6fcf0497ffcc18 Xinghai Yu 2013-07-25 155 tf->lbam =
ATA_SMART_LBAM_PASS;
6fcf0497ffcc18 Xinghai Yu 2013-07-25 156 tf->lbah =
ATA_SMART_LBAH_PASS;
60f85019c6c8c1 Sergei Shtylyov 2009-04-08 157 cmd.valid.out.tf =
IDE_VALID_OUT_TF;
60f85019c6c8c1 Sergei Shtylyov 2009-04-08 158 cmd.valid.in.tf =
IDE_VALID_NSECT;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 159 } else {
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 160 tf->nsect = args[1];
60f85019c6c8c1 Sergei Shtylyov 2009-04-08 161 cmd.valid.out.tf =
IDE_VALID_FEATURE | IDE_VALID_NSECT;
60f85019c6c8c1 Sergei Shtylyov 2009-04-08 162 cmd.valid.in.tf =
IDE_VALID_NSECT;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 163 }
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 164 tf->command = args[0];
0dfb991c6943c8 Bartlomiej Zolnierkiewicz 2009-03-27 165 cmd.protocol = args[3] ?
ATA_PROT_PIO : ATA_PROT_NODATA;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 166
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 167 if (args[3]) {
22aa4b32a19b1f Bartlomiej Zolnierkiewicz 2009-03-27 168 cmd.tf_flags |=
IDE_TFLAG_IO_16BIT;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 169 bufsize = SECTOR_SIZE *
args[3];
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 170 buf = kzalloc(bufsize,
GFP_KERNEL);
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 171 if (buf == NULL)
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 172 return -ENOMEM;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 173 }
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 174
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 175 if (tf->command ==
ATA_CMD_SET_FEATURES &&
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 176 tf->feature ==
SETFEATURES_XFER &&
a9c415090710a1 Bartlomiej Zolnierkiewicz 2009-06-15 177 tf->nsect >=
XFER_SW_DMA_0) {
28c1969ff887bc Hemant Pedanekar 2009-11-25 178 xfer_rate =
ide_find_dma_mode(drive, tf->nsect);
a9c415090710a1 Bartlomiej Zolnierkiewicz 2009-06-15 179 if (xfer_rate != tf->nsect)
{
a9c415090710a1 Bartlomiej Zolnierkiewicz 2009-06-15 180 err = -EINVAL;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 181 goto abort;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 182 }
665d66e8fad60a Bartlomiej Zolnierkiewicz 2009-06-23 183
665d66e8fad60a Bartlomiej Zolnierkiewicz 2009-06-23 184 cmd.tf_flags |=
IDE_TFLAG_SET_XFER;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 185 }
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 186
22aa4b32a19b1f Bartlomiej Zolnierkiewicz 2009-03-27 187 err = ide_raw_taskfile(drive,
&cmd, buf, args[3]);
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 188
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 189 args[0] = tf->status;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 190 args[1] = tf->error;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 191 args[2] = tf->nsect;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 192 abort:
1df23c6fe5b065 Arnd Bergmann 2019-11-28 193 if (copy_to_user(argp,
&args, 4))
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 194 err = -EFAULT;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 195 if (buf) {
1df23c6fe5b065 Arnd Bergmann 2019-11-28 196 if (copy_to_user((argp + 4),
buf, bufsize))
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 197 err = -EFAULT;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 198 kfree(buf);
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 199 }
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 200 return err;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 201 }
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 202
1df23c6fe5b065 Arnd Bergmann 2019-11-28 203 static int
ide_task_ioctl(ide_drive_t *drive, void __user *p)
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 204 {
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 205 int err = 0;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 206 u8 args[7];
22aa4b32a19b1f Bartlomiej Zolnierkiewicz 2009-03-27 207 struct ide_cmd cmd;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 208
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 209 if (copy_from_user(args, p,
7))
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 210 return -EFAULT;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 211
22aa4b32a19b1f Bartlomiej Zolnierkiewicz 2009-03-27 212 memset(&cmd, 0,
sizeof(cmd));
745483f10c6cef Sergei Shtylyov 2009-04-08 213 memcpy(&cmd.tf.feature,
&args[1], 6);
22aa4b32a19b1f Bartlomiej Zolnierkiewicz 2009-03-27 214 cmd.tf.command = args[0];
60f85019c6c8c1 Sergei Shtylyov 2009-04-08 215 cmd.valid.out.tf =
IDE_VALID_OUT_TF | IDE_VALID_DEVICE;
60f85019c6c8c1 Sergei Shtylyov 2009-04-08 216 cmd.valid.in.tf =
IDE_VALID_IN_TF | IDE_VALID_DEVICE;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 217
22aa4b32a19b1f Bartlomiej Zolnierkiewicz 2009-03-27 218 err =
ide_no_data_taskfile(drive, &cmd);
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 219
22aa4b32a19b1f Bartlomiej Zolnierkiewicz 2009-03-27 220 args[0] = cmd.tf.command;
745483f10c6cef Sergei Shtylyov 2009-04-08 221 memcpy(&args[1],
&cmd.tf.feature, 6);
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 222
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 223 if (copy_to_user(p, args, 7))
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 224 err = -EFAULT;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 225
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 226 return err;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 227 }
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 228
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 229 static int
generic_drive_reset(ide_drive_t *drive)
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 230 {
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 231 struct request *rq;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 232 int ret = 0;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 233
ff005a066240ef Christoph Hellwig 2018-05-09 234 rq =
blk_get_request(drive->queue, REQ_OP_DRV_IN, 0);
2f5a8e80f79dc8 Christoph Hellwig 2017-01-31 235 ide_req(rq)->type =
ATA_PRIV_MISC;
82ed4db499b859 Christoph Hellwig 2017-01-27 236 scsi_req(rq)->cmd_len = 1;
82ed4db499b859 Christoph Hellwig 2017-01-27 237 scsi_req(rq)->cmd[0] =
REQ_DRIVE_RESET;
684da7628d93bb Guoqing Jiang 2021-01-25 238 blk_execute_rq(NULL, rq, 1);
17d5363b83f8c7 Christoph Hellwig 2017-04-20 @239 ret = scsi_req(rq)->result;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 240 blk_put_request(rq);
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 241 return ret;
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 242 }
05236ea6df7419 Bartlomiej Zolnierkiewicz 2008-10-10 243
:::::: The code at line 141 was first introduced by commit
:::::: 17d5363b83f8c73ef9109f75a4a9b578f31d842f scsi: introduce a result field in struct
scsi_request
:::::: TO: Christoph Hellwig <hch(a)lst.de>
:::::: CC: Jens Axboe <axboe(a)fb.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org