summaryrefslogtreecommitdiffstats
path: root/drivers/media/pci
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2018-08-21 15:57:52 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-10-04 14:22:27 -0400
commit183e19f5b9ee18fc7bc4b3983a91b5d0dd6c7871 (patch)
tree590ad6faa92cfc230d2a3527f585d7f4d728c217 /drivers/media/pci
parentc5f14af0d8b63a62dfde7ade372da0038507deeb (diff)
downloadlinux-183e19f5b9ee18fc7bc4b3983a91b5d0dd6c7871.tar.bz2
media: rc: Remove init_ir_raw_event and DEFINE_IR_RAW_EVENT macros
This can be done with c99 initializers, which makes the code cleaner and more transparent. It does require gcc 4.6, because of this bug in earlier versions: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=10676 Since commit cafa0010cd51 ("Raise the minimum required gcc version to 4.6"), this is the case. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers/media/pci')
-rw-r--r--drivers/media/pci/cx23885/cx23888-ir.c6
-rw-r--r--drivers/media/pci/cx88/cx88-input.c3
2 files changed, 3 insertions, 6 deletions
diff --git a/drivers/media/pci/cx23885/cx23888-ir.c b/drivers/media/pci/cx23885/cx23888-ir.c
index 00329f668b59..1d775c90df51 100644
--- a/drivers/media/pci/cx23885/cx23888-ir.c
+++ b/drivers/media/pci/cx23885/cx23888-ir.c
@@ -696,10 +696,8 @@ static int cx23888_ir_rx_read(struct v4l2_subdev *sd, u8 *buf, size_t count,
if (v > IR_MAX_DURATION)
v = IR_MAX_DURATION;
- init_ir_raw_event(&p->ir_core_data);
- p->ir_core_data.pulse = u;
- p->ir_core_data.duration = v;
- p->ir_core_data.timeout = w;
+ p->ir_core_data = (struct ir_raw_event)
+ { .pulse = u, .duration = v, .timeout = w };
v4l2_dbg(2, ir_888_debug, sd, "rx read: %10u ns %s %s\n",
v, u ? "mark" : "space", w ? "(timed out)" : "");
diff --git a/drivers/media/pci/cx88/cx88-input.c b/drivers/media/pci/cx88/cx88-input.c
index c5cee71d744d..ca76da04b476 100644
--- a/drivers/media/pci/cx88/cx88-input.c
+++ b/drivers/media/pci/cx88/cx88-input.c
@@ -535,7 +535,7 @@ void cx88_ir_irq(struct cx88_core *core)
struct cx88_IR *ir = core->ir;
u32 samples;
unsigned int todo, bits;
- struct ir_raw_event ev;
+ struct ir_raw_event ev = {};
if (!ir || !ir->sampling)
return;
@@ -550,7 +550,6 @@ void cx88_ir_irq(struct cx88_core *core)
if (samples == 0xff && ir->dev->idle)
return;
- init_ir_raw_event(&ev);
for (todo = 32; todo > 0; todo -= bits) {
ev.pulse = samples & 0x80000000 ? false : true;
bits = min(todo, 32U - fls(ev.pulse ? samples : ~samples));