summaryrefslogtreecommitdiffstats
path: root/drivers/usb/cdns3
diff options
context:
space:
mode:
authorPeter Chen <peter.chen@nxp.com>2020-06-23 11:10:00 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-07-01 14:04:04 +0200
commit8685c46d39910a6335cf120d2d2a5295ec0a60a5 (patch)
tree311e3e2a31dd366625f7ef10dc6d52998a8c8a9b /drivers/usb/cdns3
parent8a58264128d51b8304f800fc34dc184ea9d9bd2a (diff)
downloadlinux-8685c46d39910a6335cf120d2d2a5295ec0a60a5.tar.gz
linux-8685c46d39910a6335cf120d2d2a5295ec0a60a5.tar.bz2
linux-8685c46d39910a6335cf120d2d2a5295ec0a60a5.zip
usb: cdns3: gadget: unsigned int is dereferenced as a wider unsigned long
It is reported by Coverity scan, and fixed it by declare the reg as unsigned long. Reviewed-by: Jun Li <jun.li@nxp.com> Signed-off-by: Peter Chen <peter.chen@nxp.com> Acked-by: Roger Quadros <rogerq@ti.com> Link: https://lore.kernel.org/r/20200623031001.8469-3-peter.chen@nxp.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/cdns3')
-rw-r--r--drivers/usb/cdns3/gadget.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c
index c303ab7c62d1..bed7ee7e9880 100644
--- a/drivers/usb/cdns3/gadget.c
+++ b/drivers/usb/cdns3/gadget.c
@@ -1810,7 +1810,7 @@ static irqreturn_t cdns3_device_thread_irq_handler(int irq, void *data)
irqreturn_t ret = IRQ_NONE;
unsigned long flags;
int bit;
- u32 reg;
+ unsigned long reg;
spin_lock_irqsave(&priv_dev->lock, flags);
@@ -1841,7 +1841,7 @@ static irqreturn_t cdns3_device_thread_irq_handler(int irq, void *data)
if (!reg)
goto irqend;
- for_each_set_bit(bit, (unsigned long *)&reg,
+ for_each_set_bit(bit, &reg,
sizeof(u32) * BITS_PER_BYTE) {
cdns3_check_ep_interrupt_proceed(priv_dev->eps[bit]);
ret = IRQ_HANDLED;