From: Yoann Padioleau <padator@wanadoo.fr>
To: Jeff Garzik <jeff@garzik.org>
Cc: Yoann Padioleau <padator@wanadoo.fr>,
kernel-janitors@vger.kernel.org, akpm@linux-foundation.org,
linux-kernel@vger.kernel.org
Subject: dev->priv to netdev_priv(dev)
Date: Fri, 03 Aug 2007 20:03:05 +0200 [thread overview]
Message-ID: <87myx8338m.fsf_-_@wanadoo.fr> (raw)
In-Reply-To: <46AE43F5.8070802@garzik.org> (Jeff Garzik's message of "Mon, 30 Jul 2007 16:03:01 -0400")
Jeff Garzik <jeff@garzik.org> writes:
>> PS: I have performed the same transformation on the whole kernel
>> and it affects around 70 files, most of them in drivers/net/.
>> Should I split my patch for each subnet directories ? (wireless/, wan/, etc)
>
> applied. splitting up by sub-directory would be helpful.
Done. I was not always able to find the maintainer for all the subdirectories
so for those cases I have considered you as the maintainer :)
I have run another semantic patch (more like a semantic grep in fact)
to find the places where our tool didn't transform the dev->priv to
netdev_priv. The reason is that our tool was not able to find the call
to alloc_dev_xxx(sizeof(T),...) in the driver or there was an
assignation to dev->priv which means that transforming to netdev_priv
would do something wrong. I have printed the list of "bad driver"
below.
In very few cases the driver was in fact "good" but because of the
way the code was written, our tool was not able to find the alloc_xxx
function.
drivers/net/82596.c
drivers/net/chelsio/cxgb2.c
drivers/net/chelsio/sge.c
drivers/net/cxgb3/cxgb3_main.c
drivers/net/cxgb3/sge.c
drivers/net/e1000/e1000_main.c
drivers/net/ehea/ehea_main.c
drivers/net/hamradio/dmascc.c
drivers/net/hamradio/scc.c
drivers/net/lance.c
drivers/net/mace.c
for mace.c the code is written this way:
#define PRIV_BYTES (sizeof(struct mace_data) \
+ (N_RX_RING + NCMDS_TX * N_TX_RING + 3) * sizeof(struct dbdma_cmd))
dev = alloc_etherdev(PRIV_BYTES);
So our semantic patch can't find a alloc_etherdev(sizeof(T)).
If I inline the definition of PRIV_BYTES, then our tool will be
able to transform it.
drivers/net/ni65.c
drivers/net/pcmcia/com20020_cs.c
dev = alloc_arcdev("");
drivers/net/ppp_generic.c
drivers/net/spider_net_ethtool.c
again, the code is written this way:
alloc_size = sizeof(struct spider_net_card) +
(tx_descriptors + rx_descriptors) * sizeof(struct spider_net_descr);
netdev = alloc_etherdev(alloc_size);
If I inline the definition of alloc_size, then we can transform
the file.
drivers/net/tulip/xircom_cb.c
drivers/net/wan/cosa.c
drivers/net/wan/cycx_x25.c
drivers/net/wan/hdlc_fr.c
drivers/net/wan/hdlc_ppp.c
drivers/net/wan/hostess_sv11.c
drivers/net/wan/pc300_drv.c
drivers/net/wan/sbni.c
drivers/net/wireless/airo.c
drivers/net/wireless/libertas/ethtool.c
drivers/net/wireless/libertas/main.c
drivers/net/wireless/libertas/scan.c
drivers/net/wireless/libertas/wext.c
drivers/net/wireless/wavelan.c
drivers/net/wireless/zd1201.c
drivers/net/tokenring/tms380tr.c
This file is both used as a single module and used by other module.
The other modules have a call to a alloc_xxx but not tms380tr.c when
used as a single module.
next prev parent reply other threads:[~2007-08-03 18:05 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-23 13:18 [PATCH] dev->priv to netdev_priv(dev), drivers/net/tokenring/ Yoann Padioleau
2007-07-23 15:13 ` Jan Engelhardt
2007-07-23 15:38 ` Yoann Padioleau
2007-07-30 20:03 ` Jeff Garzik
2007-08-03 18:03 ` Yoann Padioleau [this message]
2007-08-03 23:42 ` dev->priv to netdev_priv(dev) Krzysztof Halasa
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=87myx8338m.fsf_-_@wanadoo.fr \
--to=padator@wanadoo.fr \
--cc=akpm@linux-foundation.org \
--cc=jeff@garzik.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.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