scsi: libfc: Replace one-element arrays with flexible-array members
authorGustavo A. R. Silva <gustavoars@kernel.org>
Mon, 14 Feb 2022 22:39:03 +0000 (16:39 -0600)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 28 Feb 2022 02:17:37 +0000 (21:17 -0500)
commitc5b483d5c1a26b6006180f5dc7b2f8674f19afa3
tree06b4b4e747d5074c0be888304465f51e467a3784
parentb709a4caa9d01f89314a4e5aab2e722fc9a5989a
scsi: libfc: Replace one-element arrays with flexible-array members

Use flexible-array members in struct fc_fdmi_attr_entry and fs_fdmi_attrs
instead of one-element arrays, and refactor the code accordingly.

Also, this helps with the ongoing efforts to globally enable -Warray-bounds
and get us closer to being able to tighten the FORTIFY_SOURCE routines on
memcpy().

https://github.com/KSPP/linux/issues/79
https://github.com/ClangBuiltLinux/linux/issues/1590

Link: https://lore.kernel.org/r/20220214223903.GA859464@embeddedor
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/libfc/fc_encode.h
include/scsi/fc/fc_ms.h