Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754624AbaKRNrY (ORCPT ); Tue, 18 Nov 2014 08:47:24 -0500 Received: from mail-pd0-f169.google.com ([209.85.192.169]:46029 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754561AbaKRNrV (ORCPT ); Tue, 18 Nov 2014 08:47:21 -0500 From: Sudip Mukherjee To: Wolfgang Grandegger , Marc Kleine-Budde , Michal Simek , =?UTF-8?q?S=C3=B6ren=20Brinkmann?= Cc: Sudip Mukherjee , linux-can@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] net: can: comparison of unsigned variable Date: Tue, 18 Nov 2014 19:17:07 +0530 Message-Id: <1416318427-28676-2-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1416318427-28676-1-git-send-email-sudipm.mukherjee@gmail.com> References: <1416318427-28676-1-git-send-email-sudipm.mukherjee@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/