Coccinelle Archive on
 help / color / Atom feed
From: Markus Elfring <>
To: Denis Efremov <>,
	Coccinelle <>,
	Gilles Muller <>,
	Julia Lawall <>,
	Masahiro Yamada <>,
	Michal Marek <>,
	Nicolas Palix <>
Subject: Re: [Cocci] [PATCH] coccinelle: api: add kvfree script
Date: Sat, 6 Jun 2020 09:30:36 +0200
Message-ID: <> (raw)

> Check that alloc and free types of functions match each other.

Further software development challenges are interesting also for such an use case.

> +/// Check that kvmalloc'ed memory is freed by kfree functions,
> +/// vmalloc'ed by vfree functions and kvmalloc'ed by kvfree
> +/// functions.

* How do you think about to offer a wording suggestion for subjects of
  generated patches?

* Will the presented case distinction trigger further improvements for
  the desired matching?

* Would you like to generalise the safe handling of allocations
  and corresponding release of system resources?

> +// Confidence: High

I suggest to reconsider this information once more.

> +virtual patch
> +virtual report
> +virtual org
> +virtual context

+virtual patch, report, org, context

Is such a SmPL code variant more succinct?

> +@choice@

* Can it be that this SmPL rule is not relevant for all operation modes?

* Will additional dependencies matter?

> +    E = \(kmalloc@kok\|kzalloc@kok\|krealloc@kok\|kcalloc@kok\|kmalloc_node@kok\|kzalloc_node@kok\|kmalloc_array@kok\|kmalloc_array_node@kok\|kcalloc_node@kok\)(...)

I would prefer an other coding style here.

* Items for such SmPL disjunctions can be specified also on multiple lines.

* The semantic patch language supports further means to handle function name lists
  in more convenient ways.
  Would you like to work with customised constraints?

> +msg = "WARNING: kmalloc is used to allocate this memory at line %s" % (k[0].line)
>[0], msg)

* I propose once more omit the extra variable “msg” at similar places.
  The desired message object can be directly passed as a function parameter.

* I find the diagnostic text insufficient.

* Can the corresponding function category be dynamically determined?

Are you looking for opportunities to avoid unwanted code duplication?

Cocci mailing list

             reply index

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-06  7:30 Markus Elfring [this message]
2020-06-06  7:46 ` Julia Lawall
2020-06-06  9:50   ` [Cocci] " Markus Elfring
2020-06-07 14:02     ` [Cocci] Coccinelle: Extending capabilities for source file pre-selection Markus Elfring
2020-06-06 11:06   ` [Cocci] coccinelle: api: add kvfree script Markus Elfring
2020-06-06 11:11     ` Julia Lawall
2020-06-06 11:21       ` Markus Elfring
2020-06-07  6:42         ` [Cocci] Coccinelle: Improving software components around usage of SmPL disjunctions Markus Elfring
  -- strict thread matches above, loose matches on Subject: below --
2020-06-06 14:04 [Cocci] [PATCH] coccinelle: api: add kvfree script Markus Elfring
2020-06-06 14:39 ` Julia Lawall
2020-06-05 20:42 Denis Efremov
2020-06-05 20:51 ` Julia Lawall
2020-06-05 21:15   ` Denis Efremov
2020-06-05 21:19     ` Julia Lawall
2020-06-14  9:03   ` Denis Efremov
2020-06-14  9:17     ` Julia Lawall
2020-06-14  9:24       ` Denis Efremov

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