diff mbox series

[5/8,next] scsi: aacraid: Replace one-element array with flexible-array member in struct user_sgmap64

Message ID f3323c247423c8639c6efa27ebb4a2a382f265c7.1645513670.git.gustavoars@kernel.org (mailing list archive)
State New, archived
Headers show
Series scsi: aacraid: Replace one-element arrays with flexible-array members | expand

Commit Message

Gustavo A. R. Silva Feb. 22, 2022, 7:30 a.m. UTC
Replace one-element array with flexible-array member in struct user_sgmap64.

This issue was found with the help of Coccinelle and audited and fixed,
manually.

Link: https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays
Link: https://github.com/KSPP/linux/issues/79
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
---
 drivers/scsi/aacraid/aacraid.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/scsi/aacraid/aacraid.h b/drivers/scsi/aacraid/aacraid.h
index 573cb36c2e15..fa5a93b4dc7b 100644
--- a/drivers/scsi/aacraid/aacraid.h
+++ b/drivers/scsi/aacraid/aacraid.h
@@ -521,7 +521,7 @@  struct sgmap64 {
 
 struct user_sgmap64 {
 	u32		count;
-	struct user_sgentry64 sg[1];
+	struct user_sgentry64 sg[];
 };
 
 struct sgmapraw {