cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Wen Yang <wenyang@linux.alibaba.com>,
	cocci@systeme.lip6.fr, kernel-janitors@vger.kernel.org
Cc: "Michal Marek" <michal.lkml@markovi.net>,
	"Julia Lawall" <Julia.Lawall@lip6.fr>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Nicolas Palix" <nicolas.palix@imag.fr>,
	"Gilles Muller" <Gilles.Muller@lip6.fr>,
	"Matthias Männich" <maennich@google.com>,
	linux-kernel@vger.kernel.org,
	"Thomas Gleixner" <tglx@linutronix.de>
Subject: Re: [Cocci] [PATCH] coccinelle: semantic patch to check for inappropriate do_div() calls
Date: Sun, 5 Jan 2020 11:33:41 +0100	[thread overview]
Message-ID: <21e9861a-5afc-fd66-cfd1-a9b5b92b230b@web.de> (raw)
In-Reply-To: <20200104064448.24314-1-wenyang@linux.alibaba.com>

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

The operation mode “patch” is not supported here.
Should the term “semantic code search” be used instead in the subject again?


> +@@
> +(
> +* do_div(f, l);
> +|
> +* do_div(f, ul);
> +|
> +* do_div(f, ul64);
> +|
> +* do_div(f, sl64);
> +)

I suggest to avoid the specification of duplicate SmPL code.

+@@
+*do_div(f, \( l \| ul \| ul64 \| sl64 \) );


Will any more case distinctions become helpful?


> +@script:python depends on report@
> +p << r.p;
> +@@
> +
> +msg="WARNING: WARNING: do_div() does a 64-by-32 division, which may truncation the divisor to 32-bit"
> +coccilib.report.print_report(p[0], msg)

Please improve the message construction.

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

  parent reply	other threads:[~2020-01-05 10:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-04  6:44 [Cocci] [PATCH] coccinelle: semantic patch to check for inappropriate do_div() calls Wen Yang
2020-01-04  7:00 ` Julia Lawall
2020-01-04  8:49   ` Wen Yang
2020-01-04  8:55     ` Julia Lawall
2020-01-04 13:50       ` Wen Yang
2020-01-04 13:54         ` Julia Lawall
2020-01-04  7:16 ` Julia Lawall
2020-01-05 10:33 ` Markus Elfring [this message]
2020-01-05 10:41   ` Julia Lawall
2020-01-05 12:07     ` [Cocci] " 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=21e9861a-5afc-fd66-cfd1-a9b5b92b230b@web.de \
    --to=markus.elfring@web.de \
    --cc=Gilles.Muller@lip6.fr \
    --cc=Julia.Lawall@lip6.fr \
    --cc=cocci@systeme.lip6.fr \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maennich@google.com \
    --cc=michal.lkml@markovi.net \
    --cc=nicolas.palix@imag.fr \
    --cc=tglx@linutronix.de \
    --cc=wenyang@linux.alibaba.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).