lkml.org 
[lkml]   [2007]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -mm] Introduce U16_MAX and U32_MAX


On Tue, 31 Jul 2007, Andrew Morton wrote:

> On Tue, 31 Jul 2007 21:56:12 +0530 (IST)
> Satyam Sharma <satyam@infradead.org> wrote:
>
> > --- a/include/linux/kernel.h
> > +++ b/include/linux/kernel.h
> > @@ -30,6 +30,9 @@ extern const char linux_proc_banner[];
> > #define LLONG_MIN (-LLONG_MAX - 1)
> > #define ULLONG_MAX (~0ULL)
> >
> > +#define U16_MAX ((u16) ~0U)
> > +#define U32_MAX ((u32) ~0U)
> > +
>
> hm, I'd have thought that there's a risk of gcc warnings here, forcing
> 0xffffffff into a u16, but apparently not.
>
> Still, I think it'd be tidier here to tell the truth and use plain
> old 0xffff and 0xffffffff?

Hmm, that does make sense, actually -- in fact that's the only _really_
correct way to define u32_max / u16_max, I'd say. I probably got confused
seeing those bad examples in reiserfs and tcp_illinois ;-)

Thanks.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-07-31 21:15    [W:0.065 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site