Thread (14 messages) 14 messages, 6 authors, 2018-03-13

Re: [PATCH] device_handler: remove VLAs

From: Hannes Reinecke <hare@suse.de>
Date: 2018-03-12 06:25:13
Also in: linux-scsi, lkml

On 03/09/2018 11:32 PM, Stephen Kitt wrote:
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 <redacted>
---
 drivers/scsi/device_handler/scsi_dh_alua.c | 8 ++++----
 drivers/scsi/device_handler/scsi_dh_emc.c  | 2 +-
 drivers/scsi/device_handler/scsi_dh_rdac.c | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help