[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aFwCCw6K2NWuz5XZ@pluto>
Date: Wed, 25 Jun 2025 15:04:59 +0100
From: Cristian Marussi <cristian.marussi@....com>
To: Dan Carpenter <dan.carpenter@...aro.org>
Cc: Cristian Marussi <cristian.marussi@....com>,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
arm-scmi@...r.kernel.org, sudeep.holla@....com,
james.quinlan@...adcom.com, f.fainelli@...il.com,
vincent.guittot@...aro.org, etienne.carriere@...com,
peng.fan@....nxp.com, michal.simek@....com, quic_sibis@...cinc.com,
d-gole@...com, souvik.chakravarty@....com
Subject: Re: [RFC PATCH 3/7] firmware: arm_scmi: Add Telemetry protocol
support
On Sat, Jun 21, 2025 at 12:01:23AM +0300, Dan Carpenter wrote:
> On Fri, Jun 20, 2025 at 08:28:09PM +0100, Cristian Marussi wrote:
> > + /* Build compsing DES string */
> > + for (int i = 0; i < ti->info.num_groups; i++) {
> > + struct scmi_telemetry_group *grp = &ti->info.des_groups[i];
> > + char *buf = grp->des_str;
> > + size_t bufsize = grp->des_str_sz;
> > +
> > + for (int j = 0; j < grp->num_de; j++) {
> > + char term = j != (grp->num_de - 1) ? ' ' : '\0';
> > + int len;
> > +
> > + len = snprintf(buf, bufsize, "0x%04X%c",
> > + ti->info.des[grp->des[j]]->id, term);
>
> Please use scnprintf() btw. Otherwise if there is an overflow the
> next iteration will complain that bufsize is negative.
Yes, I will review all of this.
Thanks,
Cristian
Powered by blists - more mailing lists