Re: Re: [PATCH] Fix the atomic compare and swap function on hppa
"Carlos O'Donell" <[email protected]>
| Newsgroups | gmane.linux.ports.hppa |
|---|---|
| Message-ID | <[email protected]> |
On 5/22/07, Kyle McMartin <[email protected]> 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.