* [PATCH 2/2] net: can: comparison of unsigned variable [not found] <1416318427-28676-1-git-send-email-sudipm.mukherjee@gmail.com> @ 2014-11-18 13:47 ` Sudip Mukherjee 2014-11-18 16:47 ` Michal Simek 0 siblings, 1 reply; 2+ messages in thread From: Sudip Mukherjee @ 2014-11-18 13:47 UTC (permalink / raw) To: linux-arm-kernel 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 ^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH 2/2] net: can: comparison of unsigned variable 2014-11-18 13:47 ` [PATCH 2/2] net: can: comparison of unsigned variable Sudip Mukherjee @ 2014-11-18 16:47 ` Michal Simek 0 siblings, 0 replies; 2+ messages in thread From: Michal Simek @ 2014-11-18 16:47 UTC (permalink / raw) To: linux-arm-kernel On 11/18/2014 02:47 PM, Sudip Mukherjee wrote: > 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 */ > Reviewed-by: Michal Simek <michal.simek@xilinx.com> Thanks, Michal ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-11-18 16:47 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1416318427-28676-1-git-send-email-sudipm.mukherjee@gmail.com>
2014-11-18 13:47 ` [PATCH 2/2] net: can: comparison of unsigned variable Sudip Mukherjee
2014-11-18 16:47 ` Michal Simek
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).