From 971e8298dee4835fc2dfbd207a9786702aa01666 Mon Sep 17 00:00:00 2001 From: Mauro Carvalho Chehab Date: Mon, 14 Dec 2009 13:53:37 -0300 Subject: V4L/DVB (13680): ir: use unsigned long instead of enum When preparing the linux-next patches, I got those errors: include/media/ir-core.h:29: warning: left shift count >= width of type In file included from include/media/ir-common.h:29, from drivers/media/video/ir-kbd-i2c.c:50: drivers/media/video/ir-kbd-i2c.c: In function ‘ir_probe’: drivers/media/video/ir-kbd-i2c.c:324: warning: left shift count >= width of type Unfortunately, enum is 32 bits on i386. As we define IR_TYPE_OTHER as 1<<63, it won't work on non 64 bits arch. Signed-off-by: Mauro Carvalho Chehab --- drivers/media/IR/ir-functions.c | 2 +- drivers/media/IR/ir-sysfs.c | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'drivers/media/IR') diff --git a/drivers/media/IR/ir-functions.c b/drivers/media/IR/ir-functions.c index b501ac9d401d..ab06919ad5fc 100644 --- a/drivers/media/IR/ir-functions.c +++ b/drivers/media/IR/ir-functions.c @@ -52,7 +52,7 @@ static void ir_input_key_event(struct input_dev *dev, struct ir_input_state *ir) /* -------------------------------------------------------------------------- */ int ir_input_init(struct input_dev *dev, struct ir_input_state *ir, - const enum ir_type ir_type) + const u64 ir_type) { ir->ir_type = ir_type; diff --git a/drivers/media/IR/ir-sysfs.c b/drivers/media/IR/ir-sysfs.c index d73589ad55e6..d67c11d9921f 100644 --- a/drivers/media/IR/ir-sysfs.c +++ b/drivers/media/IR/ir-sysfs.c @@ -39,9 +39,9 @@ static ssize_t show_protocol(struct device *d, { char *s; struct ir_input_dev *ir_dev = dev_get_drvdata(d); - enum ir_type ir_type = ir_dev->rc_tab.ir_type; + u64 ir_type = ir_dev->rc_tab.ir_type; - IR_dprintk(1, "Current protocol is %ld\n", ir_type); + IR_dprintk(1, "Current protocol is %lld\n", (long long)ir_type); /* FIXME: doesn't support multiple protocols at the same time */ if (ir_type == IR_TYPE_UNKNOWN) @@ -77,7 +77,7 @@ static ssize_t store_protocol(struct device *d, size_t len) { struct ir_input_dev *ir_dev = dev_get_drvdata(d); - enum ir_type ir_type = IR_TYPE_UNKNOWN; + u64 ir_type = IR_TYPE_UNKNOWN; int rc = -EINVAL; unsigned long flags; char *buf; @@ -92,7 +92,8 @@ static ssize_t store_protocol(struct device *d, ir_type = IR_TYPE_NEC; if (ir_type == IR_TYPE_UNKNOWN) { - IR_dprintk(1, "Error setting protocol to %ld\n", ir_type); + IR_dprintk(1, "Error setting protocol to %lld\n", + (long long)ir_type); return -EINVAL; } @@ -101,7 +102,8 @@ static ssize_t store_protocol(struct device *d, ir_type); if (rc < 0) { - IR_dprintk(1, "Error setting protocol to %ld\n", ir_type); + IR_dprintk(1, "Error setting protocol to %lld\n", + (long long)ir_type); return -EINVAL; } @@ -109,7 +111,8 @@ static ssize_t store_protocol(struct device *d, ir_dev->rc_tab.ir_type = ir_type; spin_unlock_irqrestore(&ir_dev->rc_tab.lock, flags); - IR_dprintk(1, "Current protocol is %ld\n", ir_type); + IR_dprintk(1, "Current protocol is %lld\n", + (long long)ir_type); return len; } -- cgit v1.2.3