diff options
author | Mauro Carvalho Chehab <mchehab@redhat.com> | 2009-12-14 11:53:37 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2010-02-26 13:10:24 -0500 |
commit | 971e8298dee4835fc2dfbd207a9786702aa01666 (patch) | |
tree | be01801dd5631acc72eae7c16abbf1b834c66775 /drivers/media/IR/ir-sysfs.c | |
parent | 3f831107ed8efc32960e0cd172799bb82f6c81c9 (diff) |
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 <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/IR/ir-sysfs.c')
-rw-r--r-- | drivers/media/IR/ir-sysfs.c | 15 |
1 files changed, 9 insertions, 6 deletions
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, | |||
39 | { | 39 | { |
40 | char *s; | 40 | char *s; |
41 | struct ir_input_dev *ir_dev = dev_get_drvdata(d); | 41 | struct ir_input_dev *ir_dev = dev_get_drvdata(d); |
42 | enum ir_type ir_type = ir_dev->rc_tab.ir_type; | 42 | u64 ir_type = ir_dev->rc_tab.ir_type; |
43 | 43 | ||
44 | IR_dprintk(1, "Current protocol is %ld\n", ir_type); | 44 | IR_dprintk(1, "Current protocol is %lld\n", (long long)ir_type); |
45 | 45 | ||
46 | /* FIXME: doesn't support multiple protocols at the same time */ | 46 | /* FIXME: doesn't support multiple protocols at the same time */ |
47 | if (ir_type == IR_TYPE_UNKNOWN) | 47 | if (ir_type == IR_TYPE_UNKNOWN) |
@@ -77,7 +77,7 @@ static ssize_t store_protocol(struct device *d, | |||
77 | size_t len) | 77 | size_t len) |
78 | { | 78 | { |
79 | struct ir_input_dev *ir_dev = dev_get_drvdata(d); | 79 | struct ir_input_dev *ir_dev = dev_get_drvdata(d); |
80 | enum ir_type ir_type = IR_TYPE_UNKNOWN; | 80 | u64 ir_type = IR_TYPE_UNKNOWN; |
81 | int rc = -EINVAL; | 81 | int rc = -EINVAL; |
82 | unsigned long flags; | 82 | unsigned long flags; |
83 | char *buf; | 83 | char *buf; |
@@ -92,7 +92,8 @@ static ssize_t store_protocol(struct device *d, | |||
92 | ir_type = IR_TYPE_NEC; | 92 | ir_type = IR_TYPE_NEC; |
93 | 93 | ||
94 | if (ir_type == IR_TYPE_UNKNOWN) { | 94 | if (ir_type == IR_TYPE_UNKNOWN) { |
95 | IR_dprintk(1, "Error setting protocol to %ld\n", ir_type); | 95 | IR_dprintk(1, "Error setting protocol to %lld\n", |
96 | (long long)ir_type); | ||
96 | return -EINVAL; | 97 | return -EINVAL; |
97 | } | 98 | } |
98 | 99 | ||
@@ -101,7 +102,8 @@ static ssize_t store_protocol(struct device *d, | |||
101 | ir_type); | 102 | ir_type); |
102 | 103 | ||
103 | if (rc < 0) { | 104 | if (rc < 0) { |
104 | IR_dprintk(1, "Error setting protocol to %ld\n", ir_type); | 105 | IR_dprintk(1, "Error setting protocol to %lld\n", |
106 | (long long)ir_type); | ||
105 | return -EINVAL; | 107 | return -EINVAL; |
106 | } | 108 | } |
107 | 109 | ||
@@ -109,7 +111,8 @@ static ssize_t store_protocol(struct device *d, | |||
109 | ir_dev->rc_tab.ir_type = ir_type; | 111 | ir_dev->rc_tab.ir_type = ir_type; |
110 | spin_unlock_irqrestore(&ir_dev->rc_tab.lock, flags); | 112 | spin_unlock_irqrestore(&ir_dev->rc_tab.lock, flags); |
111 | 113 | ||
112 | IR_dprintk(1, "Current protocol is %ld\n", ir_type); | 114 | IR_dprintk(1, "Current protocol is %lld\n", |
115 | (long long)ir_type); | ||
113 | 116 | ||
114 | return len; | 117 | return len; |
115 | } | 118 | } |