linux-fpga.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Rix <trix@redhat.com>
To: Nathan Chancellor <nathan@kernel.org>,
	Moritz Fischer <mdf@kernel.org>, Wu Hao <hao.wu@intel.com>,
	Xu Yilun <yilun.xu@intel.com>
Cc: Nick Desaulniers <ndesaulniers@google.com>,
	Russ Weight <russell.h.weight@intel.com>,
	Dan Carpenter <dan.carpenter@oracle.com>,
	linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org,
	llvm@lists.linux.dev
Subject: Re: [PATCH] fpga: stratix10-soc: Do not use ret uninitialized in s10_probe()
Date: Mon, 29 Nov 2021 08:35:44 -0800	[thread overview]
Message-ID: <410b9067-588b-881e-da03-fa970ef576b1@redhat.com> (raw)
In-Reply-To: <20211129161009.3625548-1-nathan@kernel.org>


On 11/29/21 8:10 AM, Nathan Chancellor wrote:
> Clang warns:
>
> drivers/fpga/stratix10-soc.c:431:9: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
>          return ret;
>                 ^~~
> drivers/fpga/stratix10-soc.c:402:9: note: initialize the variable 'ret' to silence this warning
>          int ret;
>                 ^
>                  = 0

This line to contradicts what you did, to reduce confusion, remove the 
'silence this warning line'

Change itself looks fine.

Reviewed-by: Tom Rix <trix@redhat.com>

> 1 warning generated.
>
> ret is only assigned in an error path now so just return 0 directly.
>
> Fixes: 4ba0b2c294fe ("fpga: mgr: Use standard dev_release for class driver")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1517
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> ---
>   drivers/fpga/stratix10-soc.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/fpga/stratix10-soc.c b/drivers/fpga/stratix10-soc.c
> index 737d14c6e0de..357cea58ec98 100644
> --- a/drivers/fpga/stratix10-soc.c
> +++ b/drivers/fpga/stratix10-soc.c
> @@ -428,7 +428,7 @@ static int s10_probe(struct platform_device *pdev)
>   	}
>   
>   	platform_set_drvdata(pdev, mgr);
> -	return ret;
> +	return 0;
>   
>   probe_err:
>   	stratix10_svc_free_channel(priv->chan);
>
> base-commit: 8886a579744fbfa53e69aa453ed10ae3b1f9abac


  reply	other threads:[~2021-11-29 16:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-29 16:10 [PATCH] fpga: stratix10-soc: Do not use ret uninitialized in s10_probe() Nathan Chancellor
2021-11-29 16:35 ` Tom Rix [this message]
2021-11-29 19:24 ` Russ Weight

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=410b9067-588b-881e-da03-fa970ef576b1@redhat.com \
    --to=trix@redhat.com \
    --cc=dan.carpenter@oracle.com \
    --cc=hao.wu@intel.com \
    --cc=linux-fpga@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=mdf@kernel.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=russell.h.weight@intel.com \
    --cc=yilun.xu@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).