Skip to contentSkip to conversation

pcmcia: rsrc_nonstatic: make static read-only array order const

PATCH In review Colin Ian King 2 participants 2 messages Jan 23, 2022 – Feb 5, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 pcmcia: rsrc_nonstatic: make static read-only array order const

The static array is order read-only so it make sense to make it const.

---
 drivers/pcmcia/rsrc_nonstatic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pcmcia/rsrc_nonstatic.c +1 -1
index 6b6c578b5f92..bde377655d48 100644
@@ -480,7 +480,7 @@ static u_long inv_probe(struct resource_map *m, struct pcmcia_socket *s)
 static int validate_mem(struct pcmcia_socket *s, unsigned int probe_mask)
 {
 	struct resource_map *m, mm;
-	static unsigned char order[] = { 0xd0, 0xe0, 0xc0, 0xf0 };
+	static const unsigned char order[] = { 0xd0, 0xe0, 0xc0, 0xf0 };
 	unsigned long b, i, ok = 0;
 	struct socket_data *s_data = s->resource_data;
 
Signature · 1 line
2.33.1
#1 lore raw

Am Sun, Jan 23, 2022 at 11:34:03PM +0000 schrieb Colin Ian King:

Quoted 4 lines

The static array is order read-only so it make sense to make it const.

If it's read-only, it doesn't need to be static, right? Could you update the patch and replace the static with const, please?

Thanks,
Dominik