lkml.org 
[lkml]   [2019]   [Apr]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Date
    Subject[PATCH 3.16 070/202] usb: gadget: udc: net2272: Fix bitwise and boolean operations
    3.16.66-rc1 review patch.  If anyone has any objections, please let me know.

    ------------------

    From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>

    commit 07c69f1148da7de3978686d3af9263325d9d60bd upstream.

    (!x & y) strikes again.

    Fix bitwise and boolean operations by enclosing the expression:

    intcsr & (1 << NET2272_PCI_IRQ)

    in parentheses, before applying the boolean operator '!'.

    Notice that this code has been there since 2011. So, it would
    be helpful if someone can double-check this.

    This issue was detected with the help of Coccinelle.

    Fixes: ceb80363b2ec ("USB: net2272: driver for PLX NET2272 USB device controller")
    Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
    Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
    [bwh: Backported to 3.16: adjust filename]
    Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
    ---
    drivers/usb/gadget/net2272.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/drivers/usb/gadget/net2272.c
    +++ b/drivers/usb/gadget/net2272.c
    @@ -2072,7 +2072,7 @@ static irqreturn_t net2272_irq(int irq,
    #if defined(PLX_PCI_RDK2)
    /* see if PCI int for us by checking irqstat */
    intcsr = readl(dev->rdk2.fpga_base_addr + RDK2_IRQSTAT);
    - if (!intcsr & (1 << NET2272_PCI_IRQ)) {
    + if (!(intcsr & (1 << NET2272_PCI_IRQ))) {
    spin_unlock(&dev->lock);
    return IRQ_NONE;
    }
    \
     
     \ /
      Last update: 2019-04-27 17:20    [W:3.274 / U:0.008 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site