Re: [PATCH] staging: media: atomisp: Replace scnprintf with sysfs_emit in bo_show

From: Dan Carpenter
Date: Mon Jun 23 2025 - 10:18:32 EST


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.

regards,
dan carpenter