cocci.inria.fr archive mirror
 help / color / mirror / 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

Hello,

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

@display@
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.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/base/regmap/regmap.c?id=95b2c3ec4cb1689db2389c251d39f64490ba641c#n1254
https://elixir.bootlin.com/linux/v5.7.2/source/drivers/base/regmap/regmap.c#L1261

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?

Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

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

only message in thread, other threads:[~2020-06-27  8:46 UTC | newest]

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).