[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b33a0c18-2850-453f-8ee6-5574330b3670@suswa.mountain>
Date: Sat, 21 Jun 2025 00:01:23 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Cristian Marussi <cristian.marussi@....com>
Cc: 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 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.
> +
> + buf += len;
> + bufsize -= len;
> + }
> + }
> +
> + return 0;
> +}
regards,
dan carpenter
Powered by blists - more mailing lists