Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1999602pxk; Mon, 14 Sep 2020 01:52:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw6hS2JlSwdra7b3t6eZCrKGPi+xOktPs8bL6iVY+4JBOUrrBTF6IsRmAH8dczWl3uJljwx X-Received: by 2002:a50:8523:: with SMTP id 32mr16760664edr.282.1600073550160; Mon, 14 Sep 2020 01:52:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600073550; cv=none; d=google.com; s=arc-20160816; b=MY0/REetN3458Nb+JegpqTID1GoRnQ8nX/7qIIphfsuRcjp9fueeFH373HsAVlHIhp ndVM3fyAn6S92EfMJf4D+V3yEtDu2Y1W46CiNQwcseyFMeY0nwRb4e+PNrQ22SFc+kHL LDYu2j3gCuoaYlPPNGThm0KPulTyTDrQJ7Cfm8/QcT22WNFnkkpMbfx5A/+PXyXjH9zl Mo18vYmw31Mfnws5r+psfDIyftgoK/a2f161asAgKeuWSG5HdODAaCvF/3SQ0rXoUI2/ 5SL/KpTlla+dmmnfJnC/MfxLAHbDLVwYzwHZK5YZ4bUXNB0Pz8iSFTq+WUxya2Oj5OWr dIxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rOuDYNhd1Y5ud5FTj27+NxJ3Of7Hu1ANeTXNQ89wUxQ=; b=Z6f9LZ/eq3W9/VsbepdhpwvshCBaTdycIlog6yS4sPrZh54KRpIJlTtdkaJhPY7RGf 4EKhpQCoFFaEB7izVRZdCwVlsK0C9PtaWke+A4HVUUMdf0L3aTGmfdVqBRLpC2NhZCq4 iHbqQ8iTSKpy5+u3AXGsiJgCFKY9HTNarTP5IPd3S4FQzNR47f0OJ3E0iscI68IRemrp b5RT2COZcKLlmMTqRn93ViX+YlBhxSdySPH2IM3hD2duU4f5NH1l1NS9zwJ3/XCyJXfQ czITU9C0sSRtAqOpZjfxxrRxIo8ATZiFw7jZcpM2WT2Po0ZlExj2uHzZ7irePJrwGuxR LvIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@monstr-eu.20150623.gappssmtp.com header.s=20150623 header.b="l/EV8WRl"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g8si7119862ejm.633.2020.09.14.01.52.08; Mon, 14 Sep 2020 01:52:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@monstr-eu.20150623.gappssmtp.com header.s=20150623 header.b="l/EV8WRl"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726253AbgINIun (ORCPT + 99 others); Mon, 14 Sep 2020 04:50:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41666 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726196AbgINIuK (ORCPT ); Mon, 14 Sep 2020 04:50:10 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D7EA9C0612F2 for ; Mon, 14 Sep 2020 01:50:09 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id m6so17793639wrn.0 for ; Mon, 14 Sep 2020 01:50:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rOuDYNhd1Y5ud5FTj27+NxJ3Of7Hu1ANeTXNQ89wUxQ=; b=l/EV8WRl7sWHYBy73eHItd5zdjECPLnliI92dOSvSWvYDUnU2cuYVi0rvxl66FDh2T tuSNqz+Nx4xXRwhHEsu1GPbA74Up1shUnObJksSEr/dQpVdVmOxAbuDl5E5F1Tzobag3 wTMrdA7YOeMlTq3wo5ZEAkrpMgvYh80QQKE0Ok5ieV9RowZb851bamiBwqJhGeceA2wj b9513TZMaIymzFcWSnqe2rlozdi5Sqqh1h8oOul1JfUlsu00KOSPQAMMlKBiFqjj7340 9b9dNLMXOC4XGSzx7LTw25QyLIbr/e8wOq4i3aag4hjbAB7UTj1wLAhVC8zs2MVUBmbb jpAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=rOuDYNhd1Y5ud5FTj27+NxJ3Of7Hu1ANeTXNQ89wUxQ=; b=cGC4QaRs4SEFXR5hxiSVLQrBE6yvCAGmzibLbP/ZeKVrBEYXpg4FpYPEKWsNTpFSZi EAwfmc9cd7cgcdkNEGnwfT+kiLN3BKkKJsaZsNfF1Sl9dogf/2LeDMciBkfhkyFoNq1p MgjyT8CyGSUBShrzEVNXnTtCpDtCBGb3aYn3Jsy/KkiN1+gXnSixhVE3+2RJcazJbuSw 3nyslQEB8OjgGDqEnIHVQGD6+Vk3fG58/5u7lL1T8iS7wOzSivxS/Lz2+I9ouFCYO6w/ 5PS92ZJwBPvxVWgcZdbbF+Jj4w5a1ySUzpBzpeiC15Kvn6XrpVGCdJWjVhTDkhbEtlnZ Jm4w== X-Gm-Message-State: AOAM530X7+aNbBp+72LZijpaXvi6gW0ihuQ2SFfgbnWVhixHj1eEwmcf xuShSRHKhUwQUeC3NbxmoG5nHDMJh7M3Cw== X-Received: by 2002:a5d:620e:: with SMTP id y14mr16069452wru.371.1600073408285; Mon, 14 Sep 2020 01:50:08 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id o4sm19305669wru.55.2020.09.14.01.50.07 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 14 Sep 2020 01:50:07 -0700 (PDT) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu, michal.simek@xilinx.com, git@xilinx.com Cc: Srinivas Neeli , Appana Durga Kedareswara rao , "David S. Miller" , Jakub Kicinski , Marc Kleine-Budde , Naga Sureshkumar Relli , Wolfgang Grandegger , linux-arm-kernel@lists.infradead.org, linux-can@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH 3/3] can: xilinx_can: Fix incorrect variable and initialize with a default value Date: Mon, 14 Sep 2020 10:49:58 +0200 Message-Id: <0651544d22f3c25893ca9d445b14823f0dfddfc8.1600073396.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Srinivas Neeli Some variables with incorrect type were passed to "of_property_read_u32" API, "of_property_read_u32" API was expecting an "u32 *" but the formal parameter that was passed was of type "int *". Fixed the issue by changing the variable types from "int" to "u32" and initialized with a default value. Fixed sparse warning. Addresses-Coverity: "incompatible_param" Addresses-Coverity: "UNINIT(Using uninitialized value)" Signed-off-by: Srinivas Neeli Signed-off-by: Michal Simek --- drivers/net/can/xilinx_can.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c index 3393e2a73e15..46c04b6390f8 100644 --- a/drivers/net/can/xilinx_can.c +++ b/drivers/net/can/xilinx_can.c @@ -1671,7 +1671,7 @@ static int xcan_probe(struct platform_device *pdev) void __iomem *addr; int ret; int rx_max, tx_max; - int hw_tx_max, hw_rx_max; + u32 hw_tx_max = 0, hw_rx_max = 0; const char *hw_tx_max_property; /* Get the virtual base address for the device */ @@ -1724,7 +1724,7 @@ static int xcan_probe(struct platform_device *pdev) */ if (!(devtype->flags & XCAN_FLAG_TX_MAILBOXES) && (devtype->flags & XCAN_FLAG_TXFEMP)) - tx_max = min(hw_tx_max, 2); + tx_max = min(hw_tx_max, 2U); else tx_max = 1; -- 2.28.0