Skip to content

Commit 56a4d69

Browse files
GustavoARSilvamartinkpetersen
authored andcommitted
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: KSPP/linux#339 Signed-off-by: "Gustavo A. R. Silva" <[email protected]> Link: https://lore.kernel.org/r/ZN0VTpDBOSVHGayb@work Reviewed-by: Kees Cook <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 1e4474c commit 56a4d69

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/scsi/bfa/bfa_fc.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ struct fc_rscn_pl_s {
800800
u8 command;
801801
u8 pagelen;
802802
__be16 payldlen;
803-
struct fc_rscn_event_s event[1];
803+
struct fc_rscn_event_s event[];
804804
};
805805

806806
/*

drivers/scsi/bfa/bfa_fcbuild.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,7 @@ fc_rscn_build(struct fchs_s *fchs, struct fc_rscn_pl_s *rscn,
10511051
rscn->event[0].format = FC_RSCN_FORMAT_PORTID;
10521052
rscn->event[0].portid = s_id;
10531053

1054-
return sizeof(struct fc_rscn_pl_s);
1054+
return struct_size(rscn, event, 1);
10551055
}
10561056

10571057
u16

0 commit comments

Comments
 (0)