Commit bb26224
scsi: lpfc: Use struct_size() helper
Prefer struct_size() over open-coded versions of idiom:
sizeof(struct-with-flex-array) + sizeof(typeof-flex-array-elements) * count
where count is the max number of items the flexible array is supposed to
contain.
Link: KSPP#160
Co-developed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Co-developed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Justin Tee <justin.tee@broadcom.com>
Link: https://lore.kernel.org/r/20230531223319.24328-1-justintee8345@gmail.com
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>1 parent 9c24f90 commit bb26224
1 file changed
Lines changed: 2 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3748 | 3748 | | |
3749 | 3749 | | |
3750 | 3750 | | |
3751 | | - | |
3752 | | - | |
| 3751 | + | |
3753 | 3752 | | |
3754 | 3753 | | |
3755 | 3754 | | |
| |||
3768 | 3767 | | |
3769 | 3768 | | |
3770 | 3769 | | |
3771 | | - | |
3772 | | - | |
| 3770 | + | |
3773 | 3771 | | |
3774 | 3772 | | |
3775 | 3773 | | |
| |||
0 commit comments