All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Phil Edworthy <phil.edworthy@renesas.com>,
	linux-clk@vger.kernel.org, cocci@inria.fr
Cc: Julia Lawall <Julia.Lawall@inria.fr>,
	Nicolas Palix <nicolas.palix@imag.fr>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>
Subject: Re: [cocci] [RFC] coccinelle: Add test for unnecessary check before calling clk_disable_unprepare()
Date: Thu, 19 May 2022 21:51:39 +0200	[thread overview]
Message-ID: <c1d5d00d-d770-530b-abfa-0c1f462e5f22@web.de> (raw)
In-Reply-To: <20220517133556.6934-1-phil.edworthy@renesas.com>

> +@depends on patch@
> +expression clk;
> +@@
> +
> +- if ( \( !clk \| clk != NULL \| !IS_ERR(clk)  \| !IS_ERR_OR_NULL(clk) \) )
> +{
> +clk_disable_unprepare(clk);
> +}


I guess that you would like to mark the curly brackets also for deletion.

How do you think about to handle simple and compound statements with your
source code transformation approach?



> +@script:python depends on report@
> +p1 << r.p1;
> +p2 << r.p2;
> +@@
> +
> +msg = "ERROR: clk_disable_unprepare already checks for valid ptr so check on line %s is not needed" % (p1[0].line)

I imagine that it can be a bit clearer to split the message into two sentences.

Can a line break help here?


Regards,
Markus

  parent reply	other threads:[~2022-05-19 19:52 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-17 13:35 [RFC] coccinelle: Add test for unnecessary check before calling clk_disable_unprepare() Phil Edworthy
2022-05-17 13:35 ` [cocci] " Phil Edworthy
2022-05-18 18:33 ` Stephen Boyd
2022-05-18 18:33   ` [cocci] " Stephen Boyd
2022-05-18 19:05   ` Phil Edworthy
2022-05-18 19:05     ` [cocci] " Phil Edworthy
2022-05-18 20:32     ` Stephen Boyd
2022-05-19 19:51 ` Markus Elfring [this message]
2022-05-20 13:57   ` Phil Edworthy
2022-05-20 15:56     ` Markus Elfring
2022-05-20 16:01       ` Phil Edworthy
2022-05-21 13:11 ` Markus Elfring
2022-05-22  6:05 ` Markus Elfring

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=c1d5d00d-d770-530b-abfa-0c1f462e5f22@web.de \
    --to=markus.elfring@web.de \
    --cc=Julia.Lawall@inria.fr \
    --cc=cocci@inria.fr \
    --cc=linux-clk@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=nicolas.palix@imag.fr \
    --cc=phil.edworthy@renesas.com \
    --cc=sboyd@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.