Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: bfa: Replace one-element array with flexible-array member in struct fc_rscn_pl_s

One-element and zero-length arrays are deprecated. So, replace one-element
array in struct fc_rscn_pl_s with flexible-array member.

This results in no differences in binary output.

Link: https://github.com/KSPP/linux/issues/339
Signed-off-by: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/ZN0VTpDBOSVHGayb@work
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Gustavo A. R. Silva and committed by
Martin K. Petersen
56a4d69a 1e4474c8

+2 -2
+1 -1
drivers/scsi/bfa/bfa_fc.h
··· 800 800 u8 command; 801 801 u8 pagelen; 802 802 __be16 payldlen; 803 - struct fc_rscn_event_s event[1]; 803 + struct fc_rscn_event_s event[]; 804 804 }; 805 805 806 806 /*
+1 -1
drivers/scsi/bfa/bfa_fcbuild.c
··· 1051 1051 rscn->event[0].format = FC_RSCN_FORMAT_PORTID; 1052 1052 rscn->event[0].portid = s_id; 1053 1053 1054 - return sizeof(struct fc_rscn_pl_s); 1054 + return struct_size(rscn, event, 1); 1055 1055 } 1056 1056 1057 1057 u16