From 0557344e21497fce9475dfe3f41fd92d57d8a274 Mon Sep 17 00:00:00 2001 From: H Hartley Sweeten Date: Mon, 25 Aug 2014 15:23:50 -0700 Subject: [PATCH] staging: comedi: ni_mio_common: fix local var for 32-bit read The local variable 'd' is used to read a 32-bit register. One branch of the code shifts the register value 16 bits to the right to get the high 16-bits. Change the type of the local variable so that this shift works correctly. Reported by: coverity Signed-off-by: H Hartley Sweeten Reviewed-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/ni_mio_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c index 8b3ba40cb74c..c42ba22b91d2 100644 --- a/drivers/staging/comedi/drivers/ni_mio_common.c +++ b/drivers/staging/comedi/drivers/ni_mio_common.c @@ -2108,7 +2108,7 @@ static int ni_ai_insn_read(struct comedi_device *dev, unsigned int mask = (s->maxdata + 1) >> 1; int i, n; unsigned signbits; - unsigned short d; + unsigned int d; unsigned long dl; ni_load_channelgain_list(dev, s, 1, &insn->chanspec); -- 2.34.1