This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [parisc-linux] Re: [PATCH] Fix the atomic compare and swap function on hppa


On 5/22/07, Kyle McMartin <kyle@mcmartin.ca> wrote:
> +/* The only basic operation needed is compare and exchange.
> +   -11 corresponds to -EAGAIN, and -45 to -EDEADLOCK. The constants
> +   must stay the same to avoid breaking backwards compatibility.
> +
> +   The check for -EDEADLOCK workarounds a kernel bug (debugging code
> +   enabled by default). */

This is stupid. Why not just use the symbol and then #undef it
immediately afterwards? For extra paranoia name it LWS_RET_EAGAIN or
something.

The code shouldn't undefine or define anything a user might define. All the constants have to go away. This header needs a rewrite.

Putting magic numbers in the code is irritating and makes it more
difficult to read it on a glance.

I agree, however this is a good initial fix.


Cheers,
Carlos.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]