Re: [PATCH] device_handler: remove VLAs

2018-03-12 Thread Stephen Kitt
On Mon, 12 Mar 2018 15:41:26 +, Bart Van Assche <bart.vanass...@wdc.com> wrote: > On Sat, 2018-03-10 at 14:14 +0100, Stephen Kitt wrote: > > The two patches I sent were supposed to be alternative solutions; see > > https://marc.info/?l=linux-scsi=152063671005295=2 for th

Re: [PATCH] scsi: resolve COMMAND_SIZE at compile time

2018-03-10 Thread Stephen Kitt
Hi Bart, On Fri, 9 Mar 2018 22:47:12 +, Bart Van Assche <bart.vanass...@wdc.com> wrote: > On Fri, 2018-03-09 at 23:33 +0100, Stephen Kitt wrote: > > +/* > > + * SCSI command sizes are as follows, in bytes, for fixed size commands, > > per > > + * group: 6, 10

Re: [PATCH] device_handler: remove VLAs

2018-03-10 Thread Stephen Kitt
Hi Bart, On Fri, 9 Mar 2018 22:48:10 +, Bart Van Assche <bart.vanass...@wdc.com> wrote: > On Fri, 2018-03-09 at 23:32 +0100, Stephen Kitt wrote: > > In preparation to enabling -Wvla, remove VLAs and replace them with > > fixed-length arrays instead. > > >

VLA removal, device_handler and COMMAND_SIZE

2018-03-09 Thread Stephen Kitt
Hi, I’ve been looking into removing some VLAs from device_handler drivers, prompted by https://lkml.org/lkml/2018/3/7/621 The uses in question here are quite straightforward, e.g. in drivers/scsi/device_handler/scsi_dh_alua.c: u8 cdb[COMMAND_SIZE(MAINTENANCE_IN)]; There’s no trivial

Re: [PATCH] bfa: remove VLA

2018-03-09 Thread Stephen Kitt
Hi, I sent this to the wrong maintainers, sorry — you’ll find the original patch on https://patchwork.kernel.org/patch/10269257/ Regards, Stephen On Thu, 8 Mar 2018 13:43:07 -0800, Kees Cook <keesc...@chromium.org> wrote: > On Thu, Mar 8, 2018 at 1:38 PM, Stephen Kitt <st...@sk

[PATCH] scsi: resolve COMMAND_SIZE at compile time

2018-03-09 Thread Stephen Kitt
. This was prompted by https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Stephen Kitt <st...@sk2.org> --- block/scsi_ioctl.c | 8 drivers/target/Kconfig | 1 - include/scsi/scsi_common.h | 13 +++-- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a

[PATCH] device_handler: remove VLAs

2018-03-09 Thread Stephen Kitt
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 <st...@sk2.org> --- drivers/scsi/device_handler/scsi_dh_alua.c | 8 drivers/scsi/device_handler/scsi_dh_emc.c | 2 +- d

Re: [PATCH] aic7xxx/aic79xx: remove VLAs

2018-03-08 Thread Stephen Kitt
On Thu, 8 Mar 2018 11:52:25 -0800, Kees Cook <keesc...@chromium.org> wrote: > On Thu, Mar 8, 2018 at 5:22 AM, Stephen Kitt <st...@sk2.org> wrote: > > -static const int num_critical_sections = sizeof(critical_sections) > > -

[PATCH] bfa: remove VLA

2018-03-08 Thread Stephen Kitt
altogether. This was prompted by https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Stephen Kitt <st...@sk2.org> --- drivers/scsi/bfa/bfad_bsg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/bfa/bfad_bsg.c b/drivers/scsi/bfa/bfad_bsg.c index 3976e7

[PATCH v2] aic7xxx/aic79xx: remove VLAs

2018-03-08 Thread Stephen Kitt
ARRAY_SIZE. This was prompted by https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Stephen Kitt <st...@sk2.org> --- drivers/scsi/aic7xxx/aic79xx_core.c| 8 drivers/scsi/aic7xxx/aic79xx_seq.h_shipped | 3 +-- drivers/scsi/aic7xxx/aic7xxx_core.c| 8 drivers/scsi/a

[PATCH] aic7xxx/aic79xx: remove VLAs

2018-03-08 Thread Stephen Kitt
use a pre-processor-level constant instead. This was prompted by https://lkml.org/lkml/2018/3/7/621 Signed-off-by: Stephen Kitt <st...@sk2.org> --- drivers/scsi/aic7xxx/aic79xx_core.c| 8 drivers/scsi/aic7xxx/aic79xx_seq.h_shipped | 3 +-- drivers/scsi/aic7xxx/aic7xxx_