From: "Jonathan Neuschäfer" <j.ne@posteo.net>
To: Alan Stern <stern@rowland.harvard.edu>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net,
linux-kernel@vger.kernel.org,
"Jonathan Neuschäfer" <j.ne@posteo.net>
Subject: [PATCH v2 3/9] usb: storage: alauda: Use const for card ID array
Date: Wed, 26 Feb 2025 15:17:25 +0100 [thread overview]
Message-ID: <20250226-misc-const-v2-3-ab655a4a29cc@posteo.net> (raw)
In-Reply-To: <20250226-misc-const-v2-0-ab655a4a29cc@posteo.net>
The alauda_card_ids array is only read, and not modified.
Signed-off-by: Jonathan Neuschäfer <j.ne@posteo.net>
---
V2:
- new patch
---
drivers/usb/storage/alauda.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/storage/alauda.c b/drivers/usb/storage/alauda.c
index 6263c4e61678e890e0192c5c9dad9b97dbaf0e66..e01f3a42bde4200da245c17abd5299c062868204 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<<zs blocks per zone */
};
-static struct alauda_card_info alauda_card_ids[] = {
+static const struct alauda_card_info alauda_card_ids[] = {
/* NAND flash */
{ 0x6e, 20, 8, 4, 8}, /* 1 MB */
{ 0xe8, 20, 8, 4, 8}, /* 1 MB */
@@ -200,7 +200,7 @@ static struct alauda_card_info alauda_card_ids[] = {
{ 0,}
};
-static struct alauda_card_info *alauda_card_find_id(unsigned char id)
+static const struct alauda_card_info *alauda_card_find_id(unsigned char id)
{
int i;
@@ -383,7 +383,7 @@ static int alauda_init_media(struct us_data *us)
{
unsigned char *data = us->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
};
--
2.48.0.rc1.219.gb6b6757d772
WARNING: multiple messages have this Message-ID (diff)
From: "Jonathan Neuschäfer via B4 Relay" <devnull+j.ne.posteo.net@kernel.org>
To: Alan Stern <stern@rowland.harvard.edu>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org, usb-storage@lists.one-eyed-alien.net,
linux-kernel@vger.kernel.org,
"Jonathan Neuschäfer" <j.ne@posteo.net>
Subject: [PATCH v2 3/9] usb: storage: alauda: Use const for card ID array
Date: Wed, 26 Feb 2025 15:17:25 +0100 [thread overview]
Message-ID: <20250226-misc-const-v2-3-ab655a4a29cc@posteo.net> (raw)
In-Reply-To: <20250226-misc-const-v2-0-ab655a4a29cc@posteo.net>
From: Jonathan Neuschäfer <j.ne@posteo.net>
The alauda_card_ids array is only read, and not modified.
Signed-off-by: Jonathan Neuschäfer <j.ne@posteo.net>
---
V2:
- new patch
---
drivers/usb/storage/alauda.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/storage/alauda.c b/drivers/usb/storage/alauda.c
index 6263c4e61678e890e0192c5c9dad9b97dbaf0e66..e01f3a42bde4200da245c17abd5299c062868204 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<<zs blocks per zone */
};
-static struct alauda_card_info alauda_card_ids[] = {
+static const struct alauda_card_info alauda_card_ids[] = {
/* NAND flash */
{ 0x6e, 20, 8, 4, 8}, /* 1 MB */
{ 0xe8, 20, 8, 4, 8}, /* 1 MB */
@@ -200,7 +200,7 @@ static struct alauda_card_info alauda_card_ids[] = {
{ 0,}
};
-static struct alauda_card_info *alauda_card_find_id(unsigned char id)
+static const struct alauda_card_info *alauda_card_find_id(unsigned char id)
{
int i;
@@ -383,7 +383,7 @@ static int alauda_init_media(struct us_data *us)
{
unsigned char *data = us->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
};
--
2.48.0.rc1.219.gb6b6757d772
next prev parent reply other threads:[~2025-02-26 14:17 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-26 14:17 [PATCH v2 0/9] usb: storage: Mark various arrays as const Jonathan Neuschäfer
2025-02-26 14:17 ` Jonathan Neuschäfer via B4 Relay
2025-02-26 14:17 ` [PATCH v2 1/9] usb: storage: jumpshot: Use const for constant arrays Jonathan Neuschäfer
2025-02-26 14:17 ` Jonathan Neuschäfer via B4 Relay
2025-02-26 14:17 ` [PATCH v2 2/9] usb: storage: transport: Use const for constant array Jonathan Neuschäfer
2025-02-26 14:17 ` Jonathan Neuschäfer via B4 Relay
2025-02-26 14:17 ` Jonathan Neuschäfer [this message]
2025-02-26 14:17 ` [PATCH v2 3/9] usb: storage: alauda: Use const for card ID array Jonathan Neuschäfer via B4 Relay
2025-02-26 14:17 ` [PATCH v2 4/9] usb: storage: datafab: Use const for constant arrays Jonathan Neuschäfer
2025-02-26 14:17 ` Jonathan Neuschäfer via B4 Relay
2025-02-26 14:17 ` [PATCH v2 5/9] usb: storage: initializers: Use const for constant array Jonathan Neuschäfer
2025-02-26 14:17 ` Jonathan Neuschäfer via B4 Relay
2025-02-26 14:17 ` [PATCH v2 6/9] usb: storage: realtek_cr: Use const for constant arrays Jonathan Neuschäfer
2025-02-26 14:17 ` Jonathan Neuschäfer via B4 Relay
2025-02-26 14:17 ` [PATCH v2 7/9] usb: storage: sddr09: " Jonathan Neuschäfer
2025-02-26 14:17 ` Jonathan Neuschäfer via B4 Relay
2025-02-26 14:17 ` [PATCH v2 8/9] usb: storage: sddr55: " Jonathan Neuschäfer
2025-02-26 14:17 ` Jonathan Neuschäfer via B4 Relay
2025-02-26 14:17 ` [PATCH v2 9/9] usb: storage: shuttle_usbat: Use const for constant array Jonathan Neuschäfer
2025-02-26 14:17 ` Jonathan Neuschäfer via B4 Relay
2025-02-26 17:02 ` [PATCH v2 0/9] usb: storage: Mark various arrays as const Alan Stern
2025-02-26 17:43 ` J. Neuschäfer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250226-misc-const-v2-3-ab655a4a29cc@posteo.net \
--to=j.ne@posteo.net \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=stern@rowland.harvard.edu \
--cc=usb-storage@lists.one-eyed-alien.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.