cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Denis Efremov <efremov@linux.com>,
	cocci@systeme.lip6.fr, kernel-janitors@vger.kernel.org,
	Gilles Muller <Gilles.Muller@lip6.fr>,
	Julia Lawall <Julia.Lawall@lip6.fr>,
	Joe Perches <joe@perches.com>,
	Masahiro Yamada <yamada.masahiro@socionext.com>,
	Michal Marek <michal.lkml@markovi.net>,
	Nicolas Palix <nicolas.palix@imag.fr>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [Cocci] [PATCH v2] scripts: coccinelle: check for !(un)?likely usage
Date: Fri, 30 Aug 2019 09:55:41 +0200	[thread overview]
Message-ID: <3c0f82d5-369a-1493-799e-b201a28aa671@web.de> (raw)
In-Reply-To: <20190829171013.22956-1-efremov@linux.com>

> +/// Notations !unlikely(x) and !likely(x) are confusing.

I am curious if more software developers will share their views around
these likeliness annotations.

* How much does the scope matter for expressions?

* Are different coding style preferences involved?


> +//----------------------------------------------------------
> +//  For context mode
> +//----------------------------------------------------------
> +
> +@depends on context disable unlikely@

I wonder about the need for such a comment when the specification
of SmPL rule dependencies should be sufficient.


> +@depends on patch disable unlikely@
> +expression E;
> +@@
> +
> +(
> +-!likely(!E)
> ++unlikely(E)
> +|
> +-!likely(E)
> ++unlikely(!E)
> +|
> +-!unlikely(!E)
> ++likely(E)
> +|
> +-!unlikely(E)
> ++likely(!E)
> +)

Will another variant for the change specification with the semantic
patch language influence corresponding readability concerns?

+@replacement depends on patch disable unlikely@
+expression x;
+@@
+-!
+(
+(
+-unlikely
++likely
+|
+-likely
++unlikely
+)
+       (
+-       !
+        x
+       )
+|
+(
+-unlikely
++likely
+|
+-likely
++unlikely
+)
+       (
++       !
+        x
+       )
+)


Can the use of nested SmPL disjunctions help here together with
an other SmPL code formatting?

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

  parent reply	other threads:[~2019-08-30  7:56 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-25 13:05 [Cocci] [PATCH] scripts: coccinelle: check for !(un)?likely usage Denis Efremov
2019-08-25 15:30 ` Markus Elfring
2019-08-25 21:06   ` Denis Efremov
2019-08-25 15:30 ` Markus Elfring
2019-08-25 16:37 ` Joe Perches
2019-08-25 18:59   ` Denis Efremov
2019-08-25 19:19     ` Julia Lawall
2019-08-28 11:33       ` Rasmus Villemoes
2019-08-28 11:59         ` Joe Perches
2019-08-28 12:33         ` Denis Efremov
2019-08-28 12:33         ` Julia Lawall
2019-08-28 12:41       ` Denis Efremov
2019-08-28 13:57         ` Denis Efremov
2019-08-25 21:19     ` Denis Efremov
     [not found]   ` <20190901172403.GA1047@bug>
2019-09-01 17:39     ` Denis Efremov
2019-08-29 17:10 ` [Cocci] [PATCH v2] " Denis Efremov
2019-08-29 17:13   ` Denis Efremov
2019-08-30  0:42     ` Julia Lawall
2019-08-30  6:56       ` Denis Efremov
2019-08-30  8:06         ` Rasmus Villemoes
2019-08-29 20:07   ` Markus Elfring
2019-08-30  7:55   ` Markus Elfring [this message]
2019-09-06 20:19   ` Julia Lawall
2019-09-06 20:55     ` Denis Efremov
2019-09-07  8:05       ` [Cocci] [v2] " 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=3c0f82d5-369a-1493-799e-b201a28aa671@web.de \
    --to=markus.elfring@web.de \
    --cc=Gilles.Muller@lip6.fr \
    --cc=Julia.Lawall@lip6.fr \
    --cc=cocci@systeme.lip6.fr \
    --cc=efremov@linux.com \
    --cc=joe@perches.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=michal.lkml@markovi.net \
    --cc=nicolas.palix@imag.fr \
    --cc=yamada.masahiro@socionext.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).