Messages in this thread | | | Date | Thu, 19 Aug 1999 13:59:21 -0700 (PDT) | From | Linus Torvalds <> | Subject | Re: [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/
| |