Skip to contentSkip to conversation

media: gspca: make array regs_to_read static const

PATCH New Colin Ian King 1 participant 1 message Jan 9, 2022

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

PATCH 1/1 media: gspca: make array regs_to_read static const

Don't populate the read-only array regs_to_read on the stack but instead it static const. Also makes the object code a little smaller.

---
 drivers/media/usb/gspca/jl2005bcd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/media/usb/gspca/jl2005bcd.c +3 -1
index ca12f33f3e12..a408fcc3a060 100644
@@ -166,7 +166,9 @@ static int jl2005c_get_firmware_id(struct gspca_dev *gspca_dev)
 	struct sd *sd = (struct sd *)gspca_dev;
 	int i = 0;
 	int retval;
-	unsigned char regs_to_read[] = {0x57, 0x02, 0x03, 0x5d, 0x5e, 0x5f};
+	static const unsigned char regs_to_read[] = {
+		0x57, 0x02, 0x03, 0x5d, 0x5e, 0x5f
+	};
 
 	gspca_dbg(gspca_dev, D_PROBE, "Running jl2005c_get_firmware_id\n");
 	/* Read the first ID byte once for warmup */
Signature · 1 line
2.32.0