* [PATCH] media: gspca: make array regs_to_read static const
@ 2022-01-09 20:45 Colin Ian King
0 siblings, 0 replies; only message in thread
From: Colin Ian King @ 2022-01-09 20:45 UTC (permalink / raw)
To: Hans Verkuil, Mauro Carvalho Chehab, linux-media
Cc: kernel-janitors, linux-kernel
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.
Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
---
drivers/media/usb/gspca/jl2005bcd.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/media/usb/gspca/jl2005bcd.c b/drivers/media/usb/gspca/jl2005bcd.c
index ca12f33f3e12..a408fcc3a060 100644
--- a/drivers/media/usb/gspca/jl2005bcd.c
+++ b/drivers/media/usb/gspca/jl2005bcd.c
@@ -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 */
--
2.32.0
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-01-09 20:48 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-09 20:45 [PATCH] media: gspca: make array regs_to_read static const Colin Ian King
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome