Messages in this thread | | | Date | Mon, 30 May 2022 10:04:44 +0100 | From | Cristian Marussi <> | Subject | Re: [kbuild] drivers/firmware/arm_scmi/clock.c:242:40: warning: Variable 'msg' is not assigned a value. [unassignedVariable] |
| |
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.
Thanks, Cristian
| |