LKML Archive on
 help / Atom feed
From: Florian Mickler <>
To: Florian Mickler <>
Cc: Andy Whitcroft <>,
	Audun Hoem <>,
	linux-kernel <>
Subject: Re: [PATCH] fix CAST detection to not screw with parens handling
Date: Wed, 3 Nov 2010 16:20:42 +0100
Message-ID: <20101103162042.297958c3@schatten.dmk.lab> (raw)
In-Reply-To: <>

On Wed,  3 Nov 2010 13:04:33 +0100
Florian Mickler <> wrote:

> Casts have to be handled after the last type that is followed by an
> opening parenthesis is handled.

That is the wrong fix. I realized now that with that patch we would
not claim anything as a CAST anymore. Better is probably to only claim
a CAST if av_pending is not set. Andy, would that work? It seems to be
alright... Do you have some tests for checkpatch?

Testing it with the reported line and some other random samples it
seems to be alright.


commit 11ed611c647420ea27124faf269d724b4fd3ade4
Author: Florian Mickler <>
Date:   Wed Nov 3 15:54:26 2010 +0100 fix CAST detection
    We should only claim that something is a cast if we did not encouter a
    token before, that did set av_pending.
    This fixes the operator * in the line below  to be detected as
    binary (vs unary).
     kmalloc(sizeof(struct alphatrack_ocmd) * true_size, GFP_KERNEL);
    Reported-by: Audun Hoem <>
    Signed-off-by: Florian Mickler <>

diff --git a/scripts/ b/scripts/
index 90b54d4..06f5c44 100755
--- a/scripts/
+++ b/scripts/
@@ -859,7 +859,7 @@ sub annotate_values {
 				$av_preprocessor = 0;
-		} elsif ($cur =~ /^(\(\s*$Type\s*)\)/) {
+		} elsif ($cur =~ /^(\(\s*$Type\s*)\)/ && $av_pending eq '_') {
 			print "CAST($1)\n" if ($dbg_values > 1);
 			push(@av_paren_type, $type);
 			$type = 'C';

  reply index

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-02 22:57 Bug in Audun Hoem
2010-11-03 12:04 ` [PATCH] fix CAST detection to not screw with parens handling Florian Mickler
2010-11-03 15:20   ` Florian Mickler [this message]
2010-11-03 15:26     ` Audun Hoem
2010-11-03 16:07       ` Florian Mickler
2010-11-17  7:30     ` Florian Mickler
2010-11-23 14:15       ` Andy Whitcroft

Reply instructions:

You may reply publically 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101103162042.297958c3@schatten.dmk.lab \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

LKML Archive on

Archives are clonable:
	git clone --mirror lkml/git/0.git
	git clone --mirror lkml/git/1.git
	git clone --mirror lkml/git/2.git
	git clone --mirror lkml/git/3.git
	git clone --mirror lkml/git/4.git
	git clone --mirror lkml/git/5.git
	git clone --mirror lkml/git/6.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ \
	public-inbox-index lkml

Newsgroup available over NNTP:

AGPL code for this site: git clone public-inbox