]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
usb: storage: shuttle_usbat: Use const for constant array
authorJonathan Neuschäfer <j.ne@posteo.net>
Fri, 28 Feb 2025 15:11:24 +0000 (16:11 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Mar 2025 09:24:41 +0000 (10:24 +0100)
This array is 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-9-09b417ded9c4@posteo.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/storage/shuttle_usbat.c

index c33cbf177e6fcaa80e0d2639594d1314c59f4950..27faa0ead11d1b0ee9e45ba6a3ee5bade8a416e4 100644 (file)
@@ -1683,7 +1683,7 @@ static int usbat_flash_transport(struct scsi_cmnd * srb, struct us_data *us)
        struct usbat_info *info = (struct usbat_info *) (us->extra);
        unsigned long block, blocks;
        unsigned char *ptr = us->iobuf;
-       static unsigned char inquiry_response[36] = {
+       static const unsigned char inquiry_response[36] = {
                0x00, 0x80, 0x00, 0x01, 0x1F, 0x00, 0x00, 0x00
        };