From: Jesper Juhl <juhl-lkml@dif.dk>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: linux-kernel@vger.kernel.org, Rui Prior <rprior@inescn.pt>,
akpm@osdl.org
Subject: Re: [PATCH] atm/nicstar: remove a bunch of pointless casts of NULL
Date: Tue, 10 May 2005 23:02:42 +0200 (CEST) [thread overview]
Message-ID: <Pine.LNX.4.62.0505102259330.2386@dragon.hyggekrogen.localhost> (raw)
In-Reply-To: <200505110058.12932.adobriyan@mail.ru>
On Wed, 11 May 2005, Alexey Dobriyan wrote:
> On Wednesday 11 May 2005 00:06, Jesper Juhl wrote:
> > It doesn't make sense to cast NULL. This patch removes the pointless casts
> > from drivers/atm/nicstar.c
>
> > --- linux-2.6.12-rc3-mm3-orig/drivers/atm/nicstar.c
> > +++ linux-2.6.12-rc3-mm3/drivers/atm/nicstar.c
>
> > scq = (scq_info *) kmalloc(sizeof(scq_info), GFP_KERNEL);
> ^^^^^^^^^^^^
> > - if (scq == (scq_info *) NULL)
> > - return (scq_info *) NULL;
> > + if (scq == NULL)
> > + return NULL;
>
> > scq->skb = (struct sk_buff **) kmalloc(sizeof(struct sk_buff *) *
> ^^^^^^^^^^^^^^^^^^^
> > (size / NS_SCQE_SIZE), GFP_KERNEL);
> > - if (scq->skb == (struct sk_buff **) NULL)
> > + if (scq->skb == NULL)
>
> These are pointless too.
>
True, but I wanted the patch to only do a single well defined thing. I was
not 100% sure what the reaction to such a patch would be, so I didn't want
to mix other things in as well... Actually, thinking about it a bit; will
gcc ever generate different code for NULL pointers cast to different
types? As far as I know it won't, but if it will, then the casts could
actually make sense.
I can submit a second patch to remove the casts of kmalloc return values if
wanted.
--
Jesper
prev parent reply other threads:[~2005-05-10 21:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-10 20:06 Jesper Juhl
2005-05-10 20:58 ` Alexey Dobriyan
2005-05-10 21:02 ` Jesper Juhl [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=Pine.LNX.4.62.0505102259330.2386@dragon.hyggekrogen.localhost \
--to=juhl-lkml@dif.dk \
--cc=adobriyan@gmail.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rprior@inescn.pt \
/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®