All of lore.kernel.org
 help / color / mirror / Atom feed
From: elfring@users.sourceforge.net (SF Markus Elfring)
To: cocci@systeme.lip6.fr
Subject: [Cocci] Comments removed on (adjacent) lines not touched ... ?
Date: Wed, 9 Sep 2015 14:14:15 +0200	[thread overview]
Message-ID: <55F02297.6070503@users.sourceforge.net> (raw)
In-Reply-To: <CAB3z_Rpt-nF3=V_OFcBiLkYvbPefPZXA0DsRm+BUJU6gG95RMw@mail.gmail.com>

> Reviewing the changes made by my s-patch, I've come across the following hunk :

How do you think about to show your semantic patch script here?


> +++ b/drivers/hwmon/jc42.c
> ...
> @@ -529,13 +529,7 @@ static const struct dev_pm_ops jc42_dev_pm_ops = {
>  #define JC42_DEV_PM_OPS (&jc42_dev_pm_ops)
>  #else
>  #define JC42_DEV_PM_OPS NULL
> -#endif /* CONFIG_PM */
> -
> -static const struct i2c_device_id jc42_id[] = {
> -       { "jc42", 0 },
> -       { }
> -};
> -MODULE_DEVICE_TABLE(i2c, jc42_id);
> +#endif
>
>  static struct i2c_driver jc42_driver = {
>         .class          = I2C_CLASS_SPD,
> ============================================================
>
> Is this removal of the /* CONFIG_PM */ expected behaviour?

I would interpret the shown changes in the way that a preprocessor
statement "#endif" is repositioned after a variable initialisation which
was not a part for conditional compilation is deleted. I find such a
detail also strange.


> I guess under the hood, Coccinelle is stripping comments from code to
> make parsing possible/easier?

This software is tackling some challenges to preserve comments for
various source code places.

Regards,
Markus

  reply	other threads:[~2015-09-09 12:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-09 10:56 [Cocci] Comments removed on (adjacent) lines not touched ... ? Kieran Bingham
2015-09-09 12:14 ` SF Markus Elfring [this message]
2015-09-09 13:33   ` Kieran Bingham
2015-09-09 14:01 ` Julia Lawall
2015-09-09 14:07   ` Kieran Bingham
2015-09-09 14:18     ` Julia Lawall
2015-09-09 14:28       ` Kieran Bingham
2015-09-09 14:48         ` SF Markus Elfring
2015-09-09 14:55           ` Kieran Bingham
2015-09-10 16:24             ` Julia Lawall
2015-09-09 14:38     ` Julia Lawall

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=55F02297.6070503@users.sourceforge.net \
    --to=elfring@users.sourceforge.net \
    --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 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.