From 3bc3a8239009d6eac56e5076ea5e3eef2b61cd9b Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Wed, 4 Jan 2017 10:55:36 +0000 Subject: [PATCH] staging: comedi: daqboard2000: use type 'u16' for CPLD data and status The CPLD status and data registers used to load firmware are 16 bits wide. Use the type `u16` to represent data and status values instead of `int`. Signed-off-by: Ian Abbott Reviewed-by: H Hartley Sweeten Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/daqboard2000.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/comedi/drivers/daqboard2000.c b/drivers/staging/comedi/drivers/daqboard2000.c index 954a1a536fb4..e73baba7c312 100644 --- a/drivers/staging/comedi/drivers/daqboard2000.c +++ b/drivers/staging/comedi/drivers/daqboard2000.c @@ -470,11 +470,11 @@ static void daqboard2000_pulse_prog_pin(struct comedi_device *dev) mdelay(10); /* Not in the original code, but I like symmetry... */ } -static int daqboard2000_poll_cpld(struct comedi_device *dev, int mask) +static int daqboard2000_poll_cpld(struct comedi_device *dev, u16 mask) { int result = 0; int i; - int cpld; + u16 cpld; /* timeout after 50 tries -> 5ms */ for (i = 0; i < 50; i++) { @@ -489,7 +489,7 @@ static int daqboard2000_poll_cpld(struct comedi_device *dev, int mask) return result; } -static int daqboard2000_write_cpld(struct comedi_device *dev, int data) +static int daqboard2000_write_cpld(struct comedi_device *dev, u16 data) { int result = 0; @@ -527,7 +527,7 @@ static int daqboard2000_load_firmware(struct comedi_device *dev, break; } for (; i < len; i += 2) { - int data = + u16 data = (cpld_array[i] << 8) + cpld_array[i + 1]; if (!daqboard2000_write_cpld(dev, data)) break; -- 2.20.1