cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@inria.fr>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: Coccinelle <cocci@systeme.lip6.fr>
Subject: Re: [Cocci] Determination of failure predicates for selected function calls with SmPL?
Date: Wed, 25 Mar 2020 18:32:47 +0100 (CET)	[thread overview]
Message-ID: <alpine.DEB.2.21.2003251830510.2306@hadrien> (raw)
In-Reply-To: <757cdb2d-9274-4d7d-64b8-387c76254254@web.de>

[-- Attachment #1: Type: text/plain, Size: 983 bytes --]



On Wed, 25 Mar 2020, Markus Elfring wrote:

> Hello,
>
> I have noticed the patch “tty: serial: fsl_lpuart: fix return value checking”.
> https://lore.kernel.org/linux-serial/20200325090658.25967-2-michael@walle.cc/
> https://lore.kernel.org/patchwork/patch/1215542/
> https://lkml.org/lkml/2020/3/25/202
>
> I am curious if such a software transformation can be extended for similar
> source code searches also by the means of the semantic patch language.
> The proper knowledge of failure predicates for function calls is a key aspect
> for this use case.
> Would you like to clarify any corresponding development possibilities?

I'm not sure what there is to clarify.  One can surely write rules that
find this kind of problem, with a varying rate of false positives.

A simple approach would be to check all occurrences of if (!ret) for an
integer-typed variable, because typically that is the success case.  But
sometimes people do put the success case under an if.

julia

[-- Attachment #2: Type: text/plain, Size: 136 bytes --]

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

  reply	other threads:[~2020-03-25 17:33 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-25 17:00 [Cocci] Determination of failure predicates for selected function calls with SmPL? Markus Elfring
2020-03-25 17:32 ` Julia Lawall [this message]
2020-03-25 18:00   ` Markus Elfring
2020-03-26  6:45   ` 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=alpine.DEB.2.21.2003251830510.2306@hadrien \
    --to=julia.lawall@inria.fr \
    --cc=Markus.Elfring@web.de \
    --cc=cocci@systeme.lip6.fr \
    /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).