From: Sudeep Holla <sudeep.holla@arm.com>
To: Dien Pham <dien.pham.ry@renesas.com>
Cc: Stephen Boyd <sboyd@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Sudeep Holla <sudeep.holla@arm.com>,
"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
"linux-arm-kernel@lists.infradead.org"
<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 1/2] firmware: arm_scmi: Keep the discrete clock rates sorted
Date: Thu, 9 Jul 2020 10:47:13 +0100 [thread overview]
Message-ID: <20200709094713.GD31544@bogus> (raw)
In-Reply-To: <OSBPR01MB402413D62446CFC9FE2B18E9D1640@OSBPR01MB4024.jpnprd01.prod.outlook.com>
On Thu, Jul 09, 2020 at 08:53:44AM +0000, Dien Pham wrote:
> Dear Sudeep-san,
>
> > > >+}
> > > >+
> > > > static int
> > > > scmi_clock_describe_rates_get(const struct scmi_handle *handle, u32 clk_id,
> > > > struct scmi_clock_info *clk) @@ -184,8 +193,10 @@
> > > >scmi_clock_describe_rates_get(const struct scmi_handle *handle, u32 clk_id,
> > > > */
> > > > } while (num_returned && num_remaining);
> > > >
> > > >- if (rate_discrete)
> > > >+ if (rate_discrete) {
> > > > clk->list.num_rates = tot_rate_cnt;
> > > >+ sort(rate, tot_rate_cnt, sizeof(*rate), rate_cmp_func, NULL);
> > >
> > > About warning of above line, I think it relates to below snip of code:
> > > if (tot_rate_cnt + num_returned > SCMI_MAX_NUM_RATES) {
> > > dev_err(handle->dev, "No. of rates > MAX_NUM_RATES");
> > > break;
> > > }
> > >
> >
> > I don't understand your comment and relation to above warning.
>
> I'd like to mention about below warning.
>
> >drivers/firmware/arm_scmi/clock.c: In function 'scmi_clock_protocol_init':
> >drivers/firmware/arm_scmi/clock.c:197:3: warning: 'rate' may be used uninitialized in this function [-Wmaybe-uninitialized]
Ah ok, sorry I didn't see this one. I am unable to observe this in the
default build, I will check with W=1. Thanks for that.
> > sort(rate, tot_rate_cnt, sizeof(*rate), rate_cmp_func, NULL);
>
> The warning for line
> > > >+ sort(rate, tot_rate_cnt, sizeof(*rate), rate_cmp_func, NULL);
>
> But, I think that it is affected by 'break' of below line. And for fixing
> this warning, I think we should fix inside this 'if' block.
OK will take a look.
--
Regards,
Sudeep
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2020-07-09 9:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-08 11:07 [PATCH 1/2] firmware: arm_scmi: Keep the discrete clock rates sorted Sudeep Holla
2020-07-08 11:07 ` [PATCH 2/2] clk: scmi: Fix min and max rate when registering clocks with discrete rates Sudeep Holla
2020-07-08 20:24 ` Sudeep Holla
2020-07-09 8:20 ` [PATCH 1/2] firmware: arm_scmi: Keep the discrete clock rates sorted Dien Pham
2020-07-09 8:38 ` Sudeep Holla
2020-07-09 8:53 ` Dien Pham
2020-07-09 9:47 ` Sudeep Holla [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=20200709094713.GD31544@bogus \
--to=sudeep.holla@arm.com \
--cc=dien.pham.ry@renesas.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mturquette@baylibre.com \
--cc=sboyd@kernel.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 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).