From b8e9b36d2fc463d87f7b595fedf7ed7ae68dba1d Mon Sep 17 00:00:00 2001 From: Bhumika Goyal Date: Mon, 28 Aug 2017 03:42:09 -0400 Subject: media: pci: make i2c_client const Make these const as they are only used in a copy operation. Done using Coccinelle. Signed-off-by: Bhumika Goyal Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/pci/cx23885/cx23885-i2c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/pci/cx23885') diff --git a/drivers/media/pci/cx23885/cx23885-i2c.c b/drivers/media/pci/cx23885/cx23885-i2c.c index 0f21467ae88e..ef863492c0ac 100644 --- a/drivers/media/pci/cx23885/cx23885-i2c.c +++ b/drivers/media/pci/cx23885/cx23885-i2c.c @@ -270,7 +270,7 @@ static const struct i2c_adapter cx23885_i2c_adap_template = { .algo = &cx23885_i2c_algo_template, }; -static struct i2c_client cx23885_i2c_client_template = { +static const struct i2c_client cx23885_i2c_client_template = { .name = "cx23885 internal", }; -- cgit v1.2.3 From 601b1f0ac7fadbe90cc04c41a1cb31c7cd402fea Mon Sep 17 00:00:00 2001 From: Colin Ian King Date: Thu, 7 Sep 2017 05:50:23 -0400 Subject: media: cx23885: make const array buf static, reduces object code size Don't populate the array buf on the stack, instead make it static. Makes the object code smaller by over 240 bytes: Before: text data bss dec hex filename 21689 22992 416 45097 b029 cx23885-cards.o After: text data bss dec hex filename 21348 23088 416 44852 af34 cx23885-cards.o Signed-off-by: Colin Ian King Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/pci/cx23885/cx23885-cards.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/media/pci/cx23885') diff --git a/drivers/media/pci/cx23885/cx23885-cards.c b/drivers/media/pci/cx23885/cx23885-cards.c index 78a8836d03e4..28eab9c518c5 100644 --- a/drivers/media/pci/cx23885/cx23885-cards.c +++ b/drivers/media/pci/cx23885/cx23885-cards.c @@ -1323,7 +1323,7 @@ static void hauppauge_eeprom(struct cx23885_dev *dev, u8 *eeprom_data) static void tbs_card_init(struct cx23885_dev *dev) { int i; - const u8 buf[] = { + static const u8 buf[] = { 0xe0, 0x06, 0x66, 0x33, 0x65, 0x01, 0x17, 0x06, 0xde}; -- cgit v1.2.3 From 0e2d9a9d4aa55dc2d650f9c07069a0b149f02d04 Mon Sep 17 00:00:00 2001 From: Bhumika Goyal Date: Wed, 27 Sep 2017 18:59:06 +0200 Subject: media: cx23885/saa7134: 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/pci/cx23885/cx23885-vbi.c | 2 +- drivers/media/pci/cx23885/cx23885.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers/media/pci/cx23885') diff --git a/drivers/media/pci/cx23885/cx23885-vbi.c b/drivers/media/pci/cx23885/cx23885-vbi.c index 369e545cac04..70f9f13bded3 100644 --- a/drivers/media/pci/cx23885/cx23885-vbi.c +++ b/drivers/media/pci/cx23885/cx23885-vbi.c @@ -254,7 +254,7 @@ static void cx23885_stop_streaming(struct vb2_queue *q) } -struct vb2_ops cx23885_vbi_qops = { +const struct vb2_ops cx23885_vbi_qops = { .queue_setup = queue_setup, .buf_prepare = buffer_prepare, .buf_finish = buffer_finish, diff --git a/drivers/media/pci/cx23885/cx23885.h b/drivers/media/pci/cx23885/cx23885.h index cb714ab60d69..6aab713e0476 100644 --- a/drivers/media/pci/cx23885/cx23885.h +++ b/drivers/media/pci/cx23885/cx23885.h @@ -591,7 +591,7 @@ int cx23885_set_tvnorm(struct cx23885_dev *dev, v4l2_std_id norm); extern int cx23885_vbi_fmt(struct file *file, void *priv, struct v4l2_format *f); extern void cx23885_vbi_timeout(unsigned long data); -extern struct vb2_ops cx23885_vbi_qops; +extern const struct vb2_ops cx23885_vbi_qops; extern int cx23885_vbi_irq(struct cx23885_dev *dev, u32 status); /* cx23885-i2c.c */ -- cgit v1.2.3