aboutsummaryrefslogtreecommitdiffstats
path: root/include/scsi
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavoars@kernel.org>2022-02-14 16:39:03 -0600
committerMartin K. Petersen <martin.petersen@oracle.com>2022-02-27 21:17:37 -0500
commitc5b483d5c1a26b6006180f5dc7b2f8674f19afa3 (patch)
tree06b4b4e747d5074c0be888304465f51e467a3784 /include/scsi
parentscsi: pm8001: Fix pm8001_info() message format (diff)
downloadlinux-dev-c5b483d5c1a26b6006180f5dc7b2f8674f19afa3.tar.xz
linux-dev-c5b483d5c1a26b6006180f5dc7b2f8674f19afa3.zip
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>
Diffstat (limited to 'include/scsi')
-rw-r--r--include/scsi/fc/fc_ms.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/scsi/fc/fc_ms.h b/include/scsi/fc/fc_ms.h
index 00191695233a..56a5d2b5a624 100644
--- a/include/scsi/fc/fc_ms.h
+++ b/include/scsi/fc/fc_ms.h
@@ -158,7 +158,7 @@ struct fc_fdmi_port_name {
struct fc_fdmi_attr_entry {
__be16 type;
__be16 len;
- __u8 value[1];
+ __u8 value[];
} __attribute__((__packed__));
/*
@@ -166,7 +166,7 @@ struct fc_fdmi_attr_entry {
*/
struct fs_fdmi_attrs {
__be32 numattrs;
- struct fc_fdmi_attr_entry attr[1];
+ struct fc_fdmi_attr_entry attr[];
} __attribute__((__packed__));
/*