Re: [PATCH] staging: media: atomisp: Replace scnprintf with sysfs_emit in bo_show
From: Andy Shevchenko
Date: Mon Jun 23 2025 - 10:40:12 EST
On Mon, Jun 23, 2025 at 05:16:57PM +0300, Dan Carpenter wrote:
> On Sat, Jun 21, 2025 at 09:24:40PM +0300, Andy Shevchenko wrote:
> > On Sat, Jun 21, 2025 at 9:30 AM Abdelrahman Fekry
...
> > > - ret = scnprintf(buf, PAGE_SIZE, "type pgnr\n");
> > > - if (ret <= 0)
> > > - return 0;
> > > -
> > > - index1 += ret;
> > > + offset += sysfs_emit(buf, "type pgnr\n");
> >
> > This changes the behaviour in case the sysfs_emit() fails. Not that
> > this is a big issue, but it should be pointed out somewhere.
>
> Neither scnprintf() nor sysfs_emit() can return negatives.
Good, that's what I asked the author to investigate and add the respective
comment / update commit message accordingly.
--
With Best Regards,
Andy Shevchenko