Re: [PATCH 1/2] lib: make TOLOWER macro public

From: Andy Shevchenko
Date: Mon Jul 18 2011 - 06:37:01 EST


On Mon, 2011-07-18 at 13:25 +0300, Alexey Dobriyan wrote:
> NAK
> This macro sucks because name doesn't reflect hackish nature.
> _tolower() should be moved into public header.
>
Makes sense. I think whole _tolower() could be moved to kernel.h.

> On Mon, Jul 18, 2011 at 11:23 AM, Andy Shevchenko
> <andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> > This macro is required by *printf and kstrto* functions that are located
> > in the different modules. This patch makes TOLOWER macro public.
> > However, it's good idea to not use the macro outside of mentioned
> > functions.
>
> > --- a/include/linux/kernel.h
> > +++ b/include/linux/kernel.h
>
> > +/* Works only for digits and letters, but small and fast */
> > +#define TOLOWER(x) ((x) | 0x20)
>
> > --- a/lib/kstrtox.c
> > +++ b/lib/kstrtox.c
> > @@ -19,11 +19,6 @@
> > #include <linux/types.h>
> > #include <asm/uaccess.h>
> >
> > -static inline char _tolower(const char c)
> > -{
> > - return c | 0x20;
> > -}

--
Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
Intel Finland Oy
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/