From: Joe Perches <joe@perches.com>
To: Stephen Hemminger <shemminger@linux-foundation.org>
Cc: klassert@mathematik.tu-chemnitz.de, Jeff Garzik <jeff@garzik.org>,
netdev@vger.kernel.org
Subject: Re: [PATCH] 3c59x: sparse warning fix
Date: Wed, 05 Sep 2007 09:57:05 -0700 [thread overview]
Message-ID: <1189011425.13308.30.camel@localhost> (raw)
In-Reply-To: <20070905152359.26215f89@oldman>
On Wed, 2007-09-05 at 15:23 +0100, Stephen Hemminger wrote:
> --- a/drivers/net/3c59x.c 2007-09-05 15:15:16.000000000 +0100
> +++ b/drivers/net/3c59x.c 2007-09-05 15:16:29.000000000 +0100
> @@ -1122,7 +1122,7 @@ static int __devinit vortex_probe1(struc
> + sizeof(struct boom_tx_desc) * TX_RING_SIZE,
> &vp->rx_ring_dma);
> retval = -ENOMEM;
> - if (vp->rx_ring == 0)
> + if (!vp->rx_ring)
> goto free_region;
>
> vp->tx_ring = (struct boom_tx_desc *)(vp->rx_ring + RX_RING_SIZE);
> @@ -2476,7 +2476,8 @@ boomerang_rx(struct net_device *dev)
>
> /* Check if the packet is long enough to just accept without
> copying to a properly sized skbuff. */
> - if (pkt_len < rx_copybreak && (skb = dev_alloc_skb(pkt_len + 2)) != 0) {
> + if (pkt_len < rx_copybreak &&
> + (skb = dev_alloc_skb(pkt_len + 2)) ) {
> skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */
> pci_dma_sync_single_for_cpu(VORTEX_PCI(vp), dma, PKT_BUF_SZ, PCI_DMA_FROMDEVICE);
> /* 'skb_put()' points to the start of sk_buff data area. */
Shouldn't this be:
if (pkt_len < rx_copybreak) {
skb = dev_alloc_skb(pkt_len + 2);
if (!skb) {
bad_news! (like the refill rx ring buffers block)
}
next prev parent reply other threads:[~2007-09-05 16:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-05 14:23 [PATCH] 3c59x: sparse warning fix Stephen Hemminger
2007-09-05 16:57 ` Joe Perches [this message]
2007-09-05 19:22 ` Francois Romieu
2007-09-05 22:46 ` Stephen Hemminger
2007-09-13 6:38 ` Steffen Klassert
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1189011425.13308.30.camel@localhost \
--to=joe@perches.com \
--cc=jeff@garzik.org \
--cc=klassert@mathematik.tu-chemnitz.de \
--cc=netdev@vger.kernel.org \
--cc=shemminger@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).