From: Matthias Fuchs <matthias.fuchs-iOnpLzIbIdM@public.gmane.org>
To: Viral Mehta <Viral.Mehta-oonXi/34qI7c+919tysfdA@public.gmane.org>
Cc: "Socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org"
<Socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org>,
"netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH v3] can: Add driver for esd CAN-USB/2 device
Date: Fri, 28 May 2010 17:25:31 +0200 [thread overview]
Message-ID: <201005281725.32049.matthias.fuchs@esd.eu> (raw)
In-Reply-To: <70376CA23424B34D86F1C7DE6B9973430254343AD9-fVvhrSDAkVjuuPCCJ6VnObSn4PsL5ZDKvpI+GvaZM4lBDgjK7y7TUQ@public.gmane.org>
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-u79uwXL29TY76Z2rM5mHXA@public.gmane.org [linux-usb-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org] On Behalf Of Matthias Fuchs [matthias.fuchs-iOnpLzIbIdM@public.gmane.org]
> >Sent: Wednesday, May 26, 2010 2:44 PM
> >To: netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> >Cc: Socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org; linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.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
next prev parent reply other threads:[~2010-05-28 15:25 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-26 9:14 [PATCH v3] can: Add driver for esd CAN-USB/2 device Matthias Fuchs
[not found] ` <201005261114.03214.matthias.fuchs-iOnpLzIbIdM@public.gmane.org>
2010-05-26 10:15 ` Wolfgang Grandegger
[not found] ` <4BFCF4AD.6030000-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2010-05-26 12:38 ` Matthias Fuchs
2010-05-26 11:31 ` Viral Mehta
[not found] ` <70376CA23424B34D86F1C7DE6B9973430254343AD9-fVvhrSDAkVjuuPCCJ6VnObSn4PsL5ZDKvpI+GvaZM4lBDgjK7y7TUQ@public.gmane.org>
2010-05-28 15:25 ` Matthias Fuchs [this message]
2010-05-31 6:35 ` Viral Mehta
2010-05-26 13:47 ` Oliver Neukum
[not found] ` <201005261547.34596.oneukum-l3A5Bk7waGM@public.gmane.org>
2010-05-28 14:19 ` Matthias Fuchs
2010-05-28 15:26 ` Oliver Neukum
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=201005281725.32049.matthias.fuchs@esd.eu \
--to=matthias.fuchs-ionplzibidm@public.gmane.org \
--cc=Socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org \
--cc=Viral.Mehta-oonXi/34qI7c+919tysfdA@public.gmane.org \
--cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.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).