Skip to content

Commit 9dd3aa7

Browse files
neuschaefergregkh
authored andcommitted
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 <[email protected]> Reviewed-by: Alan Stern <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 5dc02c9 commit 9dd3aa7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/usb/storage/sddr55.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -775,11 +775,11 @@ static void sddr55_card_info_destructor(void *extra) {
775775
static int sddr55_transport(struct scsi_cmnd *srb, struct us_data *us)
776776
{
777777
int result;
778-
static unsigned char inquiry_response[8] = {
778+
static const unsigned char inquiry_response[8] = {
779779
0x00, 0x80, 0x00, 0x02, 0x1F, 0x00, 0x00, 0x00
780780
};
781781
// 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] = {
783783
0x0, 0x12, 0x00, 0x80, 0x0, 0x0, 0x0, 0x0,
784784
0x01, 0x0A,
785785
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00

0 commit comments

Comments
 (0)