Re: [PATCH v4] lib/string: Introduce sysfs_streqcase

2021-04-09 Thread Gioh Kim
On Fri, Apr 9, 2021 at 9:11 AM Andy Shevchenko wrote: > > > > On Friday, April 9, 2021, Andrew Morton wrote: >> >> On Thu, 8 Apr 2021 15:06:05 +0200 Gioh Kim wrote: >> >> > As the name shows, it checks if strings are equal in case insensitive >> > manner. >> >> Peh. Who would die if we simply

Re: [PATCH v4] lib/string: Introduce sysfs_streqcase

2021-04-08 Thread Greg Kroah-Hartman
On Thu, Apr 08, 2021 at 11:51:32PM -0700, Andrew Morton wrote: > On Fri, 9 Apr 2021 08:44:39 +0200 Greg Kroah-Hartman > wrote: > > > On Thu, Apr 08, 2021 at 10:05:02PM -0700, Andrew Morton wrote: > > > On Thu, 8 Apr 2021 15:06:05 +0200 Gioh Kim wrote: > > > > > > > As the name shows, it check

Re: [PATCH v4] lib/string: Introduce sysfs_streqcase

2021-04-08 Thread Andrew Morton
On Fri, 9 Apr 2021 08:44:39 +0200 Greg Kroah-Hartman wrote: > On Thu, Apr 08, 2021 at 10:05:02PM -0700, Andrew Morton wrote: > > On Thu, 8 Apr 2021 15:06:05 +0200 Gioh Kim wrote: > > > > > As the name shows, it checks if strings are equal in case insensitive > > > manner. > > > > Peh. Who w

Re: [PATCH v4] lib/string: Introduce sysfs_streqcase

2021-04-08 Thread Greg Kroah-Hartman
On Thu, Apr 08, 2021 at 10:05:02PM -0700, Andrew Morton wrote: > On Thu, 8 Apr 2021 15:06:05 +0200 Gioh Kim wrote: > > > As the name shows, it checks if strings are equal in case insensitive > > manner. > > Peh. Who would die if we simply made sysfs_streq() case-insensitive? I doubt anyone, l

Re: [PATCH v4] lib/string: Introduce sysfs_streqcase

2021-04-08 Thread Andrew Morton
On Thu, 8 Apr 2021 15:06:05 +0200 Gioh Kim wrote: > As the name shows, it checks if strings are equal in case insensitive > manner. Peh. Who would die if we simply made sysfs_streq() case-insensitive?

Re: [PATCH v4] lib/string: Introduce sysfs_streqcase

2021-04-08 Thread Nick Desaulniers
On Thu, Apr 8, 2021 at 7:52 AM Gioh Kim wrote: > > On Thu, Apr 8, 2021 at 3:14 PM Jinpu Wang wrote: > > > > On Thu, Apr 8, 2021 at 3:06 PM Gioh Kim wrote: > > > > > > As the name shows, it checks if strings are equal in case insensitive > > > manner. > > > > > > For example, drivers/infiniband/u

Re: [PATCH v4] lib/string: Introduce sysfs_streqcase

2021-04-08 Thread Gioh Kim
On Thu, Apr 8, 2021 at 3:14 PM Jinpu Wang wrote: > > On Thu, Apr 8, 2021 at 3:06 PM Gioh Kim wrote: > > > > As the name shows, it checks if strings are equal in case insensitive > > manner. > > > > For example, drivers/infiniband/ulp/rtrs/rtrs-clt-sysfs.c uses > > strncasecmp to check that the in

Re: [PATCH v4] lib/string: Introduce sysfs_streqcase

2021-04-08 Thread Jinpu Wang
On Thu, Apr 8, 2021 at 3:06 PM Gioh Kim wrote: > > As the name shows, it checks if strings are equal in case insensitive > manner. > > For example, drivers/infiniband/ulp/rtrs/rtrs-clt-sysfs.c uses > strncasecmp to check that the input via sysfs is "mi". But it would > work even-if the input is "m

[PATCH v4] lib/string: Introduce sysfs_streqcase

2021-04-08 Thread Gioh Kim
As the name shows, it checks if strings are equal in case insensitive manner. For example, drivers/infiniband/ulp/rtrs/rtrs-clt-sysfs.c uses strncasecmp to check that the input via sysfs is "mi". But it would work even-if the input is "min-wrongcommand". I found some more cases using strncasecmp