All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Yang Li <yang.lee@linux.alibaba.com>
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
Date: Thu, 24 Jun 2021 16:25:49 +0200	[thread overview]
Message-ID: <YNSV7caeVBNnxr1S@lunn.ch> (raw)
In-Reply-To: <1623811148-11064-1-git-send-email-yang.lee@linux.alibaba.com>

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 <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
>  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

WARNING: multiple messages have this Message-ID (diff)
From: Andrew Lunn <andrew@lunn.ch>
To: Yang Li <yang.lee@linux.alibaba.com>
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
Date: Thu, 24 Jun 2021 16:25:49 +0200	[thread overview]
Message-ID: <YNSV7caeVBNnxr1S@lunn.ch> (raw)
In-Reply-To: <1623811148-11064-1-git-send-email-yang.lee@linux.alibaba.com>

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 <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
>  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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2021-06-24 14:26 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16  2:39 [PATCH -next] net: stmmac: Fix an error code in dwmac-ingenic.c Yang Li
2021-06-16  2:39 ` Yang Li
2021-06-24 14:25 ` Andrew Lunn [this message]
2021-06-24 14:25   ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YNSV7caeVBNnxr1S@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=alexandre.torgue@foss.st.com \
    --cc=davem@davemloft.net \
    --cc=joabreu@synopsys.com \
    --cc=kuba@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=peppe.cavallaro@st.com \
    --cc=yang.lee@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.