summaryrefslogtreecommitdiff
path: root/drivers/media/rc/streamzap.c
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2018-08-21 22:57:52 +0300
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-10-04 21:22:27 +0300
commit183e19f5b9ee18fc7bc4b3983a91b5d0dd6c7871 (patch)
tree590ad6faa92cfc230d2a3527f585d7f4d728c217 /drivers/media/rc/streamzap.c
parentc5f14af0d8b63a62dfde7ade372da0038507deeb (diff)
downloadlinux-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/streamzap.c')
-rw-r--r--drivers/media/rc/streamzap.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/media/rc/streamzap.c b/drivers/media/rc/streamzap.c
index c3e183aabfbe..a490d26bd170 100644
--- a/drivers/media/rc/streamzap.c
+++ b/drivers/media/rc/streamzap.c
@@ -130,7 +130,7 @@ static void sz_push(struct streamzap_ir *sz, struct ir_raw_event rawir)
static void sz_push_full_pulse(struct streamzap_ir *sz,
unsigned char value)
{
- DEFINE_IR_RAW_EVENT(rawir);
+ struct ir_raw_event rawir = {};
if (sz->idle) {
int delta;
@@ -175,7 +175,7 @@ static void sz_push_half_pulse(struct streamzap_ir *sz,
static void sz_push_full_space(struct streamzap_ir *sz,
unsigned char value)
{
- DEFINE_IR_RAW_EVENT(rawir);
+ struct ir_raw_event rawir = {};
rawir.pulse = false;
rawir.duration = ((int) value) * SZ_RESOLUTION;
@@ -249,10 +249,10 @@ static void streamzap_callback(struct urb *urb)
break;
case FullSpace:
if (sz->buf_in[i] == SZ_TIMEOUT) {
- DEFINE_IR_RAW_EVENT(rawir);
-
- rawir.pulse = false;
- rawir.duration = sz->rdev->timeout;
+ struct ir_raw_event rawir = {
+ .pulse = false,
+ .duration = sz->rdev->timeout
+ };
sz->idle = true;
if (sz->timeout_enabled)
sz_push(sz, rawir);