[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201005281725.32049.matthias.fuchs@esd.eu>
Date: Fri, 28 May 2010 17:25:31 +0200
From: Matthias Fuchs <matthias.fuchs@....eu>
To: Viral Mehta <Viral.Mehta@...infotech.com>
Cc: "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"Socketcan-core@...ts.berlios.de" <Socketcan-core@...ts.berlios.de>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>
Subject: Re: [PATCH v3] can: Add driver for esd CAN-USB/2 device
Hi Viral,
thanks for review. Please see some comments below.
On Wednesday 26 May 2010 13:31, Viral Mehta wrote:
> Hi,
> >________________________________________
> >From: linux-usb-owner@...r.kernel.org [linux-usb-owner@...r.kernel.org] On Behalf Of Matthias Fuchs [matthias.fuchs@....eu]
> >Sent: Wednesday, May 26, 2010 2:44 PM
> >To: netdev@...r.kernel.org
> >Cc: Socketcan-core@...ts.berlios.de; linux-usb@...r.kernel.org
> >Subject: [PATCH v3] can: Add driver for esd CAN-USB/2 device
> >+
> >+ BUG_ON(!context);
>
> It is preferred to used WARN_ON and avoid using BUG_ON and thus dont kill the whole system....
Really? Even when next line will reference a NULL pointer in this case? Ok. Will be changed.
> [...]
> >+
> >+ priv = context->priv;
> >+ netdev = priv->netdev;
> >+ dev = priv->usb2;
> >+ err = usb_submit_urb(urb, GFP_ATOMIC);
> >+ if (err) {
> >+ can_free_echo_skb(netdev, context->echo_index);
> >+
> >+ atomic_dec(&priv->active_tx_jobs);
> >+ usb_unanchor_urb(urb);
> >+
> >+ stats->tx_dropped++;
> >+
> >+ if (err == -ENODEV)
> >+ netif_device_detach(netdev);
> >+ else
> >+ dev_warn(netdev->dev.parent, "failed tx_urb %d\n", err);
> >+
> >+ goto releasebuf;
>
> You probably want to set "ret" here or do you really want to return NETDEV_TX_OK
As far as I can see netword device drivers xmit_start() return NETDEV_TX_OK or _BUSY.
There are no real alternatives. But please correct me when I am wrong.
Your other comments will be fixed by version 4 of my patch.
Matthias
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists