aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Neuschäfer <j.ne@posteo.net>2025-02-28 16:11:16 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-03-03 10:24:41 +0100
commit7a4dc56023651f00a8d5e30ec84ec2a12294b8c8 (patch)
tree86f215800676fc542d4d6ec655168ea192665415
parentucsi_ccg: Don't show non-functional attributes (diff)
downloadlinux-rng-7a4dc56023651f00a8d5e30ec84ec2a12294b8c8.tar.xz
linux-rng-7a4dc56023651f00a8d5e30ec84ec2a12294b8c8.zip
usb: storage: jumpshot: Use const for constant arrays
These arrays are not modified. Make them const. 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-1-09b417ded9c4@posteo.net Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/storage/jumpshot.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/usb/storage/jumpshot.c b/drivers/usb/storage/jumpshot.c
index 39ca84d68591..089c6f8ac85f 100644
--- a/drivers/usb/storage/jumpshot.c
+++ b/drivers/usb/storage/jumpshot.c
@@ -367,16 +367,16 @@ static int jumpshot_handle_mode_sense(struct us_data *us,
struct scsi_cmnd * srb,
int sense_6)
{
- static unsigned char rw_err_page[12] = {
+ static const unsigned char rw_err_page[12] = {
0x1, 0xA, 0x21, 1, 0, 0, 0, 0, 1, 0, 0, 0
};
- static unsigned char cache_page[12] = {
+ static const unsigned char cache_page[12] = {
0x8, 0xA, 0x1, 0, 0, 0, 0, 0, 0, 0, 0, 0
};
- static unsigned char rbac_page[12] = {
+ static const unsigned char rbac_page[12] = {
0x1B, 0xA, 0, 0x81, 0, 0, 0, 0, 0, 0, 0, 0
};
- static unsigned char timer_page[8] = {
+ static const unsigned char timer_page[8] = {
0x1C, 0x6, 0, 0, 0, 0
};
unsigned char pc, page_code;
@@ -477,7 +477,7 @@ static int jumpshot_transport(struct scsi_cmnd *srb, struct us_data *us)
int rc;
unsigned long block, blocks;
unsigned char *ptr = us->iobuf;
- static unsigned char inquiry_response[8] = {
+ static const unsigned char inquiry_response[8] = {
0x00, 0x80, 0x00, 0x01, 0x1F, 0x00, 0x00, 0x00
};