All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: cocci <cocci@systeme.lip6.fr>
Cc: backports <backports@vger.kernel.org>
Subject: Re: matching a modified identifier?
Date: Mon, 06 Feb 2017 12:55:19 +0100	[thread overview]
Message-ID: <1486382119.5430.2.camel@sipsolutions.net> (raw)
In-Reply-To: <1486380902.5430.1.camel@sipsolutions.net> (sfid-20170206_123508_512386_8466ADBF)


> @ attribute_group @
> identifier group;
> fresh identifier groups = group ## "_groups";
> declarer name ATTRIBUTE_GROUPS;
> @@
> 
> ATTRIBUTE_GROUPS(group);

If I add a dummy here:
+ATTRIBUTE_GROUPS_NAME(groups);

> @ class_group depends on attribute_group @
> identifier group_class;
> identifier attribute_group.groups;
> fresh identifier group_dev_attr = attribute_group.group ##
> "_dev_attrs";
> @@
> 
> struct class group_class = {
> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)
>         .dev_groups = groups,
> +#else
> +       .dev_attrs = group_dev_attr,
> +#endif
> };
> 
> [...]

Then the whole thing works - I guess I can live with that.

johannes
--
To unsubscribe from this list: send the line "unsubscribe backports" in

WARNING: multiple messages have this Message-ID (diff)
From: johannes@sipsolutions.net (Johannes Berg)
To: cocci@systeme.lip6.fr
Subject: [Cocci] matching a modified identifier?
Date: Mon, 06 Feb 2017 12:55:19 +0100	[thread overview]
Message-ID: <1486382119.5430.2.camel@sipsolutions.net> (raw)
In-Reply-To: <1486380902.5430.1.camel@sipsolutions.net> (sfid-20170206_123508_512386_8466ADBF)


> @ attribute_group @
> identifier group;
> fresh identifier groups = group ## "_groups";
> declarer name ATTRIBUTE_GROUPS;
> @@
> 
> ATTRIBUTE_GROUPS(group);

If I add a dummy here:
+ATTRIBUTE_GROUPS_NAME(groups);

> @ class_group depends on attribute_group @
> identifier group_class;
> identifier attribute_group.groups;
> fresh identifier group_dev_attr = attribute_group.group ##
> "_dev_attrs";
> @@
> 
> struct class group_class = {
> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,11,0)
> ????????.dev_groups = groups,
> +#else
> +???????.dev_attrs = group_dev_attr,
> +#endif
> };
> 
> [...]

Then the whole thing works - I guess I can live with that.

johannes

  reply	other threads:[~2017-02-06 11:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-06 11:35 matching a modified identifier? Johannes Berg
2017-02-06 11:35 ` [Cocci] " Johannes Berg
2017-02-06 11:55 ` Johannes Berg [this message]
2017-02-06 11:55   ` Johannes Berg
2017-02-06 12:22 ` Julia Lawall
2017-02-06 12:22   ` Julia Lawall
2017-02-06 12:37   ` Johannes Berg
2017-02-06 12:37     ` Johannes Berg

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=1486382119.5430.2.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=backports@vger.kernel.org \
    --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.