lkml.org 
[lkml]   [2014]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 2/2] net: can: comparison of unsigned variable
    Date
    err was of the type u32. it was being compared with < 0, and being
    an unsigned variable the comparison would have been always false.

    moreover, err was getting the return value from set_reset_mode()
    and xcan_set_bittiming(), and both are returning int.

    Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
    ---
    drivers/net/can/xilinx_can.c | 3 ++-
    1 file changed, 2 insertions(+), 1 deletion(-)

    diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c
    index 72fe96f..67c2dd4 100644
    --- a/drivers/net/can/xilinx_can.c
    +++ b/drivers/net/can/xilinx_can.c
    @@ -300,7 +300,8 @@ static int xcan_set_bittiming(struct net_device *ndev)
    static int xcan_chip_start(struct net_device *ndev)
    {
    struct xcan_priv *priv = netdev_priv(ndev);
    - u32 err, reg_msr, reg_sr_mask;
    + u32 reg_msr, reg_sr_mask;
    + int err;
    unsigned long timeout;

    /* Check if it is in reset mode */
    --
    1.8.1.2


    \
     
     \ /
      Last update: 2014-11-18 15:21    [W:3.112 / U:0.192 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site