From patchwork Fri Dec 9 12:07:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Horatiu Vultur X-Patchwork-Id: 13069542 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 699F0C4332F for ; Fri, 9 Dec 2022 12:03:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=TNhs6TAV1krL8etNfnp4d0IrhUBfMPO5l+64rfodP+A=; b=zREpQaYvmpCvIF HV4iBpWX0J1EJjRGaeteXlhbCq4mrheq68M78cZ3mOVCh+F0HubmpKsJq/YSU9EZi8Sl/tpYTkJAc 5G//i6NNJs1nIIv+4NwMYOgncavS6IQyYWHqboXqCqILz0K/T7+xAgNPoutP6xuSU+Kv8JfwuEUOL U3qr7NZJih8AUgx8ygDVa4T/YgKXzmn53Xoba6gSqZt+znvTvkvRLfdKSat5LN94BIbt1YCzfE1ye XuJWbv1HJjmrBK1CvrY7V162WrJEFJBpGc9XSWQHGttO9CT+j3fBKGCNwrc+haVIAQbbaq206InWM R0Ake67B34LJqE7M6bcQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3c58-007Ixd-No; Fri, 09 Dec 2022 12:02:22 +0000 Received: from esa.microchip.iphmx.com ([68.232.154.123]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p3c54-007Iu7-HZ for linux-arm-kernel@lists.infradead.org; Fri, 09 Dec 2022 12:02:20 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1670587337; x=1702123337; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=wsM3FY6DnRodmBXZFbVV09BKkLbtFB2sIt9sAbnVvkg=; b=KXx21pF9/MH9h8Ch1spLGD7aBkWW/AYwDjKws6lVUAsmIxiD+l7mmrSU PVlh5z2ldcPB68c3ZUKQfXwkxeRGuHTwtLC3+bPmk4ArfJs8wjzSDEp5U IOH+zXZj4UYNDbycDtY9NrsAmeV93Skk6Nm1s5Eig0EXr5CW9wX1EkFJb xCldZ942SsDJZgrnEgbQuwz4DE82V6SzItrZf4/CBnewKqYChW6Asj/s6 TvHyYO1SItr7YdHxMpZ/KQBsJqCbsA113rhP8bYgrx1KyA8w4I6KiQbVJ onYEuewzMpMmr4RhoxJsuoipQPj2J7PAeedK5aRGYmAtrh1Wot3TPu4Io w==; X-IronPort-AV: E=Sophos;i="5.96,230,1665471600"; d="scan'208";a="190869007" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 09 Dec 2022 05:02:10 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Fri, 9 Dec 2022 05:02:10 -0700 Received: from soft-dev3-1.microsemi.net (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Fri, 9 Dec 2022 05:02:07 -0700 From: Horatiu Vultur To: , , CC: , , , , , , , , Horatiu Vultur , kernel test robot , "Dan Carpenter" Subject: [PATCH net-next] net: microchip: vcap: Fix initialization of value and mask Date: Fri, 9 Dec 2022 13:07:01 +0100 Message-ID: <20221209120701.218937-1-horatiu.vultur@microchip.com> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221209_040218_711919_31F4B6CC X-CRM114-Status: UNSURE ( 8.18 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Fix the following smatch warning: smatch warnings: drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c:103 vcap_debugfs_show_rule_keyfield() error: uninitialized symbol 'value'. drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c:106 vcap_debugfs_show_rule_keyfield() error: uninitialized symbol 'mask'. In case the vcap field was VCAP_FIELD_U128 and the key was different than IP6_S/DIP then the value and mask were not initialized, therefore initialize them. Fixes: 610c32b2ce66 ("net: microchip: vcap: Add vcap_get_rule") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Horatiu Vultur Reviewed-by: Saeed Mahameed --- drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c b/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c index 895bfff550d23..1237601ac9dc1 100644 --- a/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c +++ b/drivers/net/ethernet/microchip/vcap/vcap_api_debugfs.c @@ -83,6 +83,8 @@ static void vcap_debugfs_show_rule_keyfield(struct vcap_control *vctrl, hex = true; break; case VCAP_FIELD_U128: + value = data->u128.value; + mask = data->u128.value; if (key == VCAP_KF_L3_IP6_SIP || key == VCAP_KF_L3_IP6_DIP) { u8 nvalue[16], nmask[16];