diff options
author | Sean Young <sean@mess.org> | 2018-08-21 21:57:52 +0200 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-10-04 20:22:27 +0200 |
commit | 183e19f5b9ee18fc7bc4b3983a91b5d0dd6c7871 (patch) | |
tree | 590ad6faa92cfc230d2a3527f585d7f4d728c217 /drivers/media/rc/rc-ir-raw.c | |
parent | media: rc: nec keymaps should specify the nec variant they use (diff) | |
download | linux-183e19f5b9ee18fc7bc4b3983a91b5d0dd6c7871.tar.xz linux-183e19f5b9ee18fc7bc4b3983a91b5d0dd6c7871.zip |
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/rc/rc-ir-raw.c')
-rw-r--r-- | drivers/media/rc/rc-ir-raw.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/media/rc/rc-ir-raw.c b/drivers/media/rc/rc-ir-raw.c index e7948908e78c..e10b4644a442 100644 --- a/drivers/media/rc/rc-ir-raw.c +++ b/drivers/media/rc/rc-ir-raw.c @@ -102,7 +102,7 @@ EXPORT_SYMBOL_GPL(ir_raw_event_store); int ir_raw_event_store_edge(struct rc_dev *dev, bool pulse) { ktime_t now; - DEFINE_IR_RAW_EVENT(ev); + struct ir_raw_event ev = {}; if (!dev->raw) return -EINVAL; @@ -210,7 +210,7 @@ void ir_raw_event_set_idle(struct rc_dev *dev, bool idle) if (idle) { dev->raw->this_ev.timeout = true; ir_raw_event_store(dev, &dev->raw->this_ev); - init_ir_raw_event(&dev->raw->this_ev); + dev->raw->this_ev = (struct ir_raw_event) {}; } if (dev->s_idle) @@ -562,10 +562,10 @@ static void ir_raw_edge_handle(struct timer_list *t) spin_lock_irqsave(&dev->raw->edge_spinlock, flags); interval = ktime_sub(ktime_get(), dev->raw->last_event); if (ktime_to_ns(interval) >= dev->timeout) { - DEFINE_IR_RAW_EVENT(ev); - - ev.timeout = true; - ev.duration = ktime_to_ns(interval); + struct ir_raw_event ev = { + .timeout = true, + .duration = ktime_to_ns(interval) + }; ir_raw_event_store(dev, &ev); } else { |