From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0CC0532C75; Sun, 17 Dec 2023 12:22:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arinc9.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arinc9.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arinc9.com header.i=@arinc9.com header.b="P76naHpD" Received: by mail.gandi.net (Postfix) with ESMTPSA id 296A660002; Sun, 17 Dec 2023 12:22:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arinc9.com; s=gm1; t=1702815753; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VQ9+X8UPHQ1C4KdlT7sb5rWe9T6k+4CZlMLjRudRS3c=; b=P76naHpD1ejJeFeHEeU02JVcJ4Mw7kDeqFc+q3LbT0mYGVKMQErzpJ6D3Ud0Eyd8nESW3Z OafvuwKIUMqp/3NU3DNN3zGrrgzaDXn4Aheh4nWBsg0LvIgH250awevxCF2IkCz3cg3S98 18iRVuQfaaxwn/xSU1BC/SLzssPafOZrS3Mkx4dZK9FC/ZXFDM1gTD5zoAdL68hy9VmlOY TtZ5zy0a6hjlcaB/sTzadHUHVLi+dc6/WsN61tIEW0svDyaXFkxjPWiv+C8SqvajS2YZFp wc4bjs4FPpKKuShXmGHbtZBidjGtHUUtPMRccgUZC2UvVgsszl7DTyHFBCDBVw== Message-ID: Date: Sun, 17 Dec 2023 15:22:27 +0300 Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next 07/15] net: dsa: mt7530: do not run mt7530_setup_port5() if port 5 is disabled Content-Language: en-US To: Vladimir Oltean , Dan Carpenter Cc: Simon Horman , Daniel Golle , Landen Chao , DENG Qingfang , Sean Wang , Andrew Lunn , Florian Fainelli , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Matthias Brugger , AngeloGioacchino Del Regno , Russell King , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Frank Wunderlich , Bartel Eerdekens , mithat.guner@xeront.com, erkin.bozoglu@xeront.com References: <20231118123205.266819-1-arinc.unal@arinc9.com> <20231118123205.266819-8-arinc.unal@arinc9.com> <20231121185358.GA16629@kernel.org> <90fde560-054e-4188-b15c-df2e082d3e33@moroto.mountain> <20231207184015.u7uoyfhdxiyuw6hh@skbuf> <9b729dab-aebc-4c0c-a5e1-164845cd0948@suswa.mountain> <20231208184652.k2max4kf7r3fgksg@skbuf> From: =?UTF-8?B?QXLEsW7DpyDDnE5BTA==?= In-Reply-To: <20231208184652.k2max4kf7r3fgksg@skbuf> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-GND-Sasl: arinc.unal@arinc9.com On 8.12.2023 21:46, Vladimir Oltean wrote: > Hmm, maybe the problem, all along, was that we let the -ENODEV return > code from of_get_phy_mode() pass through? "interface" will really be > uninitialized in that case. It's not a false positive. > > Instead of: > > ret = of_get_phy_mode(mac_np, &interface); > if (ret && ret != -ENODEV) { > ... > return ret; > } > > it should have been like this, to not complain: > > ret = of_get_phy_mode(mac_np, &interface); > if (ret) { > ... > return ret; > } > I just tried this, smatch still reports "interface" as uninitialised. $ export ARCH=mips CROSS_COMPILE=mips-linux-gnu- $ ../smatch/smatch_scripts/kchecker --spammy drivers/net/dsa/mt7530.c UPD include/config/kernel.release UPD include/generated/utsrelease.h CHECK scripts/mod/empty.c CALL scripts/checksyscalls.sh CC drivers/net/dsa/mt7530.o CHECK drivers/net/dsa/mt7530.c drivers/net/dsa/mt7530.c:217 mt7530_mii_read() warn: call of 'warn_slowpath_fmt' with non-constant format argument drivers/net/dsa/mt7530.c:454 mt7530_setup_port6() error: uninitialized symbol 'ncpo1'. drivers/net/dsa/mt7530.c:868 mt7530_set_ageing_time() error: uninitialized symbol 'age_count'. drivers/net/dsa/mt7530.c:868 mt7530_set_ageing_time() error: uninitialized symbol 'age_unit'. drivers/net/dsa/mt7530.c:2324 mt7530_setup() error: uninitialized symbol 'interface'. Arınç