All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dien Pham <dien.pham.ry@renesas.com>
To: Sudeep Holla <sudeep.holla@arm.com>
Cc: "linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>,
	"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
	Stephen Boyd <sboyd@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Michael Turquette <mturquette@baylibre.com>
Subject: RE: [PATCH 1/2] firmware: arm_scmi: Keep the discrete clock rates sorted
Date: Thu, 9 Jul 2020 08:53:44 +0000	[thread overview]
Message-ID: <OSBPR01MB402413D62446CFC9FE2B18E9D1640@OSBPR01MB4024.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <20200709083808.GB31544@bogus>

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]
>  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.
> >                 if (tot_rate_cnt + num_returned > SCMI_MAX_NUM_RATES) {
> >                         dev_err(handle->dev, "No. of rates > MAX_NUM_RATES");
> >                         break;
> >                 }

Best regard,
DIEN Pham

WARNING: multiple messages have this Message-ID (diff)
From: Dien Pham <dien.pham.ry@renesas.com>
To: Sudeep Holla <sudeep.holla@arm.com>
Cc: Stephen Boyd <sboyd@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH 1/2] firmware: arm_scmi: Keep the discrete clock rates sorted
Date: Thu, 9 Jul 2020 08:53:44 +0000	[thread overview]
Message-ID: <OSBPR01MB402413D62446CFC9FE2B18E9D1640@OSBPR01MB4024.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <20200709083808.GB31544@bogus>

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]
>  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.
> >                 if (tot_rate_cnt + num_returned > SCMI_MAX_NUM_RATES) {
> >                         dev_err(handle->dev, "No. of rates > MAX_NUM_RATES");
> >                         break;
> >                 }

Best regard,
DIEN Pham

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  reply	other threads:[~2020-07-09  8:53 UTC|newest]

Thread overview: 15+ 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 ` 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 11:07   ` Sudeep Holla
2020-07-08 18:44   ` kernel test robot
2020-07-08 20:24   ` 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:20   ` Dien Pham
2020-07-09  8:38   ` Sudeep Holla
2020-07-09  8:38     ` Sudeep Holla
2020-07-09  8:53     ` Dien Pham [this message]
2020-07-09  8:53       ` Dien Pham
2020-07-09  9:47       ` Sudeep Holla
2020-07-09  9:47         ` Sudeep Holla

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=OSBPR01MB402413D62446CFC9FE2B18E9D1640@OSBPR01MB4024.jpnprd01.prod.outlook.com \
    --to=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 \
    --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 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.