From: julia.lawall@lip6.fr (Julia Lawall)
To: cocci@systeme.lip6.fr
Subject: [Cocci] White space formatting
Date: Wed, 9 Sep 2015 16:07:14 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.10.1509091603370.2798@hadrien> (raw)
In-Reply-To: <CAB3z_RouDi7OcMBM3nZx2SKv6NRR6wb0TLRLqzQ9_jE49AHGUg@mail.gmail.com>
On Wed, 9 Sep 2015, Kieran Bingham wrote:
> Hi Julia et al.
>
> Working on an s-patch for a large linux change, I am removing a
> function argument.
> This works as expected, but seems to leave a lot of lonely dangling
> brackets which would really benefit from being hugged!
>
> Full patch on viewable here:
> https://gist.github.com/kbingham/96477177dd20a72b1c2f
>
> but the relevant segment is:
>
> ===========================================
> // Convert the probe function
>
> @ depends on driver @
> identifier driver.probefunc;
> identifier client;
> identifier id;
> @@
> static int probefunc(
> struct i2c_client *client,
> - const struct i2c_device_id *id
> )
> { ... }
> ===========================================
>
>
>
> This ends up creating a lot of changes that look like:
> ===========================================
> @@ -489,8 +489,8 @@ static struct at24_platform_data eeprom_info = {
> */
> static struct i2c_client *dm6446evm_msp;
>
> -static int dm6446evm_msp_probe(struct i2c_client *client,
> - const struct i2c_device_id *id)
> +static int dm6446evm_msp_probe(struct i2c_client *client
> + )
> {
> dm6446evm_msp = client;
> return 0;
> ===========================================
>
>
> I am using --linux-spacing - but as the help states :
> --linux-spacing spacing of + code follows the
> conventions of Linux
>
> I suspect code is perhaps not refactored on - lines?
>
>
>
> The lines where I make additions are also not as I desire (aligned
> with the block) - but I suspect I will have to manually align these or
> try running lindent:
>
> ===========================================
> -
> static struct i2c_driver dm6446evm_msp_driver = {
> .driver.name = "dm6446evm_msp",
> - .id_table = dm6446evm_msp_ids,
> - .probe = dm6446evm_msp_probe,
> + .probe2 = dm6446evm_msp_probe,
Yeah, there is nothing to address this. It's kind of a special case, so
I'm not sure that there will be anything in the near future either.
> .remove = dm6446evm_msp_remove,
> };
> ===========================================
>
>
> Are there any other ways to control the white-space adjustments made?
>
>
> For reference: I'm on Ubuntu 15.04 with default coccinelle from the distro:
> spatch --version
> spatch version 1.0.0-rc22 with Python support and with PCRE support
You should upgrade to 1.0.2.
julia
next prev parent reply other threads:[~2015-09-09 14:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-09 10:04 [Cocci] White space formatting Kieran Bingham
2015-09-09 14:07 ` Julia Lawall [this message]
2015-09-09 14:49 ` Kieran Bingham
2015-09-09 15:05 ` SF Markus Elfring
2015-09-09 15:08 ` Kieran Bingham
2015-09-09 15:18 ` Kieran Bingham
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.10.1509091603370.2798@hadrien \
--to=julia.lawall@lip6.fr \
--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.