[RFC PATCH 3/7] firmware: arm_scmi: Add Telemetry protocol support

Cristian Marussi cristian.marussi at arm.com
Wed Jun 25 07:04:59 PDT 2025


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



More information about the linux-arm-kernel mailing list