Skip to contentSkip to conversation

media: gspca: make the read-only array table static const

PATCH New Colin Ian King 1 participant 1 message Mar 7, 2022

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

PATCH 1/1 media: gspca: make the read-only array table static const

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

---
 drivers/media/usb/gspca/spca561.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/usb/gspca/spca561.c +1 -1
index d608a518c141..431527ed602b 100644
@@ -510,7 +510,7 @@ static void setexposure(struct gspca_dev *gspca_dev, s32 val)
 	/* We choose to use the high bits setting the fixed framerate divisor
 	   asap, as setting high basic exposure setting without the fixed
 	   divider in combination with high gains makes the cam stop */
-	int table[] =  { 0, 450, 550, 625, EXPOSURE_MAX };
+	static const int table[] =  { 0, 450, 550, 625, EXPOSURE_MAX };
 
 	for (i = 0; i < ARRAY_SIZE(table) - 1; i++) {
 		if (val <= table[i + 1]) {
Signature · 1 line
2.35.1