Clang warns several times in the scsi subsystem (trimmed for brevity): drivers/scsi/hpsa.c:6209:7: warning: overflow converting case value to switch condition type (2147762695 to 18446744071562347015) [-Wswitch] case CCISS_GETBUSTYPES: ^ drivers/scsi/hpsa.c:6208:7: warning: overflow converting case value to switch condition type (2147762694 to 18446744071562347014) [-Wswitch] case CCISS_GETHEARTBEAT: ^ The root cause is that the _IOC macro can generate really large numbers, which don't fit into type 'int', which is used for the cmd parameter in the ioctls in scsi_host_template. My research into how GCC and Clang are handling this at a low level didn't prove fruitful. However, looking at the rest of the kernel tree, all ioctls use an 'unsigned int' for the cmd parameter, which will fit all of the _IOC values in the scsi/ata subsystems. Make that change because none of the ioctls expect a negative value for any command, it brings the ioctls inline with the reset of the kernel, and it removes ambiguity, which is never good when dealing with compilers.
Unified · Split
| @@ -778,7 +778,7 @@ static int ata_ioc32(struct ata_port *ap) · 777 unmodified lines | |||
| 778 | } | 778 | } |
| 779 | 779 | ||
| 780 | int ata_sas_scsi_ioctl(struct ata_port *ap, struct scsi_device *scsidev, | 780 | int ata_sas_scsi_ioctl(struct ata_port *ap, struct scsi_device *scsidev, |
| 781 | int cmd, void __user *arg) | 781 | unsigned int cmd, void __user *arg) |
| 782 | { | 782 | { |
| 783 | unsigned long val; | 783 | unsigned long val; |
| 784 | int rc = -EINVAL; | 784 | int rc = -EINVAL; |
| @@ -829,7 +829,8 @@ int ata_sas_scsi_ioctl(struct ata_port *ap, struct scsi_device *scsidev, · 44 unmodified lines | |||
| 829 | } | 829 | } |
| 830 | EXPORT_SYMBOL_GPL(ata_sas_scsi_ioctl); | 830 | EXPORT_SYMBOL_GPL(ata_sas_scsi_ioctl); |
| 831 | 831 | ||
| 832 | int ata_scsi_ioctl(struct scsi_device *scsidev, int cmd, void __user *arg) | 832 | int ata_scsi_ioctl(struct scsi_device *scsidev, unsigned int cmd, |
| 833 | void __user *arg) | ||
| 833 | { | 834 | { |
| 834 | return ata_sas_scsi_ioctl(ata_shost_to_port(scsidev->host), | 835 | return ata_sas_scsi_ioctl(ata_shost_to_port(scsidev->host), |
| 835 | scsidev, cmd, arg); | 836 | scsidev, cmd, arg); |
| @@ -3455,7 +3455,7 @@ static int delete_disk(struct aac_dev *dev, void __user *arg) · 3454 unmodified lines | |||
| 3455 | } | 3455 | } |
| 3456 | } | 3456 | } |
| 3457 | 3457 | ||
| 3458 | int aac_dev_ioctl(struct aac_dev *dev, int cmd, void __user *arg) | 3458 | int aac_dev_ioctl(struct aac_dev *dev, unsigned int cmd, void __user *arg) |
| 3459 | { | 3459 | { |
| 3460 | switch (cmd) { | 3460 | switch (cmd) { |
| 3461 | case FSACTL_QUERY_DISK: | 3461 | case FSACTL_QUERY_DISK: |
| @@ -2706,12 +2706,12 @@ void aac_set_intx_mode(struct aac_dev *dev); · 2705 unmodified lines | |||
| 2706 | int aac_get_config_status(struct aac_dev *dev, int commit_flag); | 2706 | int aac_get_config_status(struct aac_dev *dev, int commit_flag); |
| 2707 | int aac_get_containers(struct aac_dev *dev); | 2707 | int aac_get_containers(struct aac_dev *dev); |
| 2708 | int aac_scsi_cmd(struct scsi_cmnd *cmd); | 2708 | int aac_scsi_cmd(struct scsi_cmnd *cmd); |
| 2709 | int aac_dev_ioctl(struct aac_dev *dev, int cmd, void __user *arg); | 2709 | int aac_dev_ioctl(struct aac_dev *dev, unsigned int cmd, void __user *arg); |
| 2710 | #ifndef shost_to_class | 2710 | #ifndef shost_to_class |
| 2711 | #define shost_to_class(shost) &shost->shost_dev | 2711 | #define shost_to_class(shost) &shost->shost_dev |
| 2712 | #endif | 2712 | #endif |
| 2713 | ssize_t aac_get_serial_number(struct device *dev, char *buf); | 2713 | ssize_t aac_get_serial_number(struct device *dev, char *buf); |
| 2714 | int aac_do_ioctl(struct aac_dev * dev, int cmd, void __user *arg); | 2714 | int aac_do_ioctl(struct aac_dev *dev, unsigned int cmd, void __user *arg); |
| 2715 | int aac_rx_init(struct aac_dev *dev); | 2715 | int aac_rx_init(struct aac_dev *dev); |
| 2716 | int aac_rkt_init(struct aac_dev *dev); | 2716 | int aac_rkt_init(struct aac_dev *dev); |
| 2717 | int aac_nark_init(struct aac_dev *dev); | 2717 | int aac_nark_init(struct aac_dev *dev); |
| @@ -1060,7 +1060,7 @@ static int aac_send_reset_adapter(struct aac_dev *dev, void __user *arg) · 1059 unmodified lines | |||
| 1060 | return retval; | 1060 | return retval; |
| 1061 | } | 1061 | } |
| 1062 | 1062 | ||
| 1063 | int aac_do_ioctl(struct aac_dev * dev, int cmd, void __user *arg) | 1063 | int aac_do_ioctl(struct aac_dev *dev, unsigned int cmd, void __user *arg) |
| 1064 | { | 1064 | { |
| 1065 | int status; | 1065 | int status; |
| 1066 | 1066 | ||
| @@ -616,7 +616,8 @@ static struct device_attribute *aac_dev_attrs[] = { · 615 unmodified lines | |||
| 616 | NULL, | 616 | NULL, |
| 617 | }; | 617 | }; |
| 618 | 618 | ||
| 619 | static int aac_ioctl(struct scsi_device *sdev, int cmd, void __user * arg) | 619 | static int aac_ioctl(struct scsi_device *sdev, unsigned int cmd, |
| 620 | void __user *arg) | ||
| 620 | { | 621 | { |
| 621 | struct aac_dev *dev = (struct aac_dev *)sdev->host->hostdata; | 622 | struct aac_dev *dev = (struct aac_dev *)sdev->host->hostdata; |
| 622 | if (!capable(CAP_SYS_RAWIO)) | 623 | if (!capable(CAP_SYS_RAWIO)) |
| @@ -1205,7 +1206,8 @@ static long aac_compat_do_ioctl(struct aac_dev *dev, unsigned cmd, unsigned long · 582 unmodified lines | |||
| 1205 | return ret; | 1206 | return ret; |
| 1206 | } | 1207 | } |
| 1207 | 1208 | ||
| 1208 | static int aac_compat_ioctl(struct scsi_device *sdev, int cmd, void __user *arg) | 1209 | static int aac_compat_ioctl(struct scsi_device *sdev, unsigned int cmd, |
| 1210 | void __user *arg) | ||
| 1209 | { | 1211 | { |
| 1210 | struct aac_dev *dev = (struct aac_dev *)sdev->host->hostdata; | 1212 | struct aac_dev *dev = (struct aac_dev *)sdev->host->hostdata; |
| 1211 | if (!capable(CAP_SYS_RAWIO)) | 1213 | if (!capable(CAP_SYS_RAWIO)) |
| @@ -334,7 +334,8 @@ int cxlflash_afu_sync(struct afu *afu, ctx_hndl_t c, res_hndl_t r, u8 mode); · 333 unmodified lines | |||
| 334 | void cxlflash_list_init(void); | 334 | void cxlflash_list_init(void); |
| 335 | void cxlflash_term_global_luns(void); | 335 | void cxlflash_term_global_luns(void); |
| 336 | void cxlflash_free_errpage(void); | 336 | void cxlflash_free_errpage(void); |
| 337 | int cxlflash_ioctl(struct scsi_device *sdev, int cmd, void __user *arg); | 337 | int cxlflash_ioctl(struct scsi_device *sdev, unsigned int cmd, |
| 338 | void __user *arg); | ||
| 338 | void cxlflash_stop_term_user_contexts(struct cxlflash_cfg *cfg); | 339 | void cxlflash_stop_term_user_contexts(struct cxlflash_cfg *cfg); |
| 339 | int cxlflash_mark_contexts_error(struct cxlflash_cfg *cfg); | 340 | int cxlflash_mark_contexts_error(struct cxlflash_cfg *cfg); |
| 340 | void cxlflash_term_local_luns(struct cxlflash_cfg *cfg); | 341 | void cxlflash_term_local_luns(struct cxlflash_cfg *cfg); |
| @@ -3282,7 +3282,7 @@ static int cxlflash_chr_open(struct inode *inode, struct file *file) · 3281 unmodified lines | |||
| 3282 | * | 3282 | * |
| 3283 | * Return: A string identifying the decoded host ioctl. | 3283 | * Return: A string identifying the decoded host ioctl. |
| 3284 | */ | 3284 | */ |
| 3285 | static char *decode_hioctl(int cmd) | 3285 | static char *decode_hioctl(unsigned int cmd) |
| 3286 | { | 3286 | { |
| 3287 | switch (cmd) { | 3287 | switch (cmd) { |
| 3288 | case HT_CXLFLASH_LUN_PROVISION: | 3288 | case HT_CXLFLASH_LUN_PROVISION: |
| @@ -1924,7 +1924,7 @@ out: · 1923 unmodified lines | |||
| 1924 | * | 1924 | * |
| 1925 | * Return: A string identifying the decoded ioctl. | 1925 | * Return: A string identifying the decoded ioctl. |
| 1926 | */ | 1926 | */ |
| 1927 | static char *decode_ioctl(int cmd) | 1927 | static char *decode_ioctl(unsigned int cmd) |
| 1928 | { | 1928 | { |
| 1929 | switch (cmd) { | 1929 | switch (cmd) { |
| 1930 | case DK_CXLFLASH_ATTACH: | 1930 | case DK_CXLFLASH_ATTACH: |
| @@ -2051,7 +2051,7 @@ err1: · 120 unmodified lines | |||
| 2051 | * | 2051 | * |
| 2052 | * Return: 0 on success, -errno on failure | 2052 | * Return: 0 on success, -errno on failure |
| 2053 | */ | 2053 | */ |
| 2054 | static int ioctl_common(struct scsi_device *sdev, int cmd) | 2054 | static int ioctl_common(struct scsi_device *sdev, unsigned int cmd) |
| 2055 | { | 2055 | { |
| 2056 | struct cxlflash_cfg *cfg = shost_priv(sdev->host); | 2056 | struct cxlflash_cfg *cfg = shost_priv(sdev->host); |
| 2057 | struct device *dev = &cfg->dev->dev; | 2057 | struct device *dev = &cfg->dev->dev; |
| @@ -2096,7 +2096,7 @@ out: · 38 unmodified lines | |||
| 2096 | * | 2096 | * |
| 2097 | * Return: 0 on success, -errno on failure | 2097 | * Return: 0 on success, -errno on failure |
| 2098 | */ | 2098 | */ |
| 2099 | int cxlflash_ioctl(struct scsi_device *sdev, int cmd, void __user *arg) | 2099 | int cxlflash_ioctl(struct scsi_device *sdev, unsigned int cmd, void __user *arg) |
| 2100 | { | 2100 | { |
| 2101 | typedef int (*sioctl) (struct scsi_device *, void *); | 2101 | typedef int (*sioctl) (struct scsi_device *, void *); |
| 2102 | 2102 | ||
| @@ -2179,8 +2179,7 @@ int cxlflash_ioctl(struct scsi_device *sdev, int cmd, void __user *arg) · 76 unmodified lines | |||
| 2179 | } | 2179 | } |
| 2180 | 2180 | ||
| 2181 | if (unlikely(copy_from_user(&buf, arg, size))) { | 2181 | if (unlikely(copy_from_user(&buf, arg, size))) { |
| 2182 | dev_err(dev, "%s: copy_from_user() fail " | 2182 | dev_err(dev, "%s: copy_from_user() fail size=%lu cmd=%u (%s) arg=%p\n", |
| 2183 | "size=%lu cmd=%d (%s) arg=%p\n", | ||
| 2184 | __func__, size, cmd, decode_ioctl(cmd), arg); | 2183 | __func__, size, cmd, decode_ioctl(cmd), arg); |
| 2185 | rc = -EFAULT; | 2184 | rc = -EFAULT; |
| 2186 | goto cxlflash_ioctl_exit; | 2185 | goto cxlflash_ioctl_exit; |
| @@ -2203,8 +2202,7 @@ int cxlflash_ioctl(struct scsi_device *sdev, int cmd, void __user *arg) · 16 unmodified lines | |||
| 2203 | rc = do_ioctl(sdev, (void *)&buf); | 2202 | rc = do_ioctl(sdev, (void *)&buf); |
| 2204 | if (likely(!rc)) | 2203 | if (likely(!rc)) |
| 2205 | if (unlikely(copy_to_user(arg, &buf, size))) { | 2204 | if (unlikely(copy_to_user(arg, &buf, size))) { |
| 2206 | dev_err(dev, "%s: copy_to_user() fail " | 2205 | dev_err(dev, "%s: copy_to_user() fail size=%lu cmd=%u (%s) arg=%p\n", |
| 2207 | "size=%lu cmd=%d (%s) arg=%p\n", | ||
| 2208 | __func__, size, cmd, decode_ioctl(cmd), arg); | 2206 | __func__, size, cmd, decode_ioctl(cmd), arg); |
| 2209 | rc = -EFAULT; | 2207 | rc = -EFAULT; |
| 2210 | } | 2208 | } |
| @@ -965,8 +965,8 @@ struct esas2r_adapter { · 964 unmodified lines | |||
| 965 | const char *esas2r_info(struct Scsi_Host *); | 965 | const char *esas2r_info(struct Scsi_Host *); |
| 966 | int esas2r_write_params(struct esas2r_adapter *a, struct esas2r_request *rq, | 966 | int esas2r_write_params(struct esas2r_adapter *a, struct esas2r_request *rq, |
| 967 | struct esas2r_sas_nvram *data); | 967 | struct esas2r_sas_nvram *data); |
| 968 | int esas2r_ioctl_handler(void *hostdata, int cmd, void __user *arg); | 968 | int esas2r_ioctl_handler(void *hostdata, unsigned int cmd, void __user *arg); |
| 969 | int esas2r_ioctl(struct scsi_device *dev, int cmd, void __user *arg); | 969 | int esas2r_ioctl(struct scsi_device *dev, unsigned int cmd, void __user *arg); |
| 970 | u8 handle_hba_ioctl(struct esas2r_adapter *a, | 970 | u8 handle_hba_ioctl(struct esas2r_adapter *a, |
| 971 | struct atto_ioctl *ioctl_hba); | 971 | struct atto_ioctl *ioctl_hba); |
| 972 | int esas2r_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd); | 972 | int esas2r_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd); |
| @@ -1274,7 +1274,7 @@ int esas2r_write_params(struct esas2r_adapter *a, struct esas2r_request *rq, · 1273 unmodified lines | |||
| 1274 | 1274 | ||
| 1275 | 1275 | ||
| 1276 | /* This function only cares about ATTO-specific ioctls (atto_express_ioctl) */ | 1276 | /* This function only cares about ATTO-specific ioctls (atto_express_ioctl) */ |
| 1277 | int esas2r_ioctl_handler(void *hostdata, int cmd, void __user *arg) | 1277 | int esas2r_ioctl_handler(void *hostdata, unsigned int cmd, void __user *arg) |
| 1278 | { | 1278 | { |
| 1279 | struct atto_express_ioctl *ioctl = NULL; | 1279 | struct atto_express_ioctl *ioctl = NULL; |
| 1280 | struct esas2r_adapter *a; | 1280 | struct esas2r_adapter *a; |
| @@ -1292,9 +1292,8 @@ int esas2r_ioctl_handler(void *hostdata, int cmd, void __user *arg) · 11 unmodified lines | |||
| 1292 | ioctl = memdup_user(arg, sizeof(struct atto_express_ioctl)); | 1292 | ioctl = memdup_user(arg, sizeof(struct atto_express_ioctl)); |
| 1293 | if (IS_ERR(ioctl)) { | 1293 | if (IS_ERR(ioctl)) { |
| 1294 | esas2r_log(ESAS2R_LOG_WARN, | 1294 | esas2r_log(ESAS2R_LOG_WARN, |
| 1295 | "ioctl_handler access_ok failed for cmd %d, " | 1295 | "ioctl_handler access_ok failed for cmd %u, address %p", |
| 1296 | "address %p", cmd, | 1296 | cmd, arg); |
| 1297 | arg); | ||
| 1298 | return PTR_ERR(ioctl); | 1297 | return PTR_ERR(ioctl); |
| 1299 | } | 1298 | } |
| 1300 | 1299 | ||
| @@ -1493,7 +1492,7 @@ int esas2r_ioctl_handler(void *hostdata, int cmd, void __user *arg) · 192 unmodified lines | |||
| 1493 | ioctl_done: | 1492 | ioctl_done: |
| 1494 | 1493 | ||
| 1495 | if (err < 0) { | 1494 | if (err < 0) { |
| 1496 | esas2r_log(ESAS2R_LOG_WARN, "err %d on ioctl cmd %d", err, | 1495 | esas2r_log(ESAS2R_LOG_WARN, "err %d on ioctl cmd %u", err, |
| 1497 | cmd); | 1496 | cmd); |
| 1498 | 1497 | ||
| 1499 | switch (err) { | 1498 | switch (err) { |
| @@ -1518,9 +1517,8 @@ ioctl_done: · 18 unmodified lines | |||
| 1518 | err = __copy_to_user(arg, ioctl, sizeof(struct atto_express_ioctl)); | 1517 | err = __copy_to_user(arg, ioctl, sizeof(struct atto_express_ioctl)); |
| 1519 | if (err != 0) { | 1518 | if (err != 0) { |
| 1520 | esas2r_log(ESAS2R_LOG_WARN, | 1519 | esas2r_log(ESAS2R_LOG_WARN, |
| 1521 | "ioctl_handler copy_to_user didn't copy " | 1520 | "ioctl_handler copy_to_user didn't copy everything (err %d, cmd %u)", |
| 1522 | "everything (err %d, cmd %d)", err, | 1521 | err, cmd); |
| 1523 | cmd); | ||
| 1524 | kfree(ioctl); | 1522 | kfree(ioctl); |
| 1525 | 1523 | ||
| 1526 | return -EFAULT; | 1524 | return -EFAULT; |
| @@ -1531,7 +1529,7 @@ ioctl_done: · 4 unmodified lines | |||
| 1531 | return 0; | 1529 | return 0; |
| 1532 | } | 1530 | } |
| 1533 | 1531 | ||
| 1534 | int esas2r_ioctl(struct scsi_device *sd, int cmd, void __user *arg) | 1532 | int esas2r_ioctl(struct scsi_device *sd, unsigned int cmd, void __user *arg) |
| 1535 | { | 1533 | { |
| 1536 | return esas2r_ioctl_handler(sd->host->hostdata, cmd, arg); | 1534 | return esas2r_ioctl_handler(sd->host->hostdata, cmd, arg); |
| 1537 | } | 1535 | } |
| @@ -623,7 +623,7 @@ static int esas2r_proc_major; · 622 unmodified lines | |||
| 623 | long esas2r_proc_ioctl(struct file *fp, unsigned int cmd, unsigned long arg) | 623 | long esas2r_proc_ioctl(struct file *fp, unsigned int cmd, unsigned long arg) |
| 624 | { | 624 | { |
| 625 | return esas2r_ioctl_handler(esas2r_proc_host->hostdata, | 625 | return esas2r_ioctl_handler(esas2r_proc_host->hostdata, |
| 626 | (int)cmd, (void __user *)arg); | 626 | cmd, (void __user *)arg); |
| 627 | } | 627 | } |
| 628 | 628 | ||
| 629 | static void __exit esas2r_exit(void) | 629 | static void __exit esas2r_exit(void) |
| @@ -251,10 +251,11 @@ static int number_of_controllers; · 250 unmodified lines | |||
| 251 | 251 | ||
| 252 | static irqreturn_t do_hpsa_intr_intx(int irq, void *dev_id); | 252 | static irqreturn_t do_hpsa_intr_intx(int irq, void *dev_id); |
| 253 | static irqreturn_t do_hpsa_intr_msi(int irq, void *dev_id); | 253 | static irqreturn_t do_hpsa_intr_msi(int irq, void *dev_id); |
| 254 | static int hpsa_ioctl(struct scsi_device *dev, int cmd, void __user *arg); | 254 | static int hpsa_ioctl(struct scsi_device *dev, unsigned int cmd, |
| 255 | void __user *arg); | ||
| 255 | 256 | ||
| 256 | #ifdef CONFIG_COMPAT | 257 | #ifdef CONFIG_COMPAT |
| 257 | static int hpsa_compat_ioctl(struct scsi_device *dev, int cmd, | 258 | static int hpsa_compat_ioctl(struct scsi_device *dev, unsigned int cmd, |
| 258 | void __user *arg); | 259 | void __user *arg); |
| 259 | #endif | 260 | #endif |
| 260 | 261 | ||
| @@ -6127,7 +6128,7 @@ static void cmd_free(struct ctlr_info *h, struct CommandList *c) · 5866 unmodified lines | |||
| 6127 | 6128 | ||
| 6128 | #ifdef CONFIG_COMPAT | 6129 | #ifdef CONFIG_COMPAT |
| 6129 | 6130 | ||
| 6130 | static int hpsa_ioctl32_passthru(struct scsi_device *dev, int cmd, | 6131 | static int hpsa_ioctl32_passthru(struct scsi_device *dev, unsigned int cmd, |
| 6131 | void __user *arg) | 6132 | void __user *arg) |
| 6132 | { | 6133 | { |
| 6133 | IOCTL32_Command_struct __user *arg32 = | 6134 | IOCTL32_Command_struct __user *arg32 = |
| @@ -6164,7 +6165,7 @@ static int hpsa_ioctl32_passthru(struct scsi_device *dev, int cmd, · 30 unmodified lines | |||
| 6164 | } | 6165 | } |
| 6165 | 6166 | ||
| 6166 | static int hpsa_ioctl32_big_passthru(struct scsi_device *dev, | 6167 | static int hpsa_ioctl32_big_passthru(struct scsi_device *dev, |
| 6167 | int cmd, void __user *arg) | 6168 | unsigned int cmd, void __user *arg) |
| 6168 | { | 6169 | { |
| 6169 | BIG_IOCTL32_Command_struct __user *arg32 = | 6170 | BIG_IOCTL32_Command_struct __user *arg32 = |
| 6170 | (BIG_IOCTL32_Command_struct __user *) arg; | 6171 | (BIG_IOCTL32_Command_struct __user *) arg; |
| @@ -6201,7 +6202,8 @@ static int hpsa_ioctl32_big_passthru(struct scsi_device *dev, · 30 unmodified lines | |||
| 6201 | return err; | 6202 | return err; |
| 6202 | } | 6203 | } |
| 6203 | 6204 | ||
| 6204 | static int hpsa_compat_ioctl(struct scsi_device *dev, int cmd, void __user *arg) | 6205 | static int hpsa_compat_ioctl(struct scsi_device *dev, unsigned int cmd, |
| 6206 | void __user *arg) | ||
| 6205 | { | 6207 | { |
| 6206 | switch (cmd) { | 6208 | switch (cmd) { |
| 6207 | case CCISS_GETPCIINFO: | 6209 | case CCISS_GETPCIINFO: |
| @@ -6521,7 +6523,8 @@ static void check_ioctl_unit_attention(struct ctlr_info *h, · 313 unmodified lines | |||
| 6521 | /* | 6523 | /* |
| 6522 | * ioctl | 6524 | * ioctl |
| 6523 | */ | 6525 | */ |
| 6524 | static int hpsa_ioctl(struct scsi_device *dev, int cmd, void __user *arg) | 6526 | static int hpsa_ioctl(struct scsi_device *dev, unsigned int cmd, |
| 6527 | void __user *arg) | ||
| 6525 | { | 6528 | { |
| 6526 | struct ctlr_info *h; | 6529 | struct ctlr_info *h; |
| 6527 | void __user *argp = (void __user *)arg; | 6530 | void __user *argp = (void __user *)arg; |
| @@ -6696,7 +6696,8 @@ err_nodev: · 6695 unmodified lines | |||
| 6696 | * Return value: | 6696 | * Return value: |
| 6697 | * 0 on success / other on failure | 6697 | * 0 on success / other on failure |
| 6698 | **/ | 6698 | **/ |
| 6699 | static int ipr_ioctl(struct scsi_device *sdev, int cmd, void __user *arg) | 6699 | static int ipr_ioctl(struct scsi_device *sdev, unsigned int cmd, |
| 6700 | void __user *arg) | ||
| 6700 | { | 6701 | { |
| 6701 | struct ipr_resource_entry *res; | 6702 | struct ipr_resource_entry *res; |
| 6702 | 6703 | ||
| @@ -799,7 +799,7 @@ out: · 798 unmodified lines | |||
| 799 | shost->host_failed, tries); | 799 | shost->host_failed, tries); |
| 800 | } | 800 | } |
| 801 | 801 | ||
| 802 | int sas_ioctl(struct scsi_device *sdev, int cmd, void __user *arg) | 802 | int sas_ioctl(struct scsi_device *sdev, unsigned int cmd, void __user *arg) |
| 803 | { | 803 | { |
| 804 | struct domain_device *dev = sdev_to_domain_dev(sdev); | 804 | struct domain_device *dev = sdev_to_domain_dev(sdev); |
| 805 | 805 | ||
| @@ -832,7 +832,8 @@ static void mk_sense_invalid_opcode(struct scsi_cmnd *scp) · 831 unmodified lines | |||
| 832 | mk_sense_buffer(scp, ILLEGAL_REQUEST, INVALID_OPCODE, 0); | 832 | mk_sense_buffer(scp, ILLEGAL_REQUEST, INVALID_OPCODE, 0); |
| 833 | } | 833 | } |
| 834 | 834 | ||
| 835 | static int scsi_debug_ioctl(struct scsi_device *dev, int cmd, void __user *arg) | 835 | static int scsi_debug_ioctl(struct scsi_device *dev, unsigned int cmd, |
| 836 | void __user *arg) | ||
| 836 | { | 837 | { |
| 837 | if (sdebug_verbose) { | 838 | if (sdebug_verbose) { |
| 838 | if (0x1261 == cmd) | 839 | if (0x1261 == cmd) |
| @@ -6043,7 +6043,8 @@ out: · 6042 unmodified lines | |||
| 6043 | return rc; | 6043 | return rc; |
| 6044 | } | 6044 | } |
| 6045 | 6045 | ||
| 6046 | static int pqi_ioctl(struct scsi_device *sdev, int cmd, void __user *arg) | 6046 | static int pqi_ioctl(struct scsi_device *sdev, unsigned int cmd, |
| 6047 | void __user *arg) | ||
| 6047 | { | 6048 | { |
| 6048 | int rc; | 6049 | int rc; |
| 6049 | struct pqi_ctrl_info *ctrl_info; | 6050 | struct pqi_ctrl_info *ctrl_info; |
| @@ -1122,10 +1122,11 @@ extern int ata_host_activate(struct ata_host *host, int irq, · 1121 unmodified lines | |||
| 1122 | extern void ata_host_detach(struct ata_host *host); | 1122 | extern void ata_host_detach(struct ata_host *host); |
| 1123 | extern void ata_host_init(struct ata_host *, struct device *, struct ata_port_operations *); | 1123 | extern void ata_host_init(struct ata_host *, struct device *, struct ata_port_operations *); |
| 1124 | extern int ata_scsi_detect(struct scsi_host_template *sht); | 1124 | extern int ata_scsi_detect(struct scsi_host_template *sht); |
| 1125 | extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); | 1125 | extern int ata_scsi_ioctl(struct scsi_device *dev, unsigned int cmd, |
| 1126 | void __user *arg); | ||
| 1126 | extern int ata_scsi_queuecmd(struct Scsi_Host *h, struct scsi_cmnd *cmd); | 1127 | extern int ata_scsi_queuecmd(struct Scsi_Host *h, struct scsi_cmnd *cmd); |
| 1127 | extern int ata_sas_scsi_ioctl(struct ata_port *ap, struct scsi_device *dev, | 1128 | extern int ata_sas_scsi_ioctl(struct ata_port *ap, struct scsi_device *dev, |
| 1128 | int cmd, void __user *arg); | 1129 | unsigned int cmd, void __user *arg); |
| 1129 | extern void ata_sas_port_destroy(struct ata_port *); | 1130 | extern void ata_sas_port_destroy(struct ata_port *); |
| 1130 | extern struct ata_port *ata_sas_port_alloc(struct ata_host *, | 1131 | extern struct ata_port *ata_sas_port_alloc(struct ata_host *, |
| 1131 | struct ata_port_info *, struct Scsi_Host *); | 1132 | struct ata_port_info *, struct Scsi_Host *); |
| @@ -707,7 +707,8 @@ int sas_eh_target_reset_handler(struct scsi_cmnd *cmd); · 706 unmodified lines | |||
| 707 | 707 | ||
| 708 | extern void sas_target_destroy(struct scsi_target *); | 708 | extern void sas_target_destroy(struct scsi_target *); |
| 709 | extern int sas_slave_alloc(struct scsi_device *); | 709 | extern int sas_slave_alloc(struct scsi_device *); |
| 710 | extern int sas_ioctl(struct scsi_device *sdev, int cmd, void __user *arg); | 710 | extern int sas_ioctl(struct scsi_device *sdev, unsigned int cmd, |
| 711 | void __user *arg); | ||
| 711 | extern int sas_drain_work(struct sas_ha_struct *ha); | 712 | extern int sas_drain_work(struct sas_ha_struct *ha); |
| 712 | 713 | ||
| 713 | extern void sas_ssp_task_response(struct device *dev, struct sas_task *task, | 714 | extern void sas_ssp_task_response(struct device *dev, struct sas_task *task, |
| @@ -60,7 +60,8 @@ struct scsi_host_template { · 59 unmodified lines | |||
| 60 | * | 60 | * |
| 61 | * Status: OPTIONAL | 61 | * Status: OPTIONAL |
| 62 | */ | 62 | */ |
| 63 | int (* ioctl)(struct scsi_device *dev, int cmd, void __user *arg); | 63 | int (*ioctl)(struct scsi_device *dev, unsigned int cmd, |
| 64 | void __user *arg); | ||
| 64 | 65 | ||
| 65 | 66 | ||
| 66 | #ifdef CONFIG_COMPAT | 67 | #ifdef CONFIG_COMPAT |
| @@ -70,7 +71,8 @@ struct scsi_host_template { · 3 unmodified lines | |||
| 70 | * | 71 | * |
| 71 | * Status: OPTIONAL | 72 | * Status: OPTIONAL |
| 72 | */ | 73 | */ |
| 73 | int (* compat_ioctl)(struct scsi_device *dev, int cmd, void __user *arg); | 74 | int (*compat_ioctl)(struct scsi_device *dev, unsigned int cmd, |
| 75 | void __user *arg); | ||
| 74 | #endif | 76 | #endif |
| 75 | 77 | ||
| 76 | /* | 78 | /* |