diff options
author | Stephen Kitt <steve@sk2.org> | 2018-03-09 23:32:11 +0100 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-03-12 22:37:20 -0400 |
commit | 92eb506262a2a3da9aeaece7017e77490da907dd (patch) | |
tree | 1896ed10ae1166a3a01fe52ead7fd5a21540b872 /drivers/scsi/device_handler/scsi_dh_emc.c | |
parent | e32ec6579f5b3134cb27cc063c17da0bb8cd29c7 (diff) | |
download | linux-92eb506262a2a3da9aeaece7017e77490da907dd.tar.gz linux-92eb506262a2a3da9aeaece7017e77490da907dd.tar.bz2 linux-92eb506262a2a3da9aeaece7017e77490da907dd.zip |
scsi: device_handler: remove VLAs
In preparation to enabling -Wvla, remove VLAs and replace them with
fixed-length arrays instead.
scsi_dh_{alua,emc,rdac} use variable-length array declarations to store
command blocks, with the appropriate size as determined by
COMMAND_SIZE. This patch replaces these with fixed-sized arrays using
MAX_COMMAND_SIZE, so that the array size can be determined at compile
time.
This was prompted by https://lkml.org/lkml/2018/3/7/621
Signed-off-by: Stephen Kitt <steve@sk2.org>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/device_handler/scsi_dh_emc.c')
-rw-r--r-- | drivers/scsi/device_handler/scsi_dh_emc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/device_handler/scsi_dh_emc.c b/drivers/scsi/device_handler/scsi_dh_emc.c index 6a2792f3a37e..95c47909a58f 100644 --- a/drivers/scsi/device_handler/scsi_dh_emc.c +++ b/drivers/scsi/device_handler/scsi_dh_emc.c @@ -249,7 +249,7 @@ static int send_trespass_cmd(struct scsi_device *sdev, struct clariion_dh_data *csdev) { unsigned char *page22; - unsigned char cdb[COMMAND_SIZE(MODE_SELECT)]; + unsigned char cdb[MAX_COMMAND_SIZE]; int err, res = SCSI_DH_OK, len; struct scsi_sense_hdr sshdr; u64 req_flags = REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | |