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

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>

authored by

Jonathan Neuschäfer and committed by
Greg Kroah-Hartman
7a4dc560 403849c8

+5 -5
+5 -5
drivers/usb/storage/jumpshot.c
··· 367 367 struct scsi_cmnd * srb, 368 368 int sense_6) 369 369 { 370 - static unsigned char rw_err_page[12] = { 370 + static const unsigned char rw_err_page[12] = { 371 371 0x1, 0xA, 0x21, 1, 0, 0, 0, 0, 1, 0, 0, 0 372 372 }; 373 - static unsigned char cache_page[12] = { 373 + static const unsigned char cache_page[12] = { 374 374 0x8, 0xA, 0x1, 0, 0, 0, 0, 0, 0, 0, 0, 0 375 375 }; 376 - static unsigned char rbac_page[12] = { 376 + static const unsigned char rbac_page[12] = { 377 377 0x1B, 0xA, 0, 0x81, 0, 0, 0, 0, 0, 0, 0, 0 378 378 }; 379 - static unsigned char timer_page[8] = { 379 + static const unsigned char timer_page[8] = { 380 380 0x1C, 0x6, 0, 0, 0, 0 381 381 }; 382 382 unsigned char pc, page_code; ··· 477 477 int rc; 478 478 unsigned long block, blocks; 479 479 unsigned char *ptr = us->iobuf; 480 - static unsigned char inquiry_response[8] = { 480 + static const unsigned char inquiry_response[8] = { 481 481 0x00, 0x80, 0x00, 0x01, 0x1F, 0x00, 0x00, 0x00 482 482 }; 483 483