From 2b83247f3e4a40c767dcbc149b7ad544e2e6c002 Mon Sep 17 00:00:00 2001 From: Bhumika Goyal Date: Mon, 28 Aug 2017 03:21:35 -0400 Subject: media: usb: make i2c_client const Make these const as they are only used in a copy operation. Done using Coccinelle. @match disable optional_qualifier@ identifier s; @@ static struct i2c_client s = {...}; @ref@ position p; identifier match.s; @@ s@p @good1@ position ref.p; identifier match.s,f,c; expression e; @@ ( e = s@p | e = s@p.f | c(...,s@p.f,...) | c(...,s@p,...) ) @bad depends on !good1@ position ref.p; identifier match.s; @@ s@p @depends on forall !bad disable optional_qualifier@ identifier match.s; @@ static + const struct i2c_client s; Signed-off-by: Bhumika Goyal Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/usb/au0828/au0828-i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/usb/au0828') diff --git a/drivers/media/usb/au0828/au0828-i2c.c b/drivers/media/usb/au0828/au0828-i2c.c index ef7d1b830ca3..1b8ec5d9e7ab 100644 --- a/drivers/media/usb/au0828/au0828-i2c.c +++ b/drivers/media/usb/au0828/au0828-i2c.c @@ -342,7 +342,7 @@ static const struct i2c_adapter au0828_i2c_adap_template = { .algo = &au0828_i2c_algo_template, }; -static struct i2c_client au0828_i2c_client_template = { +static const struct i2c_client au0828_i2c_client_template = { .name = "au0828 internal", }; -- cgit From ac71484e89461a22d89ac84fcdc0235bf0a3e011 Mon Sep 17 00:00:00 2001 From: Bhumika Goyal Date: Wed, 27 Sep 2017 19:08:19 +0200 Subject: media: au0828/em28xx: make vb2_ops const Make vb2_ops const as they are only stored in the const field of a vb2_queue structure. Make the declarations const too. Done using Coccinelle. Signed-off-by: Bhumika Goyal Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/usb/au0828/au0828-vbi.c | 2 +- drivers/media/usb/au0828/au0828.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/media/usb/au0828') diff --git a/drivers/media/usb/au0828/au0828-vbi.c b/drivers/media/usb/au0828/au0828-vbi.c index e0930ce59b8d..9dd6bdb7304f 100644 --- a/drivers/media/usb/au0828/au0828-vbi.c +++ b/drivers/media/usb/au0828/au0828-vbi.c @@ -79,7 +79,7 @@ vbi_buffer_queue(struct vb2_buffer *vb) spin_unlock_irqrestore(&dev->slock, flags); } -struct vb2_ops au0828_vbi_qops = { +const struct vb2_ops au0828_vbi_qops = { .queue_setup = vbi_queue_setup, .buf_prepare = vbi_buffer_prepare, .buf_queue = vbi_buffer_queue, diff --git a/drivers/media/usb/au0828/au0828.h b/drivers/media/usb/au0828/au0828.h index 05e445fe0b77..f6f37e8ef51d 100644 --- a/drivers/media/usb/au0828/au0828.h +++ b/drivers/media/usb/au0828/au0828.h @@ -358,7 +358,7 @@ void au0828_dvb_suspend(struct au0828_dev *dev); void au0828_dvb_resume(struct au0828_dev *dev); /* au0828-vbi.c */ -extern struct vb2_ops au0828_vbi_qops; +extern const struct vb2_ops au0828_vbi_qops; #define dprintk(level, fmt, arg...)\ do { if (au0828_debug & level)\ -- cgit From b436e26e484d259e0b658d558eb99b7ab004e997 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Thu, 2 Nov 2017 06:11:53 -0400 Subject: media: usb: fix spelling mistake: "synchronuously" -> "synchronously" Trivial fix to spelling mistake in error message text [mchehab@s-opensource.org: folded all similar patches into one] Signed-off-by: Colin Ian King Signed-off-by: Mauro Carvalho Chehab --- drivers/media/usb/au0828/au0828-video.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/media/usb/au0828') diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c index 9342402b92f7..654f67c25863 100644 --- a/drivers/media/usb/au0828/au0828-video.c +++ b/drivers/media/usb/au0828/au0828-video.c @@ -67,10 +67,10 @@ static inline void print_err_status(struct au0828_dev *dev, switch (status) { case -ENOENT: - errmsg = "unlinked synchronuously"; + errmsg = "unlinked synchronously"; break; case -ECONNRESET: - errmsg = "unlinked asynchronuously"; + errmsg = "unlinked asynchronously"; break; case -ENOSR: errmsg = "Buffer error (overrun)"; -- cgit From 213bc75a750363879792fd3793be8007a56ac477 Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Thu, 2 Nov 2017 13:26:48 -0400 Subject: media: au0828: make const array addr_list static Don't populate array addr_list on the stack but instead make it static. Makes the object code smaller by over 360 bytes: Before: text data bss dec hex filename 8036 1488 192 9716 25f4 au0828-input.o After: text data bss dec hex filename 7696 1488 192 9376 24a0 au0828-input.o (gcc version 7.2.0 x86_64) Signed-off-by: Colin Ian King Signed-off-by: Mauro Carvalho Chehab --- drivers/media/usb/au0828/au0828-input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/usb/au0828') diff --git a/drivers/media/usb/au0828/au0828-input.c b/drivers/media/usb/au0828/au0828-input.c index 7996eb83a54e..af68afe085b5 100644 --- a/drivers/media/usb/au0828/au0828-input.c +++ b/drivers/media/usb/au0828/au0828-input.c @@ -269,7 +269,7 @@ static void au0828_rc_stop(struct rc_dev *rc) static int au0828_probe_i2c_ir(struct au0828_dev *dev) { int i = 0; - const unsigned short addr_list[] = { + static const unsigned short addr_list[] = { 0x47, I2C_CLIENT_END }; -- cgit