scsi: bfa: remove VLA
authorStephen Kitt <steve@sk2.org>
Thu, 8 Mar 2018 21:38:41 +0000 (22:38 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 15 Mar 2018 04:35:43 +0000 (00:35 -0400)
commit1929e82e37d9c43ce7063025877a779ac649d1e0
tree931086037697fdd1e231002ddffbe9af43de3f09
parent88b13609afca8ed2992c107c15326b4a8142e5da
scsi: bfa: remove VLA

In preparation to enabling -Wvla, remove VLAs and replace them with
fixed-length arrays instead.

bfad_bsg.c uses a variable-length array declaration to measure the
size of a putative array; this can be replaced by the product of the
size of an element and the number of elements, avoiding the VLA
altogether.

This was prompted by https://lkml.org/lkml/2018/3/7/621

Signed-off-by: Stephen Kitt <steve@sk2.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/bfa/bfad_bsg.c