Commit 971e8298 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

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: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 3f831107
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;

+9 −6
Original line number Diff line number Diff line
@@ -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;
}
+1 −1
Original line number Diff line number Diff line
@@ -578,7 +578,7 @@ int __devinit dm1105_ir_init(struct dm1105dvb *dm1105)
{
	struct input_dev *input_dev;
	struct ir_scancode_table *ir_codes = &ir_codes_dm1105_nec_table;
	enum ir_type ir_type = IR_TYPE_OTHER;
	u64 ir_type = IR_TYPE_OTHER;
	int err = -ENOMEM;

	input_dev = input_allocate_device();
+1 −1
Original line number Diff line number Diff line
@@ -247,7 +247,7 @@ int bttv_input_init(struct bttv *btv)
	struct card_ir *ir;
	struct ir_scancode_table *ir_codes = NULL;
	struct input_dev *input_dev;
	enum ir_type ir_type = IR_TYPE_OTHER;
	u64 ir_type = IR_TYPE_OTHER;
	int err = -ENOMEM;

	if (!btv->has_remote)
+1 −1
Original line number Diff line number Diff line
@@ -192,7 +192,7 @@ int cx88_ir_init(struct cx88_core *core, struct pci_dev *pci)
	struct cx88_IR *ir;
	struct input_dev *input_dev;
	struct ir_scancode_table *ir_codes = NULL;
	enum ir_type ir_type = IR_TYPE_OTHER;
	u64 ir_type = IR_TYPE_OTHER;
	int err = -ENOMEM;

	ir = kzalloc(sizeof(*ir), GFP_KERNEL);
Loading