cocci.inria.fr archive mirror
 help / color / mirror / Atom feed
From: Julia Lawall <julia.lawall@lip6.fr>
To: Markus Elfring <Markus.Elfring@web.de>
Cc: Coccinelle <cocci@systeme.lip6.fr>
Subject: Re: [Cocci] Moving exception handling code to the end of a function implementation with SmPL?
Date: Thu, 27 Jun 2019 16:54:11 +0200 (CEST)	[thread overview]
Message-ID: <alpine.DEB.2.21.1906271653410.2627@hadrien> (raw)
In-Reply-To: <ddc47c39-1977-fa90-2f93-72acb2303d6c@web.de>

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



On Thu, 27 Jun 2019, Markus Elfring wrote:

> >> replacement: already tagged token:
> >
> > You try to add two things one one token, which is not allowed.
>
> How do you think about to clarify why a source file adjustment
> like the following can let my SmPL script succeed in a test configuration?
>
> elfring@Sonne:~/Projekte/Coccinelle/Probe> diff -u megaraid_sas-excerpt1.c megaraid_sas-excerpt2.c
> …
> @@ -32,24 +32,7 @@
>  		goto out_kfree_ioc;
>  	}
>
> -	if (instance->unload == 1) {
> -		error = -ENODEV;
> -		goto out_kfree_ioc;
> -	}
> -
> -	if (down_interruptible(&instance->ioctl_sem)) {
> -		error = -ERESTARTSYS;
> -		goto out_kfree_ioc;
> -	}
> -
> -	if  (megasas_wait_for_adapter_operational(instance)) {
> -		error = -ENODEV;
> -		goto out_up;
> -	}
> -
> -	error = megasas_mgmt_fw_ioctl(instance, user_ioc, ioc);
> -out_up:
> -	up(&instance->ioctl_sem);
> +// Deleted part
>
>  out_kfree_ioc:
>  	kfree(ioc);
>
>
> Where did the Coccinelle software get the impression that anything
> would be added too often at the end of such a function implementation?

Without the semantic patch and the C source code, I can't answer the
question.

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:[~2019-06-27 14:54 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-21 17:45 [Cocci] Moving exception handling code to the end of a function implementation with SmPL? Markus Elfring
2019-06-27  8:33 ` Markus Elfring
2019-06-27 11:33   ` Julia Lawall
2019-06-27 12:18     ` Markus Elfring
     [not found]       ` <alpine.DEB.2.21.1906271427250.2627@hadrien>
2019-06-27 12:45         ` Markus Elfring
2019-06-27 14:12         ` Markus Elfring
2019-06-27 14:54           ` Julia Lawall [this message]
2019-06-27 15:01             ` Markus Elfring
2019-10-31 12:27 ` Markus Elfring
2019-10-31 12:42   ` Julia Lawall
2019-10-31 13:50     ` Markus Elfring
2019-11-01  9:12   ` [Cocci] Checking the occurrence of trailing spaces in a semantic patch Markus Elfring
2019-11-01  9:38     ` Julia Lawall
2019-11-01  9:56       ` Markus Elfring
2019-11-01 11:50       ` Markus Elfring
2019-11-01 16:03       ` [Cocci] Checking code layout for adding jump targets with SmPL Markus Elfring
2019-11-01 16:12         ` 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.1906271653410.2627@hadrien \
    --to=julia.lawall@lip6.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).