Re: [PATCH 1/2] Add lib/glob.c

2014-05-12 Thread Andrew Morton
On Sat, 10 May 2014 08:21:38 -0400 Tejun Heo wrote: > > +int > > +main(void) > > +{ > > + size_t i; > > + > > + for (i = 0; i < sizeof(tests)/sizeof(*tests); i++) > > + test(tests + i); > > + > > + return 0; > > +} > > + > > +#endif /* UNITTEST */ > > Again, I don't really

Re: [PATCH 1/2] Add lib/glob.c

2014-05-12 Thread Andrew Morton
On Sat, 10 May 2014 08:21:38 -0400 Tejun Heo t...@kernel.org wrote: +int +main(void) +{ + size_t i; + + for (i = 0; i sizeof(tests)/sizeof(*tests); i++) + test(tests + i); + + return 0; +} + +#endif /* UNITTEST */ Again, I don't really think the

Re: [PATCH 1/2] Add lib/glob.c

2014-05-11 Thread Tejun Heo
On Sat, May 10, 2014 at 10:29:18AM -0700, Randy Dunlap wrote: > > + select this option. Say N unless you are compiling an out-of > > + tree driver which tells you it depend on it. > > To support out-of-tree drivers, I'm pretty sure that you will need > to use obj- instead of

Re: [PATCH 1/2] Add lib/glob.c

2014-05-11 Thread George Spelvin
On Sat, 10 May 2014 08:21:38 -0400, Tejun Heo wrote: > On Fri, May 09, 2014 at 11:13:56PM -0400, George Spelvin wrote: >> +config GLOB >> +tristate >> +# (Prompt disabled to reduce kbuild clutter until someone needs it.) >> +# prompt "glob_match() function" >> +help >> + This

Re: [PATCH 1/2] Add lib/glob.c

2014-05-11 Thread George Spelvin
On Sat, 10 May 2014 08:21:38 -0400, Tejun Heo wrote: On Fri, May 09, 2014 at 11:13:56PM -0400, George Spelvin wrote: +config GLOB +tristate +# (Prompt disabled to reduce kbuild clutter until someone needs it.) +# prompt glob_match() function +help + This option provides a

Re: [PATCH 1/2] Add lib/glob.c

2014-05-11 Thread Tejun Heo
On Sat, May 10, 2014 at 10:29:18AM -0700, Randy Dunlap wrote: + select this option. Say N unless you are compiling an out-of + tree driver which tells you it depend on it. To support out-of-tree drivers, I'm pretty sure that you will need to use obj- instead of lib-.

Re: [PATCH 1/2] Add lib/glob.c

2014-05-10 Thread Randy Dunlap
On 05/09/2014 08:13 PM, George Spelvin wrote: > This is a helper function from drivers/ata/libata_core.c, where it is used > to blacklist particular device models. It's being moved to lib/ so other > drivers may use it for the same purpose. > > This implementation in non-recursive, so is safe

Re: [PATCH 1/2] Add lib/glob.c

2014-05-10 Thread Randy Dunlap
On 05/10/2014 07:03 AM, George Spelvin wrote: > Thanks a lot for the feedback! > >> On Fri, May 09, 2014 at 11:13:56PM -0400, George Spelvin wrote: >>> +/** >>> + * glob_match - Shell-style pattern matching, like !fnmatch(pat, str, 0) >>> + * @pat: Pattern to match. Metacharacters are ?, *, [

Re: [PATCH 1/2] Add lib/glob.c

2014-05-10 Thread George Spelvin
Thanks a lot for the feedback! > On Fri, May 09, 2014 at 11:13:56PM -0400, George Spelvin wrote: >> +/** >> + * glob_match - Shell-style pattern matching, like !fnmatch(pat, str, 0) >> + * @pat: Pattern to match. Metacharacters are ?, *, [ and \. >> + * (And, inside character classes, !, -

Re: [PATCH 1/2] Add lib/glob.c

2014-05-10 Thread Tejun Heo
Ooh, one more nitpick. On Fri, May 09, 2014 at 11:13:56PM -0400, George Spelvin wrote: > +/** > + * glob_match - Shell-style pattern matching, like !fnmatch(pat, str, 0) > + * @pat: Pattern to match. Metacharacters are ?, *, [ and \. > + * (And, inside character classes, !, - and ].) @ARG

Re: [PATCH 1/2] Add lib/glob.c

2014-05-10 Thread Tejun Heo
Hello, On Fri, May 09, 2014 at 11:13:56PM -0400, George Spelvin wrote: > +config GLOB > + tristate > +#(Prompt disabled to reduce kbuild clutter until someone needs it.) > +#prompt "glob_match() function" > + help > + This option provides a glob_match function for performing

Re: [PATCH 1/2] Add lib/glob.c

2014-05-10 Thread Tejun Heo
Hello, On Fri, May 09, 2014 at 11:13:56PM -0400, George Spelvin wrote: +config GLOB + tristate +#(Prompt disabled to reduce kbuild clutter until someone needs it.) +#prompt glob_match() function + help + This option provides a glob_match function for performing simple

Re: [PATCH 1/2] Add lib/glob.c

2014-05-10 Thread Tejun Heo
Ooh, one more nitpick. On Fri, May 09, 2014 at 11:13:56PM -0400, George Spelvin wrote: +/** + * glob_match - Shell-style pattern matching, like !fnmatch(pat, str, 0) + * @pat: Pattern to match. Metacharacters are ?, *, [ and \. + * (And, inside character classes, !, - and ].) @ARG

Re: [PATCH 1/2] Add lib/glob.c

2014-05-10 Thread George Spelvin
Thanks a lot for the feedback! On Fri, May 09, 2014 at 11:13:56PM -0400, George Spelvin wrote: +/** + * glob_match - Shell-style pattern matching, like !fnmatch(pat, str, 0) + * @pat: Pattern to match. Metacharacters are ?, *, [ and \. + * (And, inside character classes, !, - and ].)

Re: [PATCH 1/2] Add lib/glob.c

2014-05-10 Thread Randy Dunlap
On 05/10/2014 07:03 AM, George Spelvin wrote: Thanks a lot for the feedback! On Fri, May 09, 2014 at 11:13:56PM -0400, George Spelvin wrote: +/** + * glob_match - Shell-style pattern matching, like !fnmatch(pat, str, 0) + * @pat: Pattern to match. Metacharacters are ?, *, [ and \. + *

Re: [PATCH 1/2] Add lib/glob.c

2014-05-10 Thread Randy Dunlap
On 05/09/2014 08:13 PM, George Spelvin wrote: This is a helper function from drivers/ata/libata_core.c, where it is used to blacklist particular device models. It's being moved to lib/ so other drivers may use it for the same purpose. This implementation in non-recursive, so is safe for the