[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 8 Aug 2007 14:10:34 -0400 (EDT)
From: Cal Peake <cp@...olutedigital.net>
To: Dave Jones <davej@...hat.com>
cc: jschopp <jschopp@...tin.ibm.com>, apw@...dowen.org,
rdunlap@...otime.net, Linux Kernel <linux-kernel@...r.kernel.org>
Subject: Re: Make checkpatch warn about pointless casting of kalloc returns.
On Wed, 8 Aug 2007, Dave Jones wrote:
> > I haven't tried it but how about something like:
> >
> > if($rawline =~/\(.*\)\s*k[czm]alloc/){
>
> Hmm, could even just drop the check for the '*'
> )[ ]k.. should be good enough.
There is none, both the '*'s are qualifiers :)
> > which if I got it right should match the typecast with any combination of spacing.
> >
> > > + WARN("No need to cast return value.\n");
> >
> > Could the warning be more descriptive? This describes what, but it should also describe
> > why; after all if somebody made this error they may not know they why.
>
> I'm open to suggestions..
Point to or quote from: http://c-faq.com/malloc/mallocnocast.html ?
--
Cal Peake
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists