From: Jonathan Neuschäfer Date: Fri, 28 Feb 2025 15:11:18 +0000 (+0100) Subject: usb: storage: alauda: Use const for card ID array X-Git-Tag: v6.15-rc1~46^2~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=734b0a7a5d857b5c0b98ccbb857406d4d531d574;p=thirdparty%2Fkernel%2Flinux.git usb: storage: alauda: Use const for card ID array The alauda_card_ids array is only read, and 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 Reviewed-by: Alan Stern Link: https://lore.kernel.org/r/20250228-misc-const-v3-3-09b417ded9c4@posteo.net Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/storage/alauda.c b/drivers/usb/storage/alauda.c index 6263c4e61678e..e01f3a42bde42 100644 --- a/drivers/usb/storage/alauda.c +++ b/drivers/usb/storage/alauda.c @@ -174,7 +174,7 @@ struct alauda_card_info { unsigned char zoneshift; /* 1<iobuf; int ready = 0; - struct alauda_card_info *media_info; + const struct alauda_card_info *media_info; unsigned int num_zones; while (ready == 0) { @@ -1132,7 +1132,7 @@ static int alauda_transport(struct scsi_cmnd *srb, struct us_data *us) int rc; struct alauda_info *info = (struct alauda_info *) us->extra; 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 };