Re: [PATCH 16/16] fix handling of integer constant expressions

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Arnd Bergmann
Date: Sunday, June 24, 2007 - 11:07 am

On Sunday 24 June 2007, Al Viro wrote:

Yes, looks good. I originally came up with _IOC_TYPECHECK before we had
the generic BUILD_BUG_ON(). 

One minor issue though:
While BUILD_BUG_ON and a few other macros in linux/kernel.h are currently
exported to user space, I would think that they should really be hidden
in #ifdef __KERNEL__, which means that we also need something like

#ifdef __KERNEL__
#define _IOC_TYPECHECK(t) \
        (sizeof(t) + BUILD_BUG_ON_ZERO(sizeof(t) == sizeof(t[1]) && \
          sizeof(t) < (1 << _IOC_SIZEBITS)))
#else
#define _IOC_TYPECHECK(t) sizeof(t)
#endif

	Arnd <><
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH 16/16] fix handling of integer constant expressions, Arnd Bergmann, (Sun Jun 24, 11:07 am)
Re: [PATCH 16/16] fix handling of integer constant expressions, Segher Boessenkool, (Sun Jun 24, 11:18 am)
Re: [PATCH 16/16] fix handling of integer constant expressions, Segher Boessenkool, (Sun Jun 24, 12:09 pm)
Re: [PATCH 16/16] fix handling of integer constant expressions, Segher Boessenkool, (Sun Jun 24, 12:40 pm)
Re: [PATCH 16/16] fix handling of integer constant expressions, Segher Boessenkool, (Sun Jun 24, 11:13 pm)
Re: [PATCH 16/16] fix handling of integer constant expressions, Segher Boessenkool, (Sun Jun 24, 11:16 pm)
Re: [PATCH 16/16] fix handling of integer constant expressions, Segher Boessenkool, (Thu Jun 28, 2:08 am)