scsi: mpt3sas: Use struct_size() for struct size calculations

After converting terminal variable arrays into flexible array members, use
the bounds-checking struct_size() helper when possible to avoid open-coded
arithmetic struct size calculations.

Signed-off-by: James Seo <james@equiv.tech>
Link: https://lore.kernel.org/r/20230806170604.16143-8-james@equiv.tech
Tested-by: Borislav Petkov (AMD) <bp@alien8.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
James Seo 2023-08-06 10:05:59 -07:00 • committed by Martin K. Petersen
commit f4f76e1417
4 changed files with 11 additions and 22 deletions