Re: [RFC] A need for "yesno"-function? (and "cleanup" of kernel.h)

2007-03-16 Thread Richard Knutsson
Jan Engelhardt wrote: On Mar 16 2007 16:24, Richard Knutsson wrote: char yesno_chr(const bool value) { return "ny"[value]; } char *yesno_str(const bool value) { return &"no\0yes"[3 * value]; } static/extern const char *const yesno[] = {"no", "yes"}; static inline

Re: [RFC] A need for "yesno"-function? (and "cleanup" of kernel.h) (was: Re: [KJ] [RFC] A need for a "yesno"-function?)

2007-03-16 Thread Jan Engelhardt
On Mar 16 2007 16:24, Richard Knutsson wrote: >> > >> > char yesno_chr(const bool value) >> > { >> >return "ny"[value]; >> > } >> > >> > char *yesno_str(const bool value) >> > { >> >return &"no\0yes"[3 * value]; >> > } static/extern const char *const yesno[] = {"no", "yes"};

Re: [RFC] A need for "yesno"-function? (and "cleanup" of kernel.h) (was: Re: [KJ] [RFC] A need for a "yesno"-function?)

2007-03-16 Thread Richard Knutsson
Bernd Petrovitsch wrote: On Fri, 2007-03-16 at 16:24 +0100, Richard Knutsson wrote: [...] more readable). The big problem is, where to put it? Seems wrong to put in since it appear to be a replica of userspace's (otherwise, why put mem*-functions in there?). memcpy(3) and memcmp(3)

Re: [RFC] A need for "yesno"-function? (and "cleanup" of kernel.h)

2007-03-16 Thread Bernd Petrovitsch
On Fri, 2007-03-16 at 18:09 +0100, Richard Knutsson wrote: > Bernd Petrovitsch wrote: > > On Fri, 2007-03-16 at 16:24 +0100, Richard Knutsson wrote: > > [...] > > > >> more readable). The big problem is, where to put it? Seems wrong to put > >> in since it appear to be a replica of

Re: [RFC] A need for "yesno"-function? (and "cleanup" of kernel.h) (was: Re: [KJ] [RFC] A need for a "yesno"-function?)

2007-03-16 Thread Bernd Petrovitsch
On Fri, 2007-03-16 at 16:24 +0100, Richard Knutsson wrote: [...] > more readable). The big problem is, where to put it? Seems wrong to put > in since it appear to be a replica of userspace's > (otherwise, why put mem*-functions in there?). memcpy(3) and memcmp(3) are also there in user-space.

[RFC] A need for "yesno"-function? (and "cleanup" of kernel.h) (was: Re: [KJ] [RFC] A need for a "yesno"-function?)

2007-03-16 Thread Richard Knutsson
Added LKML to the Cc: to see if there is someone there who also have any comments... Arnaldo Carvalho de Melo wrote: On 3/15/07, Richard Knutsson <[EMAIL PROTECTED]> wrote: Hi Was just checking up the 'sparse' when I saw something like "abc"[value] and thought: what about the (statement) ?

[RFC] A need for yesno-function? (and cleanup of kernel.h) (was: Re: [KJ] [RFC] A need for a yesno-function?)

2007-03-16 Thread Richard Knutsson
Added LKML to the Cc: to see if there is someone there who also have any comments... Arnaldo Carvalho de Melo wrote: On 3/15/07, Richard Knutsson [EMAIL PROTECTED] wrote: Hi Was just checking up the 'sparse' when I saw something like abc[value] and thought: what about the (statement) ? yes :

Re: [RFC] A need for yesno-function? (and cleanup of kernel.h) (was: Re: [KJ] [RFC] A need for a yesno-function?)

2007-03-16 Thread Bernd Petrovitsch
On Fri, 2007-03-16 at 16:24 +0100, Richard Knutsson wrote: [...] more readable). The big problem is, where to put it? Seems wrong to put in linux/string.h since it appear to be a replica of userspace's string.h (otherwise, why put mem*-functions in there?). memcpy(3) and memcmp(3) are also

Re: [RFC] A need for yesno-function? (and cleanup of kernel.h)

2007-03-16 Thread Bernd Petrovitsch
On Fri, 2007-03-16 at 18:09 +0100, Richard Knutsson wrote: Bernd Petrovitsch wrote: On Fri, 2007-03-16 at 16:24 +0100, Richard Knutsson wrote: [...] more readable). The big problem is, where to put it? Seems wrong to put in linux/string.h since it appear to be a replica of

Re: [RFC] A need for yesno-function? (and cleanup of kernel.h) (was: Re: [KJ] [RFC] A need for a yesno-function?)

2007-03-16 Thread Richard Knutsson
Bernd Petrovitsch wrote: On Fri, 2007-03-16 at 16:24 +0100, Richard Knutsson wrote: [...] more readable). The big problem is, where to put it? Seems wrong to put in linux/string.h since it appear to be a replica of userspace's string.h (otherwise, why put mem*-functions in there?).

Re: [RFC] A need for yesno-function? (and cleanup of kernel.h) (was: Re: [KJ] [RFC] A need for a yesno-function?)

2007-03-16 Thread Jan Engelhardt
On Mar 16 2007 16:24, Richard Knutsson wrote: char yesno_chr(const bool value) { return ny[value]; } char *yesno_str(const bool value) { return no\0yes[3 * value]; } static/extern const char *const yesno[] = {no, yes}; static inline const char *yesno_str(bool

Re: [RFC] A need for yesno-function? (and cleanup of kernel.h)

2007-03-16 Thread Richard Knutsson
Jan Engelhardt wrote: On Mar 16 2007 16:24, Richard Knutsson wrote: char yesno_chr(const bool value) { return ny[value]; } char *yesno_str(const bool value) { return no\0yes[3 * value]; } static/extern const char *const yesno[] = {no, yes}; static inline const char