Coccinelle archive on
 help / color / Atom feed
* [Cocci] Checking data processing results for a special SmPL disjunction
@ 2020-06-27  8:42 Markus Elfring
  0 siblings, 0 replies; only message in thread
From: Markus Elfring @ 2020-06-27  8:42 UTC (permalink / raw)
  To: Coccinelle


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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-27  8:42 [Cocci] Checking data processing results for a special SmPL disjunction Markus Elfring

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