Re: [PATCH] readX_relaxed interface

From: Linus Torvalds
Date: Fri Jan 16 2004 - 00:29:53 EST




On Thu, 15 Jan 2004, Greg KH wrote:
>
> It looks ok, but it would really be good if we could indicate if the
> read actually was successful. Right now some platforms can detect
> faults and do not have a way to get that error back to the driver in a
> sane manner. If we were to change the read* functions to look something
> like:
> int readb(void *addr, u8 *data);
> it would be a world easier.

NOOOO!

Please don't. 99.99% of all uses don't care one whit, and an interface
like the above ends up being total cr*p to use.

If you care about machine check errors, use a special interface for that.
A _really_ special one. Especially as on many systems you'll likely have
to read status registers etc (and clear them before doing the IO) to see
the errors.

So that way you can get errors working, AND it won't actually make normal
code any uglier.

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