summaryrefslogtreecommitdiff
path: root/drivers/scsi/libfc
diff options
context:
space:
mode:
authorGustavo A. R. Silva <gustavoars@kernel.org>2022-02-15 01:39:03 +0300
committerMartin K. Petersen <martin.petersen@oracle.com>2022-02-28 05:17:37 +0300
commitc5b483d5c1a26b6006180f5dc7b2f8674f19afa3 (patch)
tree06b4b4e747d5074c0be888304465f51e467a3784 /drivers/scsi/libfc
parentb709a4caa9d01f89314a4e5aab2e722fc9a5989a (diff)
downloadlinux-c5b483d5c1a26b6006180f5dc7b2f8674f19afa3.tar.xz
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 'drivers/scsi/libfc')
-rw-r--r--drivers/scsi/libfc/fc_encode.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/libfc/fc_encode.h b/drivers/scsi/libfc/fc_encode.h
index 74ae7fd15d8d..7dcac3b6baa7 100644
--- a/drivers/scsi/libfc/fc_encode.h
+++ b/drivers/scsi/libfc/fc_encode.h
@@ -246,7 +246,7 @@ static inline int fc_ct_ms_fill(struct fc_lport *lport,
&entry->type);
put_unaligned_be16(len, &entry->len);
put_unaligned_be64(lport->wwnn,
- (__be64 *)&entry->value[0]);
+ (__be64 *)&entry->value);
/* Manufacturer */
entry = (struct fc_fdmi_attr_entry *)((char *)entry->value +