Skip to content

Commit fc8a5ee

Browse files
keesmartinkpetersen
authored andcommitted
scsi: pm80xx: Add __nonstring annotations for unterminated strings
When a character array without a terminating NUL character has a static initializer, GCC 15's -Wunterminated-string-initialization will only warn if the array lacks the "nonstring" attribute[1]. Mark the arrays with __nonstring to and correctly identify the char array as "not a C string" and thereby eliminate the warning. Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=117178 [1] Cc: Jack Wang <jinpu.wang@cloud.ionos.com> Cc: James E.J. Bottomley <James.Bottomley@HansenPartnership.com> Cc: Martin K. Petersen <martin.petersen@oracle.com> Cc: linux-scsi@vger.kernel.org Signed-off-by: Kees Cook <kees@kernel.org> Link: https://lore.kernel.org/r/20250310222553.work.437-kees@kernel.org Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 500d4b7 commit fc8a5ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/pm8001/pm8001_ctl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ static DEVICE_ATTR(gsm_log, S_IRUGO, pm8001_ctl_gsm_log_show, NULL);
644644
#define FLASH_CMD_SET_NVMD 0x02
645645

646646
struct flash_command {
647-
u8 command[8];
647+
u8 command[8] __nonstring;
648648
int code;
649649
};
650650

0 commit comments

Comments
 (0)