From: Joe Perches <joe@perches.com>
To: Julian Calaby <julian.calaby@gmail.com>
Cc: netdev@vger.kernel.org,
"Luis R. Rodriguez" <lrodriguez@atheros.com>,
Jouni Malinen <jmalinen@atheros.com>,
Vasanthakumar Thiagarajan <vasanth@atheros.com>,
Senthil Balasubramanian <senthilkumar@atheros.com>,
"John W. Linville" <linville@tuxdriver.com>,
Christian Lamparter <chunkeey@googlemail.com>,
Stanislaw Gruszka <sgruszka@redhat.com>,
Wey-Yi Guy <wey-yi.w.guy@intel.com>,
Intel Linux Wireless <ilw@linux.intel.com>,
linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 1/2] wireless: Remove casts of void *
Date: Mon, 13 Jun 2011 22:32:12 -0700 [thread overview]
Message-ID: <1308029532.26699.68.camel@Joe-Laptop> (raw)
In-Reply-To: <BANLkTi=i30Rn7gpCDbn9KKJucq8CB=hssA@mail.gmail.com>
On Tue, 2011-06-14 at 15:23 +1000, Julian Calaby wrote:
> Joe,
Hi Julian.
> On Tue, Jun 14, 2011 at 14:02, Joe Perches <joe@perches.com> wrote:
> > Unnecessary casts of void * clutter the code.
> > These are the remainder casts after several specific
> > patches to remove netdev_priv and dev_priv.
> You seem to have removed a lot of casts that don't relate to these cleanups.
> In particular, some of the casts seem to relate more to documentation
> rather than just changing pointer types to make the compiler happy.
All of the cast removals are casts of void* types.
I think none of of the casts are useful.
None of them are required, all are duplicative.
> In
> particular, I'm referring to the casts describing the different usages
> of data_buf in mwiflex, and around some pointer math in ath9k.
Can you describe more in detail why you think these are documentary?
This sort of cast:
diff --git a/drivers/net/wireless/mwifiex/11n.c b/drivers/net/wireless/mwifiex/11n.c
@@ -191,7 +191,7 @@ int mwifiex_ret_11n_cfg(struct host_cmd_ds_command *resp, void *data_buf)
struct host_cmd_ds_11n_cfg *htcfg = &resp->params.htcfg;
if (data_buf) {
- tx_cfg = (struct mwifiex_ds_11n_tx_cfg *) data_buf;
+ tx_cfg = data_buf;
I think pretty useless. tx_cfg is a struct mwifiex_ds_11n_tx_cfg *.
> Whilst I'm sure that the compiler is smart enough to handle automatic
> casts between pointer types, some of these, in particular the mwiflex
> bits, add some documentation to the code.
I think not. Opinions of course can vary.
cheers, Joe
next prev parent reply other threads:[~2011-06-14 5:32 UTC|newest]
Thread overview: 11+ 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
2011-06-14 5:32 ` Joe Perches [this message]
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
2011-06-14 16:31 ` [ath9k-devel] " Pavel Roskin
2011-06-14 16:43 ` Joe Perches
2011-06-14 17:43 ` Christian Lamparter
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=1308029532.26699.68.camel@Joe-Laptop \
--to=joe@perches.com \
--cc=ath9k-devel@lists.ath9k.org \
--cc=chunkeey@googlemail.com \
--cc=ilw@linux.intel.com \
--cc=jmalinen@atheros.com \
--cc=julian.calaby@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=lrodriguez@atheros.com \
--cc=netdev@vger.kernel.org \
--cc=senthilkumar@atheros.com \
--cc=sgruszka@redhat.com \
--cc=vasanth@atheros.com \
--cc=wey-yi.w.guy@intel.com \
/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).