Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

usb: storage: sddr55: Use const for constant arrays

These arrays are only read, not modified.

Declaring data as const makes it easier to see what's going on, and can
prevent unintended writes through placement in a read-only section.

Signed-off-by: Jonathan Neuschäfer <j.ne@posteo.net>
Reviewed-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20250228-misc-const-v3-8-09b417ded9c4@posteo.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jonathan Neuschäfer and committed by
Greg Kroah-Hartman
9dd3aa74 5dc02c96

+2 -2
+2 -2
drivers/usb/storage/sddr55.c
··· 775 775 static int sddr55_transport(struct scsi_cmnd *srb, struct us_data *us) 776 776 { 777 777 int result; 778 - static unsigned char inquiry_response[8] = { 778 + static const unsigned char inquiry_response[8] = { 779 779 0x00, 0x80, 0x00, 0x02, 0x1F, 0x00, 0x00, 0x00 780 780 }; 781 781 // write-protected for now, no block descriptor support 782 - static unsigned char mode_page_01[20] = { 782 + static const unsigned char mode_page_01[20] = { 783 783 0x0, 0x12, 0x00, 0x80, 0x0, 0x0, 0x0, 0x0, 784 784 0x01, 0x0A, 785 785 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00