Subject: Re: port-mac68k/32583: mac68k netbsd-2 panics during rcp(1)
To: None <port-mac68k-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
List: netbsd-bugs
Date: 01/25/2006 21:25:02
The following reply was made to PR port-mac68k/32583; it has been noted by GNATS.
From: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>
To: Dave Huang <khym@azeotrope.org>
Cc: Hauke Fath <hauke@Espresso.Rhein-Neckar.DE>,
Scott Reynolds <scottr@clank.org>, port-mac68k-maintainer@netbsd.org,
gnats-bugs@netbsd.org
Subject: Re: port-mac68k/32583: mac68k netbsd-2 panics during rcp(1)
Date: Wed, 25 Jan 2006 22:06:29 +0100
At 16:53 Uhr -0600 24.1.2006, Dave Huang wrote:
>#define bus_space_set_region_2(t, h, o, val, c) do { \
> if (!c) panic("bus_space_set_region_2 called with zero count."); \
> (h).bssr2(t,&(h),o,val,c); } while (0)
>
> bus_space_set_region_2(sc->sc_buft, sc->sc_bufh, buf, 0,
> (ETHER_MIN_LEN - ETHER_CRC_LEN - totlen) >> 1);
>
>So, that "if" line expands to:
>
> if (!(ETHER_MIN_LEN - ETHER_CRC_LEN - totlen) >> 1) panic([...]);
>
>ETHER_MIN_LEN - ETHER_CRC_LEN - totlen == 1, so that's
> if (!(1) >> 1) panic();
>or
> if (0 >> 1) panic();
>
>Needs more parentheses :)
Meaning you'd want
if (!(c)) panic(...)
instead above?
hauke
--
"It's never straight up and down" (DEVO)