Message ID | 20100328.185707.161194820.davem@davemloft.net |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
On Sun, 2010-03-28 at 18:57 -0700, David Miller wrote: > From: Stephen Rothwell <sfr@canb.auug.org.au> > > After merging the tree, today's linux-next build (x86_64 allmodconfig) > > produced this warning: > > drivers/net/tulip/uli526x.c: In function 'uli526x_rx_packet': > > drivers/net/tulip/uli526x.c:861: warning: assignment makes pointer from integer without a cast > I just committed the following, let me know if it fixes > this. > - ((new_skb = dev_alloc_skb(rxlen + 2) != NULL))) { > + (((new_skb = dev_alloc_skb(rxlen + 2)) != NULL))) { You've an extra () there. A close paren could have been moved from after the NULL to after the "+ 2" I think it's more readable as: (new_skb = dev_alloc_skb(rxlen + 2))) { cheers, Joe -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Dave, On Sun, 28 Mar 2010 18:57:07 -0700 (PDT) David Miller <davem@davemloft.net> wrote: > > Strange, it didn't warn here. > > I just committed the following, let me know if it fixes > this. Yeah, that did it, thanks
diff --git a/drivers/net/tulip/uli526x.c b/drivers/net/tulip/uli526x.c index 90be57b..a4f09d4 100644 --- a/drivers/net/tulip/uli526x.c +++ b/drivers/net/tulip/uli526x.c @@ -858,7 +858,7 @@ static void uli526x_rx_packet(struct net_device *dev, struct uli526x_board_info /* Good packet, send to upper layer */ /* Shorst packet used new SKB */ if ((rxlen < RX_COPY_SIZE) && - ((new_skb = dev_alloc_skb(rxlen + 2) != NULL))) { + (((new_skb = dev_alloc_skb(rxlen + 2)) != NULL))) { skb = new_skb; /* size less than COPY_SIZE, allocate a rxlen SKB */ skb_reserve(skb, 2); /* 16byte align */