Re: incompatibility due to change in bitops.h (solved)

Willem Riede (wriede@monmouth.com)
Thu, 29 May 1997 18:56:28 -0400


This is a multipart MIME message.

--===_0_Thu_May_29_18:56:11_EDT_1997
Content-Type: text/plain; charset=us-ascii

On Tue, 27 May 1997, "Willem Riede <wriede@monmouth.com>" <wriede@monmouth.com>
wrote:
> I was trying to upgrade to 2.1.40 (from 2.1.32) and ran into trouble
> compiling the ethernet boomerang driver 3c59x.c:
> ("3c900.c:v0.39 4/1/97 becker@cesdis.gsfc.nasa.gov\n")
>
> It uses set_bit from <asm/bitops.h> and uses the result value.
>
> Kernel 2.1.37 changed the definition of set_bit to return void rather than int.
>
> This breaks 3c59x.c :-(
>
I received the advice to substitute set_bit by test_and_set_bit. That
leads to the attached patch, and it seems to work fine so far.

YMMV. Willem Riede.

--===_0_Thu_May_29_18:56:11_EDT_1997
Content-Type: application/x-patch
Content-Description: 3c59x.patch

--- 3c59x.c.old Sun Apr 13 20:56:26 1997
+++ 3c59x.c Wed May 28 16:58:44 1997
@@ -1042,7 +1042,7 @@
}
#endif

- if (set_bit(0, (void*)&dev->tbusy) != 0) {
+ if (test_and_set_bit(0, (void*)&dev->tbusy) != 0) {
if (jiffies - dev->trans_start < TX_TIMEOUT)
return 1;
vortex_tx_timeout(dev);

--===_0_Thu_May_29_18:56:11_EDT_1997--