Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp6557799rdb; Tue, 2 Jan 2024 06:03:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IGWSWDm9G5POGLmp56kSJPPRDyVIYuWra1FG8zvNQU2EK92gt9sfxrxKT1P+90Ik6TELvUU X-Received: by 2002:a4a:ae89:0:b0:595:d2ac:993 with SMTP id u9-20020a4aae89000000b00595d2ac0993mr528554oon.4.1704204196544; Tue, 02 Jan 2024 06:03:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704204196; cv=none; d=google.com; s=arc-20160816; b=YcZJqUmAsq+GYSCkIpB7FF61nG+ellMwxMDAQy5Jh/DfXkJA5+ZgkkrutjYJIe0zZL HXE6bWLdUMgyFaQn1fqZx4mFua/13Fqp02KS1unz6KRpd+1YGJg7jrG5vH58s84jj3Bn kFKdpckldT2xXmMtBTH1cVnrtabtvsVrVOIgygKGLK+33VZhk24yw9oj658fEShUEhPa bipjWysyjbZKokdOaQtAd4yxtFw2DF5MP8sHxDhWYjIN9IdF68hDatRsoJIhFVmUZIlK U5w82EEwpRnbhwigQLJ0zvPzscmiXx9utH/TvVh63WQH/5X9vkL9rjewuFuas+yV1pfF zo5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=V/7mv4b7UJD/BzLag5HRBVmocUnHPWAiQ2MQxiW+kVo=; fh=ipzH2bARAmqEsc3tH4VT1cKZU5IewnCwuiA0ASY9woM=; b=hctUw388nXkOE0bbTHgZg/7GivF83L3c7mCBFxYGxgjeXP2xW7oeQNhJUgXNAUvmsY SyuMErz4yE+wcU7W0JSWiatAPfCzQVKjOq+BDlqROVv6OQb30v1pbF3c0qhkC+2rSR8Q pnre90pPEHeFAv1MfNQG8OplweJJV63xeXQhEcaW6bGBjUUymCwwOpS2eEDWBnCXzNHp MCG9rEFXogxYOEa4pgZEQO3L9sxgUmKSEDlG35YPbeTFyhMVOu8cf7WLOMbDs8kESMiQ v3c5KIDbsQQakh0SqHDLUptc8qFa5sjbco+au9Q50gnkWCaW+m90npSuRHNhdjBhC9R6 dztw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="n/a8o/Rr"; spf=pass (google.com: domain of linux-kernel+bounces-14451-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14451-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id v13-20020a4aad8d000000b00595b4795b6fsi694094oom.59.2024.01.02.06.03.16 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 06:03:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-14451-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="n/a8o/Rr"; spf=pass (google.com: domain of linux-kernel+bounces-14451-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-14451-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 5F981283775 for ; Tue, 2 Jan 2024 14:03:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2322411722; Tue, 2 Jan 2024 14:02:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="n/a8o/Rr" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D1A0C101D5 for ; Tue, 2 Jan 2024 14:02:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-wm1-f53.google.com with SMTP id 5b1f17b1804b1-40d8991f1acso14225695e9.1 for ; Tue, 02 Jan 2024 06:02:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1704204163; x=1704808963; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=V/7mv4b7UJD/BzLag5HRBVmocUnHPWAiQ2MQxiW+kVo=; b=n/a8o/RrAmHhEpgPYMai0dS2DnnJ/z/mtJ4o4zfOVe5CHmb8lr7sLaXXDcYh411a6e Y8T7H58bJeZ6+iEUqNi52DA99pXuJheX/166vjY4Z0aTFhGDKlN8/1O3o36o5QWsqpGm niODAyFIQmWVKCN97Ky+RuUnZBdqkoUWy/V3Zy19dmjconClkTVAqj1Yp8D5ghzgtGad 62v+7QDFBp9Pz2J1MUvE/WM3FZn8bWDrCOnh+Oryj1VzB/eGJPJy/jpPHmIOtD1ZLBwY cds9EC6nJcBWgZ6X29YDlyxjyXp1uzuZG8xoblZWG1ySMB3TfpKcSUMKYRKLrBBimCtd SDKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704204163; x=1704808963; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=V/7mv4b7UJD/BzLag5HRBVmocUnHPWAiQ2MQxiW+kVo=; b=dub46/MlCK1XelxcImaEub46nipKjzaS9eE6rgxsdii9K4NY4ycpryuR5MSb16YOKT M2KsMaS7NTTqVR9vYUi/M6XRIqF1eULF8yj9qJYOw8NJUDbBvgKnX9prlqBNB3y+yaxg Hrc17RYNZhZunjdJXCmHiZr0+q6YVElJPpPA/22cBHJNTw7vqPau1xEdTwO7Oj323tUo E/ASlvIvGFPeKGwLSwBNEJ/MmxAoXEHSAGrhGqBCnVCrqzwOJaNjaMxmVhfEYpQc6sW4 eM2kOYvVNMr2EdqU0V4QktihfrnGkG+7isMR4aFy0WTiWOw7+iimv5ClRw0TcCS4gJt+ TR2g== X-Gm-Message-State: AOJu0Yw+amF5gYe+VElesrLAvDezKLiFoQW69RdSlH90fAfUW70xYDIv mUBrpNOuBWH+Rkj+tbi+yMJHLReewb/AUQ== X-Received: by 2002:a05:600c:2d84:b0:40b:5e59:ccb3 with SMTP id i4-20020a05600c2d8400b0040b5e59ccb3mr8821823wmg.148.1704204163222; Tue, 02 Jan 2024 06:02:43 -0800 (PST) Received: from localhost ([102.140.209.237]) by smtp.gmail.com with ESMTPSA id g14-20020a05600c310e00b0040d6eb862a7sm18594695wmo.41.2024.01.02.06.02.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jan 2024 06:02:42 -0800 (PST) Date: Tue, 2 Jan 2024 14:16:45 +0300 From: Dan Carpenter To: =?utf-8?B?QXLEsW7DpyDDnE5BTA==?= Cc: Vladimir Oltean , 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 Subject: Re: [PATCH net-next 07/15] net: dsa: mt7530: do not run mt7530_setup_port5() if port 5 is disabled Message-ID: <48b664fb-edf9-4170-abde-2eb99e04f0e5@suswa.mountain> 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Sun, Dec 17, 2023 at 03:22:27PM +0300, Arınç ÜNAL wrote: > 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'. That's so strange. Vladimir was right that I was misreading what he said and also hadn't noticed the break. For me, his approach silences the warning with or without the cross function DB. Also of_get_phy_mode() initializes interface on all paths so checking for -EINVAL doesn't matter as far as this warning is concerned. regards, dan carpenter