From: Cristian Marussi <cristian.marussi@arm.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: kbuild@lists.01.org, lkp@intel.com, kbuild-all@lists.01.org,
linux-kernel@vger.kernel.org, Sudeep Holla <sudeep.holla@arm.com>
Subject: Re: [kbuild] drivers/firmware/arm_scmi/clock.c:242:40: warning: Variable 'msg' is not assigned a value. [unassignedVariable]
Date: Mon, 30 May 2022 11:08:59 +0100 [thread overview]
Message-ID: <YpSR3SV3CVrDEyi5@e120937-lin> (raw)
In-Reply-To: <YpSIrIxrqdUn4Lpf@e120937-lin>
On Mon, May 30, 2022 at 10:04:55AM +0100, Cristian Marussi wrote:
> On Fri, May 27, 2022 at 11:57:29AM +0300, Dan Carpenter wrote:
> > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > head: 7e284070abe53d448517b80493863595af4ab5f0
> > commit: 7bc7caafe6b1e5b882255a42bc1bf112fa87b69b firmware: arm_scmi: Use common iterators in the clock protocol
> > compiler: arm-linux-gnueabi-gcc (GCC) 11.3.0
> > reproduce (cppcheck warning):
> > # apt-get install cppcheck
> > git checkout 7bc7caafe6b1e5b882255a42bc1bf112fa87b69b
> > cppcheck --quiet --enable=style,performance,portability --template=gcc FILE
> >
> > If you fix the issue, kindly add following tag where applicable
> > Reported-by: kernel test robot <lkp@intel.com>
> >
>
> Hi Dan,
>
> thanks for the report.
>
> > cppcheck possible warnings: (new ones prefixed by >>, may not real problems)
> >
> > >> drivers/firmware/arm_scmi/clock.c:242:40: warning: Variable 'msg' is not assigned a value. [unassignedVariable]
> > struct scmi_msg_clock_describe_rates *msg;
> > ^
> >
> > vim +/msg +242 drivers/firmware/arm_scmi/clock.c
> >
> > 7bc7caafe6b1e5 Cristian Marussi 2022-03-30 235 static int
> > 7bc7caafe6b1e5 Cristian Marussi 2022-03-30 236 scmi_clock_describe_rates_get(const struct scmi_protocol_handle *ph, u32 clk_id,
> > 7bc7caafe6b1e5 Cristian Marussi 2022-03-30 237 struct scmi_clock_info *clk)
> > 7bc7caafe6b1e5 Cristian Marussi 2022-03-30 238 {
> > 7bc7caafe6b1e5 Cristian Marussi 2022-03-30 239 int ret;
> > 5f6c6430e904d2 Sudeep Holla 2017-06-06 240
> >
> > Please delete the blank line.
>
> I'll do.
>
> >
> > 7bc7caafe6b1e5 Cristian Marussi 2022-03-30 241 void *iter;
> > 7bc7caafe6b1e5 Cristian Marussi 2022-03-30 @242 struct scmi_msg_clock_describe_rates *msg;
> >
> > I was so surprised that GCC doesn't warn about this but "msg" is only
> > used to calculate the sizeof(*msg).
> >
>
> Probably a leftover from a previous version of the series where msg was
> usaed not only for sizeof()....I'll send a fix anyway to silence the
> bot.
... and btw there are a bunch of similar other sizeof(*msg) in a few
other SCMI protocols when calling the same response_init() helper...
..even though innocuos...I'll fix all of these to avoid needless stuff
on the stack.
Thanks,
Cristian
prev parent reply other threads:[~2022-05-30 10:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-27 8:57 Dan Carpenter
2022-05-30 9:04 ` Cristian Marussi
2022-05-30 10:08 ` Cristian Marussi [this message]
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=YpSR3SV3CVrDEyi5@e120937-lin \
--to=cristian.marussi@arm.com \
--cc=dan.carpenter@oracle.com \
--cc=kbuild-all@lists.01.org \
--cc=kbuild@lists.01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lkp@intel.com \
--cc=sudeep.holla@arm.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
all inboxes | Powered by JetHome®