From: Joe Perches <joe@perches.com>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: netdev@vger.kernel.org,
Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
Jay Cliburn <jcliburn@gmail.com>,
Chris Snook <chris.snook@gmail.com>,
Jie Yang <jie.yang@atheros.com>,
Sathya Perla <sathya.perla@emulex.com>,
Subbu Seetharaman <subbu.seetharaman@emulex.com>,
Ajit Khaparde <ajit.khaparde@emulex.com>,
Rasesh Mody <rmody@brocade.com>,
Debashis Dutt <ddutt@brocade.com>,
Sjur Braendeland <sjur.brandeland@stericsson.com>,
Divy Le Ray <divy@chelsio.com>,
Breno Leitao <leitao@linux.vnet.ibm.com>,
Amit Kumar Salecha <amit.salecha@qlogic.com>,
Ron Mercer <ron.mercer@qlogic.com>,
linux-driver@qlogic.com,
Anirban Chakraborty <anirban.chakraborty@qlogic.com>,
Jon Mason <jdmason@kudzu.us>,
Solarflare linux maintainers <linux-net-drivers@solarflare.com>,
Steve Hodgson <shodgson@solarflare.com>,
Ben Hutchings <bhutchings@solarflare.com>,
Daniele Venzano <venza@brownhat
Subject: Re: [PATCH net-next 2/2] drivers/net: Remove casts of void *
Date: Tue, 14 Jun 2011 07:00:28 -0700 [thread overview]
Message-ID: <1308060028.18987.6.camel@Joe-Laptop> (raw)
In-Reply-To: <BANLkTim-yLJqfxrCprwiTgdRJNy+OGDUuw@mail.gmail.com>
On Tue, 2011-06-14 at 11:21 +0200, Geert Uytterhoeven wrote:
> On Tue, Jun 14, 2011 at 06:02, Joe Perches <joe@perches.com> wrote:
> > Unnecessary casts of void * clutter the code.
> > --- a/drivers/net/a2065.c
> > +++ b/drivers/net/a2065.c
> > @@ -426,7 +426,7 @@ static irqreturn_t lance_interrupt (int irq, void *dev_id)
> > volatile struct lance_regs *ll;
> > int csr0;
> >
> > - dev = (struct net_device *) dev_id;
> > + dev = dev_id;
>
> I think it would look better if you merge this line with the line that
> defines "dev".
I think so too, but I also think it should look like below
and that's something better done in a separate pass, don't
you think?
diff --git a/drivers/net/a2065.c b/drivers/net/a2065.c
index deaa8bc..25ea98a 100644
--- a/drivers/net/a2065.c
+++ b/drivers/net/a2065.c
@@ -421,16 +421,11 @@ static int lance_tx (struct net_device *dev)
static irqreturn_t lance_interrupt (int irq, void *dev_id)
{
- struct net_device *dev;
- struct lance_private *lp;
- volatile struct lance_regs *ll;
+ struct net_device *dev = dev_id;
+ struct lance_private *lp = netdev_priv(dev);
+ volatile struct lance_regs *ll = lp->ll;
int csr0;
- dev = (struct net_device *) dev_id;
-
- lp = netdev_priv(dev);
- ll = lp->ll;
-
ll->rap = LE_CSR0; /* LANCE Controller Status */
csr0 = ll->rdp;
next prev parent reply other threads:[~2011-06-14 14:00 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-14 4:02 [PATCH net-next 0/2] drivers/net: Remove casts of void * Joe Perches
2011-06-14 4:02 ` [PATCH net-next 1/2] wireless: " Joe Perches
2011-06-14 5:23 ` Julian Calaby
[not found] ` <BANLkTi=i30Rn7gpCDbn9KKJucq8CB=hssA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-06-14 5:32 ` Joe Perches
2011-06-14 5:39 ` Julian Calaby
2011-06-14 7:19 ` Joe Perches
2011-06-14 8:45 ` Bing Zhao
2011-06-14 8:46 ` Bing Zhao
[not found] ` <337c22b774ff7f007b90b266b25c9a33ff555c48.1308024069.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
2011-06-14 16:31 ` [ath9k-devel] " Pavel Roskin
2011-06-14 16:43 ` Joe Perches
2011-06-14 17:43 ` Christian Lamparter
2011-06-14 4:02 ` [PATCH net-next 2/2] drivers/net: " Joe Perches
2011-06-14 7:56 ` Debashis Dutt
2011-06-14 8:18 ` Daniele Venzano
2011-06-14 9:21 ` Geert Uytterhoeven
2011-06-14 14:00 ` Joe Perches [this message]
2011-06-14 14:02 ` Geert Uytterhoeven
2011-06-14 10:34 ` Chris Snook
2011-06-14 14:17 ` Joe Perches
2011-06-14 14:22 ` Chris Snook
2011-06-15 0:10 ` Huang, Xiong
2011-06-14 11:31 ` Amit Salecha
2011-06-14 17:53 ` Sjur BRENDELAND
[not found] ` <C4E199C967B4824F9C9DF4C42CE4A3B8591B7F0D78@EXMAIL.ad.emulex.com>
2011-06-14 18:31 ` Ajit.Khaparde
2011-06-16 15:23 ` Jon Mason
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=1308060028.18987.6.camel@Joe-Laptop \
--to=joe@perches.com \
--cc=acme@ghostprotocols.net \
--cc=ajit.khaparde@emulex.com \
--cc=amit.salecha@qlogic.com \
--cc=anirban.chakraborty@qlogic.com \
--cc=bhutchings@solarflare.com \
--cc=chris.snook@gmail.com \
--cc=ddutt@brocade.com \
--cc=divy@chelsio.com \
--cc=geert@linux-m68k.org \
--cc=jcliburn@gmail.com \
--cc=jdmason@kudzu.us \
--cc=jie.yang@atheros.com \
--cc=leitao@linux.vnet.ibm.com \
--cc=linux-driver@qlogic.com \
--cc=linux-net-drivers@solarflare.com \
--cc=netdev@vger.kernel.org \
--cc=rmody@brocade.com \
--cc=ron.mercer@qlogic.com \
--cc=sathya.perla@emulex.com \
--cc=shodgson@solarflare.com \
--cc=sjur.brandeland@stericsson.com \
--cc=subbu.seetharaman@emulex.com \
--cc=venza@brownhat \
/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).