RE: [PATCH] bfa: remove VLA

2018-03-15 Thread David Laight
> > - 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. iocmd->nports * sizeof(wwn_t)) != BFA_STATUS_OK) { is easier to focus on :-)

RE: [PATCH] bfa: remove VLA

2018-03-15 Thread David Laight
> > - 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. iocmd->nports * sizeof(wwn_t)) != BFA_STATUS_OK) { is easier to focus on :-)

Re: [PATCH] bfa: remove VLA

2018-03-14 Thread Martin K. Petersen
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) {

Re: [PATCH] bfa: remove VLA

2018-03-14 Thread Martin K. Petersen
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) {

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 wrote: > On Thu, Mar 8, 2018 at 1:38 PM, Stephen Kitt wrote: >

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 wrote: > On Thu, Mar 8, 2018 at 1:38 PM, Stephen Kitt wrote: > > In preparation to enabling -Wvla,

Re: [PATCH] bfa: remove VLA

2018-03-08 Thread Kees Cook
On Thu, Mar 8, 2018 at 1:38 PM, Stephen Kitt wrote: > 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

Re: [PATCH] bfa: remove VLA

2018-03-08 Thread Kees Cook
On Thu, Mar 8, 2018 at 1:38 PM, Stephen Kitt wrote: > 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 >

[PATCH] bfa: remove VLA

2018-03-08 Thread Stephen Kitt
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

[PATCH] bfa: remove VLA

2018-03-08 Thread Stephen Kitt
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