lkml.org 
[lkml]   [1999]   [Aug]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] 2.3.14: bug-fix for raw IO error recovery


On Fri, 20 Aug 1999, Chris Wedgwood wrote:
>
> what about something like:
>
> blah = (void*) (~0uL)
>
> sort of thing? (Assuming sizeof(long) == sizeof(void*))

The thing is, that this is exactly what ERR_PTR and friends are there for,
and they do it RIGHT instead of just making assumptions about things. So
use them - they actually result in readable code when done right, as shown
by the dcache usage, and they do not have any gray areas.

Yes, right now "(void *) (~0UL)" would work fine. It probably will
forever. But you might as well use ERR_PTR(-1) which does the same thing,
is more readable, and is _guaranteed_ to work forever simply because it
can be changed without breaking existing sources when some new
architecture comes along.

Linus


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

\
 
 \ /
  Last update: 2005-03-22 13:53    [W:0.086 / U:0.900 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site