From: Michal Simek <michal.simek@xilinx.com>
To: "Sudip Mukherjee" <sudipm.mukherjee@gmail.com>,
"Wolfgang Grandegger" <wg@grandegger.com>,
"Marc Kleine-Budde" <mkl@pengutronix.de>,
"Michal Simek" <michal.simek@xilinx.com>,
"Sören Brinkmann" <soren.brinkmann@xilinx.com>
Cc: <linux-can@vger.kernel.org>, <netdev@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/2] net: can: comparison of unsigned variable
Date: Tue, 18 Nov 2014 17:47:02 +0100 [thread overview]
Message-ID: <67e24b2a43564b55960a31c62e5d44ca@BY2FFO11FD055.protection.gbl> (raw)
In-Reply-To: <1416318427-28676-2-git-send-email-sudipm.mukherjee@gmail.com>
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
next prev parent reply other threads:[~2014-11-18 17:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-18 13:47 [PATCH 1/2] net: can: remove unused variable Sudip Mukherjee
2014-11-18 13:47 ` [PATCH 2/2] net: can: comparison of unsigned variable Sudip Mukherjee
2014-11-18 16:47 ` Michal Simek [this message]
2014-11-18 20:39 ` [PATCH 1/2] net: can: remove unused variable Marc Kleine-Budde
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=67e24b2a43564b55960a31c62e5d44ca@BY2FFO11FD055.protection.gbl \
--to=michal.simek@xilinx.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=soren.brinkmann@xilinx.com \
--cc=sudipm.mukherjee@gmail.com \
--cc=wg@grandegger.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®