If you do:
#define request_region(start, n, name)
({
__request_region(start, n, name);
(struct resource *)1;
})
#define release_region(start, n) do { } while (0)
then the compiler will remove all those error checks for you,
as well as the release_region calls.
Of course if you actually want to use the innards of the
returned resource * then that's not so good.
However, you can make it:
#define request_region() \
({ \
struct resource *r; \
r = __request_region(); \
(struct resource *)((long)r | 1); \
})
and, amazingly, the compiler still knows that the value
is non-zero, and still will elide those tests. You'll
need to mask that bit off again to use the pointer.
Whether you'll stoop this low depends upon how much you
want those bytes back :)
-
-
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/