diff options
author | Martin Wilck <mwilck@suse.com> | 2018-04-17 19:35:08 -0400 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-04-20 19:14:35 -0400 |
commit | 1409880357ed33dc1c23eed080d88ea4410ed9a3 (patch) | |
tree | bedb737ada763f6fb7a65697dda062b66c745ba6 | |
parent | 659c1c1b29ebc4af9148eed74a9f28f00b8b6dc6 (diff) |
scsi: devinfo: change blist_flag_t to 64bit
Space for SCSI blist flags is gradually running out. Change the type to
__u64 and fix a checkpatch complaint about symbolic mode flags in
scsi_devinfo.c.
Make checkpatch happy by replacing simple_strtoul() with kstrtoull().
Signed-off-by: Martin Wilck <mwilck@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
-rw-r--r-- | drivers/scsi/scsi_devinfo.c | 18 | ||||
-rw-r--r-- | drivers/scsi/scsi_sysfs.c | 2 | ||||
-rw-r--r-- | include/scsi/scsi_device.h | 2 | ||||
-rw-r--r-- | include/scsi/scsi_devinfo.h | 50 |
4 files changed, 40 insertions, 32 deletions
diff --git a/drivers/scsi/scsi_devinfo.c b/drivers/scsi/scsi_devinfo.c index e5c82f13b7d9..bd04a33e4360 100644 --- a/drivers/scsi/scsi_devinfo.c +++ b/drivers/scsi/scsi_devinfo.c | |||
@@ -360,8 +360,16 @@ int scsi_dev_info_list_add_keyed(int compatible, char *vendor, char *model, | |||
360 | scsi_strcpy_devinfo("model", devinfo->model, sizeof(devinfo->model), | 360 | scsi_strcpy_devinfo("model", devinfo->model, sizeof(devinfo->model), |
361 | model, compatible); | 361 | model, compatible); |
362 | 362 | ||
363 | if (strflags) | 363 | if (strflags) { |
364 | flags = (__force blist_flags_t)simple_strtoul(strflags, NULL, 0); | 364 | unsigned long long val; |
365 | int ret = kstrtoull(strflags, 0, &val); | ||
366 | |||
367 | if (ret != 0) { | ||
368 | kfree(devinfo); | ||
369 | return ret; | ||
370 | } | ||
371 | flags = (__force blist_flags_t)val; | ||
372 | } | ||
365 | devinfo->flags = flags; | 373 | devinfo->flags = flags; |
366 | devinfo->compatible = compatible; | 374 | devinfo->compatible = compatible; |
367 | 375 | ||
@@ -614,7 +622,7 @@ static int devinfo_seq_show(struct seq_file *m, void *v) | |||
614 | devinfo_table->name) | 622 | devinfo_table->name) |
615 | seq_printf(m, "[%s]:\n", devinfo_table->name); | 623 | seq_printf(m, "[%s]:\n", devinfo_table->name); |
616 | 624 | ||
617 | seq_printf(m, "'%.8s' '%.16s' 0x%x\n", | 625 | seq_printf(m, "'%.8s' '%.16s' 0x%llx\n", |
618 | devinfo->vendor, devinfo->model, devinfo->flags); | 626 | devinfo->vendor, devinfo->model, devinfo->flags); |
619 | return 0; | 627 | return 0; |
620 | } | 628 | } |
@@ -733,9 +741,9 @@ MODULE_PARM_DESC(dev_flags, | |||
733 | " list entries for vendor and model with an integer value of flags" | 741 | " list entries for vendor and model with an integer value of flags" |
734 | " to the scsi device info list"); | 742 | " to the scsi device info list"); |
735 | 743 | ||
736 | module_param_named(default_dev_flags, scsi_default_dev_flags, int, S_IRUGO|S_IWUSR); | 744 | module_param_named(default_dev_flags, scsi_default_dev_flags, ullong, 0644); |
737 | MODULE_PARM_DESC(default_dev_flags, | 745 | MODULE_PARM_DESC(default_dev_flags, |
738 | "scsi default device flag integer value"); | 746 | "scsi default device flag uint64_t value"); |
739 | 747 | ||
740 | /** | 748 | /** |
741 | * scsi_exit_devinfo - remove /proc/scsi/device_info & the scsi_dev_info_list | 749 | * scsi_exit_devinfo - remove /proc/scsi/device_info & the scsi_dev_info_list |
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index 5120e613a29c..7943b762c12d 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c | |||
@@ -968,7 +968,7 @@ sdev_show_wwid(struct device *dev, struct device_attribute *attr, | |||
968 | static DEVICE_ATTR(wwid, S_IRUGO, sdev_show_wwid, NULL); | 968 | static DEVICE_ATTR(wwid, S_IRUGO, sdev_show_wwid, NULL); |
969 | 969 | ||
970 | #define BLIST_FLAG_NAME(name) \ | 970 | #define BLIST_FLAG_NAME(name) \ |
971 | [const_ilog2((__force unsigned int)BLIST_##name)] = #name | 971 | [const_ilog2((__force __u64)BLIST_##name)] = #name |
972 | static const char *const sdev_bflags_name[] = { | 972 | static const char *const sdev_bflags_name[] = { |
973 | #include "scsi_devinfo_tbl.c" | 973 | #include "scsi_devinfo_tbl.c" |
974 | }; | 974 | }; |
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index 7ae177c8e399..4c36af6edd79 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -15,7 +15,7 @@ struct scsi_cmnd; | |||
15 | struct scsi_lun; | 15 | struct scsi_lun; |
16 | struct scsi_sense_hdr; | 16 | struct scsi_sense_hdr; |
17 | 17 | ||
18 | typedef unsigned int __bitwise blist_flags_t; | 18 | typedef __u64 __bitwise blist_flags_t; |
19 | 19 | ||
20 | struct scsi_mode_data { | 20 | struct scsi_mode_data { |
21 | __u32 length; | 21 | __u32 length; |
diff --git a/include/scsi/scsi_devinfo.h b/include/scsi/scsi_devinfo.h index ea67c32e870e..e206d299f137 100644 --- a/include/scsi/scsi_devinfo.h +++ b/include/scsi/scsi_devinfo.h | |||
@@ -6,55 +6,55 @@ | |||
6 | */ | 6 | */ |
7 | 7 | ||
8 | /* Only scan LUN 0 */ | 8 | /* Only scan LUN 0 */ |
9 | #define BLIST_NOLUN ((__force blist_flags_t)(1 << 0)) | 9 | #define BLIST_NOLUN ((__force blist_flags_t)(1ULL << 0)) |
10 | /* Known to have LUNs, force scanning. | 10 | /* Known to have LUNs, force scanning. |
11 | * DEPRECATED: Use max_luns=N */ | 11 | * DEPRECATED: Use max_luns=N */ |
12 | #define BLIST_FORCELUN ((__force blist_flags_t)(1 << 1)) | 12 | #define BLIST_FORCELUN ((__force blist_flags_t)(1ULL << 1)) |
13 | /* Flag for broken handshaking */ | 13 | /* Flag for broken handshaking */ |
14 | #define BLIST_BORKEN ((__force blist_flags_t)(1 << 2)) | 14 | #define BLIST_BORKEN ((__force blist_flags_t)(1ULL << 2)) |
15 | /* unlock by special command */ | 15 | /* unlock by special command */ |
16 | #define BLIST_KEY ((__force blist_flags_t)(1 << 3)) | 16 | #define BLIST_KEY ((__force blist_flags_t)(1ULL << 3)) |
17 | /* Do not use LUNs in parallel */ | 17 | /* Do not use LUNs in parallel */ |
18 | #define BLIST_SINGLELUN ((__force blist_flags_t)(1 << 4)) | 18 | #define BLIST_SINGLELUN ((__force blist_flags_t)(1ULL << 4)) |
19 | /* Buggy Tagged Command Queuing */ | 19 | /* Buggy Tagged Command Queuing */ |
20 | #define BLIST_NOTQ ((__force blist_flags_t)(1 << 5)) | 20 | #define BLIST_NOTQ ((__force blist_flags_t)(1ULL << 5)) |
21 | /* Non consecutive LUN numbering */ | 21 | /* Non consecutive LUN numbering */ |
22 | #define BLIST_SPARSELUN ((__force blist_flags_t)(1 << 6)) | 22 | #define BLIST_SPARSELUN ((__force blist_flags_t)(1ULL << 6)) |
23 | /* Avoid LUNS >= 5 */ | 23 | /* Avoid LUNS >= 5 */ |
24 | #define BLIST_MAX5LUN ((__force blist_flags_t)(1 << 7)) | 24 | #define BLIST_MAX5LUN ((__force blist_flags_t)(1ULL << 7)) |
25 | /* Treat as (removable) CD-ROM */ | 25 | /* Treat as (removable) CD-ROM */ |
26 | #define BLIST_ISROM ((__force blist_flags_t)(1 << 8)) | 26 | #define BLIST_ISROM ((__force blist_flags_t)(1ULL << 8)) |
27 | /* LUNs past 7 on a SCSI-2 device */ | 27 | /* LUNs past 7 on a SCSI-2 device */ |
28 | #define BLIST_LARGELUN ((__force blist_flags_t)(1 << 9)) | 28 | #define BLIST_LARGELUN ((__force blist_flags_t)(1ULL << 9)) |
29 | /* override additional length field */ | 29 | /* override additional length field */ |
30 | #define BLIST_INQUIRY_36 ((__force blist_flags_t)(1 << 10)) | 30 | #define BLIST_INQUIRY_36 ((__force blist_flags_t)(1ULL << 10)) |
31 | /* do not do automatic start on add */ | 31 | /* do not do automatic start on add */ |
32 | #define BLIST_NOSTARTONADD ((__force blist_flags_t)(1 << 12)) | 32 | #define BLIST_NOSTARTONADD ((__force blist_flags_t)(1ULL << 12)) |
33 | /* try REPORT_LUNS even for SCSI-2 devs (if HBA supports more than 8 LUNs) */ | 33 | /* try REPORT_LUNS even for SCSI-2 devs (if HBA supports more than 8 LUNs) */ |
34 | #define BLIST_REPORTLUN2 ((__force blist_flags_t)(1 << 17)) | 34 | #define BLIST_REPORTLUN2 ((__force blist_flags_t)(1ULL << 17)) |
35 | /* don't try REPORT_LUNS scan (SCSI-3 devs) */ | 35 | /* don't try REPORT_LUNS scan (SCSI-3 devs) */ |
36 | #define BLIST_NOREPORTLUN ((__force blist_flags_t)(1 << 18)) | 36 | #define BLIST_NOREPORTLUN ((__force blist_flags_t)(1ULL << 18)) |
37 | /* don't use PREVENT-ALLOW commands */ | 37 | /* don't use PREVENT-ALLOW commands */ |
38 | #define BLIST_NOT_LOCKABLE ((__force blist_flags_t)(1 << 19)) | 38 | #define BLIST_NOT_LOCKABLE ((__force blist_flags_t)(1ULL << 19)) |
39 | /* device is actually for RAID config */ | 39 | /* device is actually for RAID config */ |
40 | #define BLIST_NO_ULD_ATTACH ((__force blist_flags_t)(1 << 20)) | 40 | #define BLIST_NO_ULD_ATTACH ((__force blist_flags_t)(1ULL << 20)) |
41 | /* select without ATN */ | 41 | /* select without ATN */ |
42 | #define BLIST_SELECT_NO_ATN ((__force blist_flags_t)(1 << 21)) | 42 | #define BLIST_SELECT_NO_ATN ((__force blist_flags_t)(1ULL << 21)) |
43 | /* retry HARDWARE_ERROR */ | 43 | /* retry HARDWARE_ERROR */ |
44 | #define BLIST_RETRY_HWERROR ((__force blist_flags_t)(1 << 22)) | 44 | #define BLIST_RETRY_HWERROR ((__force blist_flags_t)(1ULL << 22)) |
45 | /* maximum 512 sector cdb length */ | 45 | /* maximum 512 sector cdb length */ |
46 | #define BLIST_MAX_512 ((__force blist_flags_t)(1 << 23)) | 46 | #define BLIST_MAX_512 ((__force blist_flags_t)(1ULL << 23)) |
47 | /* Disable T10 PI (DIF) */ | 47 | /* Disable T10 PI (DIF) */ |
48 | #define BLIST_NO_DIF ((__force blist_flags_t)(1 << 25)) | 48 | #define BLIST_NO_DIF ((__force blist_flags_t)(1ULL << 25)) |
49 | /* Ignore SBC-3 VPD pages */ | 49 | /* Ignore SBC-3 VPD pages */ |
50 | #define BLIST_SKIP_VPD_PAGES ((__force blist_flags_t)(1 << 26)) | 50 | #define BLIST_SKIP_VPD_PAGES ((__force blist_flags_t)(1ULL << 26)) |
51 | /* Attempt to read VPD pages */ | 51 | /* Attempt to read VPD pages */ |
52 | #define BLIST_TRY_VPD_PAGES ((__force blist_flags_t)(1 << 28)) | 52 | #define BLIST_TRY_VPD_PAGES ((__force blist_flags_t)(1ULL << 28)) |
53 | /* don't try to issue RSOC */ | 53 | /* don't try to issue RSOC */ |
54 | #define BLIST_NO_RSOC ((__force blist_flags_t)(1 << 29)) | 54 | #define BLIST_NO_RSOC ((__force blist_flags_t)(1ULL << 29)) |
55 | /* maximum 1024 sector cdb length */ | 55 | /* maximum 1024 sector cdb length */ |
56 | #define BLIST_MAX_1024 ((__force blist_flags_t)(1 << 30)) | 56 | #define BLIST_MAX_1024 ((__force blist_flags_t)(1ULL << 30)) |
57 | /* Use UNMAP limit for WRITE SAME */ | 57 | /* Use UNMAP limit for WRITE SAME */ |
58 | #define BLIST_UNMAP_LIMIT_WS ((__force blist_flags_t)(1 << 31)) | 58 | #define BLIST_UNMAP_LIMIT_WS ((__force blist_flags_t)(1ULL << 31)) |
59 | 59 | ||
60 | #endif | 60 | #endif |