[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMRc=MfzXbuJb1hYe57MeMXkNaXPg8_Ei0Y=JURyCCoXBffhtg@mail.gmail.com>
Date: Fri, 11 Aug 2023 15:39:08 +0200
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: Linus Walleij <linus.walleij@...aro.org>,
Kent Gibson <warthog618@...il.com>,
Viresh Kumar <viresh.kumar@...aro.org>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
Bartosz Golaszewski <bartosz.golaszewski@...aro.org>
Subject: Re: [PATCH v2] gpio: consumer: new virtual driver
On Thu, Aug 10, 2023 at 4:53 PM Andy Shevchenko
<andriy.shevchenko@...ux.intel.com> wrote:
>
[snip]
>
> > > This can be avoided by
> > >
> > > key = kstrndup(skip_spaces(page), count, GFP_KERNEL);
> > >
> > > no?
> > >
> >
> > No, because we also want to remove the trailing spaces and newlines.
> > But if you have a different suggestion with existing helpers, let me
> > know. I didn't find any.
>
> kstrto*() are newline friendly. The rest as you noted can be covered with
> sysfs_streq() / sysfs_match_string().
It's a kstrndup() not a kstrtosomething(). It's not newline friendly.
Bart
[snip]
Powered by blists - more mailing lists