From: Julian Calaby <julian.calaby@gmail.com>
To: Joe Perches <joe@perches.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@venema.h4ckr.net,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next 1/2] wireless: Remove casts of void *
Date: Tue, 14 Jun 2011 15:39:32 +1000 [thread overview]
Message-ID: <BANLkTik4fWbCc8pRZfKCzvKD2f6sK9QCEw@mail.gmail.com> (raw)
In-Reply-To: <1308029532.26699.68.camel@Joe-Laptop>
Joe,
On Tue, Jun 14, 2011 at 15:32, Joe Perches <joe@perches.com> wrote:
> 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.
My issue here is that you mention in the commit log that this relates
to the removal of netdev_priv and dev_priv, but the casts removed
(mostly) don't.
>> 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 *.
True, but IMHO, this documents, particularly in a random snippet like
this, what's going on. Arguably though, a better fix would be to move
the cast to the place where this function is called.
>> 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.
Of course. I rarely look at full files, so the more information that
can be stuffed into a patch, the better for me. That said, I agree
that all the casts removed are superfluous.
Thanks,
--
Julian Calaby
Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/
next prev parent reply other threads:[~2011-06-14 5:39 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-14 4:02 [PATCH net-next 0/2] drivers/net: " 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
2011-06-14 5:39 ` Julian Calaby [this message]
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
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
2011-06-14 14:02 ` Geert Uytterhoeven
2011-06-14 10:34 ` Chris Snook
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=BANLkTik4fWbCc8pRZfKCzvKD2f6sK9QCEw@mail.gmail.com \
--to=julian.calaby@gmail.com \
--cc=ath9k-devel@venema.h4ckr.net \
--cc=chunkeey@googlemail.com \
--cc=ilw@linux.intel.com \
--cc=jmalinen@atheros.com \
--cc=joe@perches.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
all inboxes | Powered by JetHome®