Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp264826pxv; Thu, 24 Jun 2021 07:28:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwLu3zjTzoQwWI1/8nM2E8y4HLp+k6EkWFZUiayWqk+kGEr25nNTr0KwOG3xROKxXlMjwO7 X-Received: by 2002:a17:906:b816:: with SMTP id dv22mr5573560ejb.503.1624544881675; Thu, 24 Jun 2021 07:28:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624544881; cv=none; d=google.com; s=arc-20160816; b=dRbq4T9M21nQ6QbnQEEOgCVPJ/caNzUw2+K5IlsutJwMDAvquqvPhHyE7aBapeMUBx GsPU1EAwj09EeSXe5qz+hC3hTdZb0E+B8/DntO0+uxN56lXdRuk/i1T9t5WZSzxVuLIL zc8kXN/KJ7Dim4qQorml9lDKQ74Xn21Dpxyb2zZ2JOVm9TzQ+pP/micHLX8Lzvcyic/Y kWl+pkA/2NdX/oGDMsaN8L043XoMPPMCRS+AT7x+l4ppnBbCAFPXMUR2Zp9fxwp+fxVp 6TDZcm/lsZhr7IVUP3IH8c9+8eEdua9WAYIC95Y4Nwwo5lMZX6bzUhES+rnSHSTw2iWp p1xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=daRFBCA9iRpEHBee51ZqEeUZ2hHxuMUcehyqzo51cKE=; b=LRdOvA068CMsD3jn8zXumahEF3l2biuTJ80469Vgd8IArRWTbukidIPs5o+F7o1r+u ZZRBaamveS7kp1lj8Ci68m2ZNI0QzUxxXfT6X1lYu5GcJ/zLQugXi2Kh9MG57dl21Mhu SKdBxnInSf2uK3NBRMjI6XJgjKRcOW4l5HLabGakG47W6Dpz93fuOELbg7GETMCSx5DN l8tGxlVnON3lTMnSXaomYOSLM28HFOIK7HZz+9Z1w7Yhw6Y1fX/fQ62jRZq2Lf1x9Qdy vaoBO2Gqpa28LTnxRkKJZmDYh0KWH2cBLrJvnc1QWTebc3jQeXnWHykL+v1tTrsG21nu r6PA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=Y+DaKI+A; 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 bh4si3746593ejb.56.2021.06.24.07.27.38; Thu, 24 Jun 2021 07:28:01 -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=@lunn.ch header.s=20171124 header.b=Y+DaKI+A; 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 S232063AbhFXO2W (ORCPT + 99 others); Thu, 24 Jun 2021 10:28:22 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:53824 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231978AbhFXO2V (ORCPT ); Thu, 24 Jun 2021 10:28:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=daRFBCA9iRpEHBee51ZqEeUZ2hHxuMUcehyqzo51cKE=; b=Y+DaKI+AJ2acjklMtCkCgeKtFx y/BDgTdvQOihy8YSuq/2Go1I29pHdu1CMXmzld0D3NcaN9vTNN1HKBy4ITf3ZaWSiVKzo9V9gWxeJ 12ZhsEIo1S31bew7wKL7shzLdXIIqGxclsA8k6Sm9SHFoQIRgmBCUmXaW7HLQ5Lxie5U=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1lwQIf-00AzBN-7M; Thu, 24 Jun 2021 16:25:49 +0200 Date: Thu, 24 Jun 2021 16:25:49 +0200 From: Andrew Lunn To: Yang Li Cc: peppe.cavallaro@st.com, alexandre.torgue@foss.st.com, joabreu@synopsys.com, davem@davemloft.net, kuba@kernel.org, mcoquelin.stm32@gmail.com, netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -next] net: stmmac: Fix an error code in dwmac-ingenic.c Message-ID: References: <1623811148-11064-1-git-send-email-yang.lee@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1623811148-11064-1-git-send-email-yang.lee@linux.alibaba.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 16, 2021 at 10:39:08AM +0800, Yang Li wrote: > When IS_ERR(mac->regmap) returns true, the value of ret is 0. > So, we set ret to -ENODEV to indicate this error. > > Clean up smatch warning: > drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c:266 > ingenic_mac_probe() warn: missing error code 'ret' > > Reported-by: Abaci Robot > Signed-off-by: Yang Li > --- > drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c > index 60984c1..f3950e0 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-ingenic.c > @@ -263,6 +263,7 @@ static int ingenic_mac_probe(struct platform_device *pdev) > mac->regmap = syscon_regmap_lookup_by_phandle(pdev->dev.of_node, "mode-reg"); > if (IS_ERR(mac->regmap)) { > dev_err(&pdev->dev, "%s: Failed to get syscon regmap\n", __func__); > + ret = -ENODEV; mac->regmap is a ERR_PTR(), containing an error code. Please use that error code, not ENODEV. Andrew