Coccinelle archive on
 help / color / Atom feed
From: Markus Elfring <>
To: Coccinelle <>
Subject: [Cocci] Checking data processing results for a special SmPL disjunction
Date: Sat, 27 Jun 2020 10:42:35 +0200
Message-ID: <> (raw)


I have tried another tiny script variant out for the semantic patch language
(according to the software combination “Coccinelle 1.0.8-00131-g675b9670”).

expression* pointer;
identifier result;
type t;
 t result = <+...
(           sizeof(*(pointer))
*           *(pointer)
)           ...+>;

elfring@Sonne:~/Projekte/Linux/next-patched> spatch ~/Projekte/Coccinelle/janitor/show_interesting_disjunction-20200627.cocci drivers/base/regmap/regmap.c
@@ -1263,7 +1261,6 @@ EXPORT_SYMBOL_GPL(devm_regmap_field_free
 struct regmap_field *regmap_field_alloc(struct regmap *regmap,
 		struct reg_field reg_field)
-	struct regmap_field *rm_field = kzalloc(sizeof(*rm_field), GFP_KERNEL);

 	if (!rm_field)
 		return ERR_PTR(-ENOMEM);

Now I wonder why such a diff hunk is generated.

I expected that the first element in the shown SmPL disjunction
should exclude displays for the usage of the operator “sizeof”.
Is my understanding still incomplete also for this software behaviour?

Cocci mailing list

                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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:

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

  git send-email \ \ \ \

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

Coccinelle archive on

Archives are clonable:
	git clone --mirror cocci/git/0.git

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

Example config snippet for mirrors

Newsgroup available over NNTP:

AGPL code for this site: git clone