From: Ulrich Kunitz <kune@deine-taler.de>
To: Joe Perches <joe@perches.com>
Cc: Michael Buesch <mb@bu3sch.de>, Daniel Drake <dsd@gentoo.org>,
linville@tuxdriver.com, netdev@vger.kernel.org,
linux-wireless@vger.kernel.org, rpjday@mindspring.com
Subject: Re: [PATCH] zd1211rw: Readd zd_addr_t cast
Date: Sat, 10 Feb 2007 20:56:52 +0100 [thread overview]
Message-ID: <20070210195652.GA16406@p15091797.pureserver.info> (raw)
In-Reply-To: <1171133498.20342.59.camel@localhost>
On 07-02-10 10:51 Joe Perches wrote:
> On Sat, 2007-02-10 at 07:02 +0100, Michael Buesch wrote:
> > On Saturday 10 February 2007 02:27, Daniel Drake wrote:
> > > Robert P.J. Day's recent commit ("getting rid of all casts of k[cmz]alloc()
> > > calls") introduced a sparse warning for zd1211rw, related to our type-checking
> > > of addresses.
> > > > zd_chip.c:116:15: warning: implicit cast to nocast type
> > > This patch readds the type cast, it is correct.
> > > Signed-off-by: Daniel Drake <dsd@gentoo.org>
> > > Index: linux/drivers/net/wireless/zd1211rw/zd_chip.c
> > > ===================================================================
> > > --- linux.orig/drivers/net/wireless/zd1211rw/zd_chip.c
> > > +++ linux/drivers/net/wireless/zd1211rw/zd_chip.c
> > > @@ -113,7 +113,7 @@ int zd_ioread32v_locked(struct zd_chip *
> > >
> > > /* Allocate a single memory block for values and addresses. */
> > > count16 = 2*count;
> > > - a16 = kmalloc(count16 * (sizeof(zd_addr_t) + sizeof(u16)),
> > > + a16 = (zd_addr_t *) kmalloc(count16 * (sizeof(zd_addr_t) + sizeof(u16)),
> > > GFP_NOFS);
>
> I think it better to remove this __nocast instead.
> This is the only use of __nocast outside of kmem in the kernel tree.
>
> Why not just remove __nocast and use u16 instead of zd_addr_t?
Using the __nocast type sparse catches errors, when address and
value arguments are used in the wrong order for calls of the
zd_ioread* and zd_iowrite* functions. I'm a lazy guy, I like tools
do the hard work for me.
> If not the removal of the __nocast, would it be better to have a
> void pointer there?
I don't think that an explicit cast requires the introduction of a
temporary variable.
--
Uli Kunitz
prev parent reply other threads:[~2007-02-10 19:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-10 1:27 [PATCH] zd1211rw: Readd zd_addr_t cast Daniel Drake
2007-02-10 6:02 ` Michael Buesch
2007-02-10 7:36 ` Ulrich Kunitz
2007-02-10 18:51 ` Joe Perches
2007-02-10 19:56 ` Ulrich Kunitz [this message]
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=20070210195652.GA16406@p15091797.pureserver.info \
--to=kune@deine-taler.de \
--cc=dsd@gentoo.org \
--cc=joe@perches.com \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
--cc=mb@bu3sch.de \
--cc=netdev@vger.kernel.org \
--cc=rpjday@mindspring.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