-
Notifications
You must be signed in to change notification settings - Fork 54.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge patch series "scsi: mpt3sas: Use flexible arrays and do a few c…
…leanups" James Seo <[email protected]> says: Commit df8fc4e ("kbuild: Enable -fstrict-flex-arrays=3") has resulted in the only arrays that UBSAN_BOUNDS considers unbounded being trailing arrays declared with [] as the last member of a struct. Unbounded trailing arrays declared with [1] are common in mpt3sas, which is causing spurious warnings to appear in some situations, e.g. when more than one physical disk is connected: UBSAN: array-index-out-of-bounds in drivers/scsi/mpt3sas/mpt3sas_scsih.c:6810:36 index 1 is out of range for type 'MPI2_SAS_IO_UNIT0_PHY_DATA [1]' which relates to this unbounded array access: port_id = sas_iounit_pg0->PhyData[i].Port; and is just one example of 10 similar warnings currently occurring for me during boot. This series converts most trailing arrays declared with [1] in mptsas into proper C99 flexible array members. Those that are not unbounded and really are fixed-length arrays of length 1 are left alone. I didn't find any conversions that required further source edits besides changing [1] to [], and everything seems to work with my SAS2008-based add-in card, but please look things over in case I missed something subtle. Rounding out the series are some opportunistic cleanups. The only dependency is that patch 7 ("Use struct_size() for struct size calculations") depends on patches 3-5. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin K. Petersen <[email protected]>
- Loading branch information
Showing
10 changed files
with
151 additions
and
293 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.