From: Dan Carpenter <dan.carpenter@oracle.com>
To: Mukesh Ojha <mojha@codeaurora.org>
Cc: Andy Gross <andy.gross@linaro.org>,
David Brown <david.brown@linaro.org>,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] remoteproc: silence an uninitialized variable warning
Date: Thu, 04 Apr 2019 09:36:22 +0000 [thread overview]
Message-ID: <20190404093622.GM32613@kadam> (raw)
In-Reply-To: <a08db945-44d3-ff99-7a89-75367f314855@codeaurora.org>
On Thu, Apr 04, 2019 at 02:47:39PM +0530, Mukesh Ojha wrote:
>
> On 4/4/2019 2:12 PM, Dan Carpenter wrote:
> > Smatch complains that "ret" might be uninitialized. I can see why it
> > generates the warning, but I don't know if it's actually possible.
> > Anyway initializing "ret" here is harmless.
> >
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > ---
> > drivers/soc/qcom/mdt_loader.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/soc/qcom/mdt_loader.c b/drivers/soc/qcom/mdt_loader.c
> > index 1c488024c698..fc58d660692f 100644
> > --- a/drivers/soc/qcom/mdt_loader.c
> > +++ b/drivers/soc/qcom/mdt_loader.c
> > @@ -188,7 +188,7 @@ static int __qcom_mdt_load(struct device *dev, const struct firmware *fw,
> > if (reloc_base)
> > *reloc_base = mem_reloc;
> > -
> > + ret = 0;
>
>
> You are overriding the value here, better keep it at the start.
I like how I wrote it. It makes it clear that this is the success path.
regards,
dan carpenter
WARNING: multiple messages have this Message-ID (diff)
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Mukesh Ojha <mojha@codeaurora.org>
Cc: Andy Gross <andy.gross@linaro.org>,
David Brown <david.brown@linaro.org>,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] remoteproc: silence an uninitialized variable warning
Date: Thu, 4 Apr 2019 12:36:22 +0300 [thread overview]
Message-ID: <20190404093622.GM32613@kadam> (raw)
In-Reply-To: <a08db945-44d3-ff99-7a89-75367f314855@codeaurora.org>
On Thu, Apr 04, 2019 at 02:47:39PM +0530, Mukesh Ojha wrote:
>
> On 4/4/2019 2:12 PM, Dan Carpenter wrote:
> > Smatch complains that "ret" might be uninitialized. I can see why it
> > generates the warning, but I don't know if it's actually possible.
> > Anyway initializing "ret" here is harmless.
> >
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> > ---
> > drivers/soc/qcom/mdt_loader.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/soc/qcom/mdt_loader.c b/drivers/soc/qcom/mdt_loader.c
> > index 1c488024c698..fc58d660692f 100644
> > --- a/drivers/soc/qcom/mdt_loader.c
> > +++ b/drivers/soc/qcom/mdt_loader.c
> > @@ -188,7 +188,7 @@ static int __qcom_mdt_load(struct device *dev, const struct firmware *fw,
> > if (reloc_base)
> > *reloc_base = mem_reloc;
> > -
> > + ret = 0;
>
>
> You are overriding the value here, better keep it at the start.
I like how I wrote it. It makes it clear that this is the success path.
regards,
dan carpenter
next prev parent reply other threads:[~2019-04-04 9:36 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-04 8:42 [PATCH] remoteproc: silence an uninitialized variable warning Dan Carpenter
2019-04-04 8:42 ` Dan Carpenter
2019-04-04 9:17 ` Mukesh Ojha
2019-04-04 9:29 ` Mukesh Ojha
2019-04-04 9:36 ` Dan Carpenter [this message]
2019-04-04 9:36 ` Dan Carpenter
2019-04-05 7:08 ` Mukesh Ojha
2019-04-05 7:20 ` Mukesh Ojha
2019-04-05 7:33 ` Dan Carpenter
2019-04-05 7:33 ` Dan Carpenter
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=20190404093622.GM32613@kadam \
--to=dan.carpenter@oracle.com \
--cc=andy.gross@linaro.org \
--cc=david.brown@linaro.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mojha@codeaurora.org \
/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.