Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1259304pxk; Thu, 10 Sep 2020 10:51:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0PkzLyXBnumQTnboM4LH9lUA9g6ZXtncIRFDza3MNOA+nCerGXG918zp7SnJXtdOZ2q3F X-Received: by 2002:a17:906:a201:: with SMTP id r1mr9837025ejy.432.1599760296050; Thu, 10 Sep 2020 10:51:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599760296; cv=none; d=google.com; s=arc-20160816; b=o//MrC8Z6Xgb1Iki0WijIU0BsPtirXiH4S+hbUGx/oQS0ZTLPSYU7Wgjp4m4YTTwC0 RlPqQ7cbBp2jFHsqwL7Z6FjdFdMBCqN1g/Fqfbvt9yQx0SlWBQvp3AzgPcBUrghUKRRI bbIV903GekL5j/F/BAvrGb6DtMHizUbSxFMfvdmSdx7nazKkjZ/9Ub7LtQ+hn8zheq6B 0huYPhfeQopovesX6tcSuDEbFD1gl/cb5POXY9Ts687VS4Q6O/bK9lE7Nj1e1OGfeIW5 gyKrUd5hVLBnNPw7gnzwecnXAIlKlwLZxCkqxNyZYHXrwQbBmFH2Bo9ybtqKdOni9Drx 8azA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=466BP3gTqbYzho2Xtm74KeHTUl+MUpLWLJk7QtAP2ns=; b=jcJBCQCVFn+vjl3CHLzc9WMzpHoBBybdryZVUESz5BnL3WuqCczKpfZtKh5fEPxHOj nU2xbqMPRCThfpC9dCUX3w8vE26LMZniVWItToVx77/AEYOa3vfr24nNcgQv1fIsIo/S MqiYtY9Ow8jtcTM9b4gGkFRkfwh5LfV6HZoOGi8G9ZXH4+6UHtFChAMNinfMQl1eNgUG WYmqB7pa8MaMMbqZGc63FRBBh11HZ+5Rhla1UEaaxaBSSLQ38wr33KV4AjcP1CjBxe46 RZvpBJijun5wuBOnOzux0LxQTcn/GkU7l0Ydv16NRXXuaEg+/rcBch/H+LD/UYKK1ToI ER0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=RNK6sGRS; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gl17si4060405ejb.311.2020.09.10.10.51.13; Thu, 10 Sep 2020 10:51:36 -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=pass header.i=@gmail.com header.s=20161025 header.b=RNK6sGRS; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726991AbgIJRu0 (ORCPT + 99 others); Thu, 10 Sep 2020 13:50:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727025AbgIJRtQ (ORCPT ); Thu, 10 Sep 2020 13:49:16 -0400 Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8746CC061573; Thu, 10 Sep 2020 10:49:16 -0700 (PDT) Received: by mail-qt1-x844.google.com with SMTP id t20so5521463qtr.8; Thu, 10 Sep 2020 10:49:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=466BP3gTqbYzho2Xtm74KeHTUl+MUpLWLJk7QtAP2ns=; b=RNK6sGRSmvXu6TgFnuA0d/SF3aqKQ3/5gA4cb0ywADDTEMkeb9DUMz+B+rgKBcWwlz IvUR6yVuE9dBTegmje/RutMzo5eXfULJzi7cJjjBpq6rNBdZ78ugR3Y5YJTpgW3VtrLJ gCxDR99e4JJ0da2DshXzz+nmwqtFv55Hmfl2UhAJM3fwTwYENZcQliolNimqeHL3mvAp vp+c0TOPjEvPVO9sg6qnSBP28M9DDeWxEUjNKQa2mOjTkdJaJQmPSvosRoMEhJN8Jf0Z lRdluq+wksEYT79Tld0arwL0Whb/rMv4ddm9ISSrxJrMgKISkg39OztFCdUuHJ7YQc49 ZnGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=466BP3gTqbYzho2Xtm74KeHTUl+MUpLWLJk7QtAP2ns=; b=JT2bn6I3WkO+gBrmQKggT5stDp6iHgtg9DzQfJxNadCKcsFcikjaeqN281WFWgJlMB gkd9N0E4dBWF+hLXNECQA92/Lk2yBeVW6uHqSm6pMS7w0XFiKEkveUrYFJSuMKFGRQOE BzT0mr3WIlmF0JwyzBBRabmhxHXM6dMpekWbEtddSTe/Ikdqprz0bPAh5vVhm1J44vpK G0Gb/erbYht6zNJAF6S/vFD3OnCKQGDz1azXcFQreJU44fbqpHaeOEOHbh/vxCzQJJwX WygzGjHwmgylYYUJlkyos5LixfG80dU5w9F1WYlvQGJCOo9Tm2pbjco1vpWUsY14PZ1F Odxg== X-Gm-Message-State: AOAM531OHcdAk8knwCnqBM2dzQlFuRZzIDjbhX+1zZX83vn6dl/V+xyj rJwKbJ0O4C6IOVktrJe5aYU= X-Received: by 2002:ac8:ecb:: with SMTP id w11mr8828228qti.373.1599760155606; Thu, 10 Sep 2020 10:49:15 -0700 (PDT) Received: from localhost.localdomain ([2604:1380:45d1:2600::1]) by smtp.gmail.com with ESMTPSA id r48sm7927350qtb.26.2020.09.10.10.49.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Sep 2020 10:49:14 -0700 (PDT) From: Nathan Chancellor To: "David S. Miller" , Jakub Kicinski Cc: Russell King , Andrew Lunn , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com, Nathan Chancellor Subject: [PATCH net-next] net: mvpp2: Initialize link in mvpp2_isr_handle_{xlg,gmac_internal} Date: Thu, 10 Sep 2020 10:48:27 -0700 Message-Id: <20200910174826.511423-1-natechancellor@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Patchwork-Bot: notify Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clang warns (trimmed for brevity): drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c:3073:7: warning: variable 'link' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (val & MVPP22_XLG_STATUS_LINK_UP) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c:3075:31: note: uninitialized use occurs here mvpp2_isr_handle_link(port, link); ^~~~ ... drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c:3090:8: warning: variable 'link' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized] if (val & MVPP2_GMAC_STATUS0_LINK_UP) ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c:3092:32: note: uninitialized use occurs here mvpp2_isr_handle_link(port, link); ^~~~ Initialize link to false like it was before the refactoring that happened around link status so that a valid valid is always passed into mvpp2_isr_handle_link. Fixes: 36cfd3a6e52b ("net: mvpp2: restructure "link status" interrupt handling") Link: https://github.com/ClangBuiltLinux/linux/issues/1151 Signed-off-by: Nathan Chancellor --- drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c index 7d86940747d1..0d5ee96f89b4 100644 --- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c @@ -3064,7 +3064,7 @@ static void mvpp2_isr_handle_link(struct mvpp2_port *port, bool link) static void mvpp2_isr_handle_xlg(struct mvpp2_port *port) { - bool link; + bool link = false; u32 val; val = readl(port->base + MVPP22_XLG_INT_STAT); @@ -3078,7 +3078,7 @@ static void mvpp2_isr_handle_xlg(struct mvpp2_port *port) static void mvpp2_isr_handle_gmac_internal(struct mvpp2_port *port) { - bool link; + bool link = false; u32 val; if (phy_interface_mode_is_rgmii(port->phy_interface) || base-commit: 4f6a5caf187ff5807cd5b4ea5678982c249bd964 -- 2.28.0