linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Wen Yang <wen.yang99@zte.com.cn>, Julia Lawall <julia.lawall@lip6.fr>
Cc: Gilles Muller <Gilles.Muller@lip6.fr>,
	Nicolas Palix <nicolas.palix@imag.fr>,
	Michal Marek <michal.lkml@markovi.net>,
	Yi Wang <wang.yi59@zte.com.cn>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Wen Yang <yellowriver2010@hotmail.com>,
	Cheng Shengyu <cheng.shengyu@zte.com.cn>,
	cocci@systeme.lip6.fr, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH v5] coccinelle: semantic code search for missing put_device()
Date: Fri, 15 Feb 2019 10:10:12 +0100	[thread overview]
Message-ID: <c096c774-bb52-de01-7608-286b4d416cda@web.de> (raw)
In-Reply-To: <1550217319-40418-1-git-send-email-wen.yang99@zte.com.cn>

> In a function, for a local variable returned by calling
> of_find_device_by_node(),

I suggest to reconsider this information once more.

1. Will an other wording be more appropriate for the storage of
   a function return value?

2. Can the restriction “local” be omitted?

3. Will any macros be involved eventually?


> c, for the rest of the situation, the current function should release the
>    reference by calling put_device,

Can it happen that on other function will perform the desired reference release?


>                                     this code search will report the
>    corresponding error message.

Rewording?
A code search can report an error with a specific confidence.


> v5->v4:

Such version information would be sufficient also without arrows, wouldn't it?


> - add a SPDX identifierfix

Would you like to fix a typo at the end?


> +@script:python depends on report@
> +p1 << search.p1;
> +p2 << search.p2;
> +@@
> +
> +coccilib.report.print_report(p2[0], "ERROR: missing put_device; "
> +			      + "call of_find_device_by_node on line "
> +			      + p1[0].line
> +			      + ", but without a corresponding object release "
> +			      + "within this function.")

I find your interpretation of my reminder for the preferred avoidance
of split string literals interesting somehow.

Can the following source code variant be more appropriate?

+coccilib.report.print_report(p2[0],
+			      "WARNING: missing put_device - of_find_device_by_node() call on line "
+			      + p1[0].line
+			      + ", but without a corresponding object release within this function.")


Will any more advanced error diagnostics be eventually developed?

Regards,
Markus

  reply	other threads:[~2019-02-15  9:10 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-15  7:55 [PATCH v5] coccinelle: semantic code search for missing put_device() Wen Yang
2019-02-15  9:10 ` Markus Elfring [this message]
2019-02-15 12:52 ` [PATCH v5] Coccinelle: " Markus Elfring
2019-02-15 13:02   ` Julia Lawall
2019-02-15 13:15     ` [v5] " Markus Elfring
2019-02-15 13:15     ` Markus Elfring
2019-02-15 13:24       ` Julia Lawall
2019-02-15 13:54         ` Markus Elfring
2019-03-17  3:54 ` [PATCH v5] coccinelle: " Masahiro Yamada
2019-03-17  9:05   ` [v5] " Markus Elfring
2019-03-23 16:17   ` Markus Elfring
2019-03-26  6:54     ` Masahiro Yamada
2019-03-26  7:19       ` Julia Lawall
2019-03-26  9:14         ` Markus Elfring
2019-03-26  9:04       ` Markus Elfring
2019-03-26  9:52         ` Masahiro Yamada
2019-03-26  9:58           ` Julia Lawall

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=c096c774-bb52-de01-7608-286b4d416cda@web.de \
    --to=markus.elfring@web.de \
    --cc=Gilles.Muller@lip6.fr \
    --cc=cheng.shengyu@zte.com.cn \
    --cc=cocci@systeme.lip6.fr \
    --cc=julia.lawall@lip6.fr \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.lkml@markovi.net \
    --cc=nicolas.palix@imag.fr \
    --cc=wang.yi59@zte.com.cn \
    --cc=wen.yang99@zte.com.cn \
    --cc=yamada.masahiro@socionext.com \
    --cc=yellowriver2010@hotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).