[PATCH v2 2/9] usb: storage: transport: Use const for constant array

From: Jonathan Neuschäfer via B4 Relay
Date: Wed Feb 26 2025 - 09:17:55 EST


From: Jonathan Neuschäfer <j.ne@xxxxxxxxxx>

This array is only read, not modified

Signed-off-by: Jonathan Neuschäfer <j.ne@xxxxxxxxxx>
---

V2:
- new patch
---
drivers/usb/storage/transport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/storage/transport.c b/drivers/usb/storage/transport.c
index e6bc8ecaecbb202714be69c6db6b0a4824de4855..1aa1bd26c81f2f9fbd508fdfed4465e6482bdef0 100644
--- a/drivers/usb/storage/transport.c
+++ b/drivers/usb/storage/transport.c
@@ -528,7 +528,7 @@ static void last_sector_hacks(struct us_data *us, struct scsi_cmnd *srb)
u32 sector;

/* To Report "Medium Error: Record Not Found */
- static unsigned char record_not_found[18] = {
+ static const unsigned char record_not_found[18] = {
[0] = 0x70, /* current error */
[2] = MEDIUM_ERROR, /* = 0x03 */
[7] = 0x0a, /* additional length */

--
2.48.0.rc1.219.gb6b6757d772