diff options
author | Sean Young <sean@mess.org> | 2018-08-21 22:57:52 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2018-10-04 21:22:27 +0300 |
commit | 183e19f5b9ee18fc7bc4b3983a91b5d0dd6c7871 (patch) | |
tree | 590ad6faa92cfc230d2a3527f585d7f4d728c217 /drivers/media/rc/mceusb.c | |
parent | c5f14af0d8b63a62dfde7ade372da0038507deeb (diff) | |
download | linux-183e19f5b9ee18fc7bc4b3983a91b5d0dd6c7871.tar.xz |
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/mceusb.c')
-rw-r--r-- | drivers/media/rc/mceusb.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index 7f0fc3e12190..c9293696dc2d 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c @@ -1078,7 +1078,7 @@ static int mceusb_set_rx_carrier_report(struct rc_dev *dev, int enable) */ static void mceusb_handle_command(struct mceusb_dev *ir, int index) { - DEFINE_IR_RAW_EVENT(rawir); + struct ir_raw_event rawir = {}; u8 hi = ir->buf_in[index + 1] & 0xff; u8 lo = ir->buf_in[index + 2] & 0xff; u32 carrier_cycles; @@ -1152,7 +1152,7 @@ static void mceusb_handle_command(struct mceusb_dev *ir, int index) static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len) { - DEFINE_IR_RAW_EVENT(rawir); + struct ir_raw_event rawir = {}; bool event = false; int i = 0; @@ -1175,7 +1175,6 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len) break; case PARSE_IRDATA: ir->rem--; - init_ir_raw_event(&rawir); rawir.pulse = ((ir->buf_in[i] & MCE_PULSE_BIT) != 0); rawir.duration = (ir->buf_in[i] & MCE_PULSE_MASK); if (unlikely(!rawir.duration)) { @@ -1215,11 +1214,13 @@ static void mceusb_process_ir_data(struct mceusb_dev *ir, int buf_len) if (ir->rem) { ir->parser_state = PARSE_IRDATA; } else { - init_ir_raw_event(&rawir); - rawir.timeout = 1; - rawir.duration = ir->rc->timeout; + struct ir_raw_event ev = { + .timeout = 1, + .duration = ir->rc->timeout + }; + if (ir_raw_event_store_with_filter(ir->rc, - &rawir)) + &ev)) event = true; ir->pulse_tunit = 0; ir->pulse_count = 0; |