lkml.org 
[lkml]   [2018]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] bfa: remove VLA
From
Date

Stephen,

> 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.
>
> - sizeof(wwn_t[iocmd->nports])) != BFA_STATUS_OK) {
> + sizeof(wwn_t) * iocmd->nports) != BFA_STATUS_OK) {

These parentheses made me blurry eyed but it's actually OK.

Applied to 4.17/scsi-queue.

--
Martin K. Petersen Oracle Linux Engineering

\
 
 \ /
  Last update: 2018-03-15 05:38    [W:0.064 / U:0.280 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site