[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAGn2d8NgZ1YMj3eSsujWjF6ppwMkOTJLvk2hVcXfUdkyq5TdyQ@mail.gmail.com>
Date: Sun, 22 Jun 2025 09:36:05 +0300
From: Abdelrahman Fekry <abdelrahmanfekry375@...il.com>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: andy@...nel.org, hansg@...nel.org, mchehab@...nel.org,
sakari.ailus@...ux.intel.com, gregkh@...uxfoundation.org,
linux-kernel@...r.kernel.org, linux-media@...r.kernel.org,
linux-staging@...ts.linux.dev, skhan@...uxfoundation.org,
linux-kernel-mentees@...ts.linux.dev
Subject: Re: [PATCH] staging: media: atomisp: Replace scnprintf with
sysfs_emit in bo_show
Thanks for the review
On Sat, Jun 21, 2025 at 9:25 PM Andy Shevchenko
<andy.shevchenko@...il.com> wrote:
>
> On Sat, Jun 21, 2025 at 9:30 AM Abdelrahman Fekry
> <abdelrahmanfekry375@...il.com> wrote:
> >
> > Convert buffer output to use sysfs_emit/sysfs_emit_at API for safer
> > PAGE_SIZE handling and standardized sysfs output.
>
> ...
>
> > - ssize_t ret = 0;
> > + ssize_t offset = 0;
>
> It would be good to move this...
>
> > struct hmm_buffer_object *bo;
> > unsigned long flags;
> > int i;
> > long total[HMM_BO_LAST] = { 0 };
> > long count[HMM_BO_LAST] = { 0 };
> > - int index1 = 0;
> > - int index2 = 0;
>
> ...to be here.
noted , thanks.
> >
> > - 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.
noted , will make a comment about it.
> ...
>
> > + /* Direct return of accumlated length */
>
> accumulated
>
> Don't forget to run a spell-checker.
>
noted .
> --
> With Best Regards,
> Andy Shevchenko
Powered by blists - more mailing lists