All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julia Lawall <Julia.Lawall@inria.fr>
To: linux-samsung-soc@vger.kernel.org
Cc: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>,
	"Joe Perches" <joe@perches.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	kernel-janitors@vger.kernel.org,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: [PATCH 00/20] media: use semicolons rather than commas to separate statements
Date: Tue, 29 Sep 2020 15:14:23 +0200	[thread overview]
Message-ID: <1601385283-26144-1-git-send-email-Julia.Lawall@inria.fr> (raw)

These patches replace commas by semicolons.  This was done using the
Coccinelle semantic patch (http://coccinelle.lip6.fr/) shown below.

This semantic patch ensures that commas inside for loop headers will not be
transformed.  It also doesn't touch macro definitions.

Coccinelle ensures that braces are added as needed when a single-statement
branch turns into a multi-statement one.

This semantic patch has a few false positives, for variable delcarations
such as:

LIST_HEAD(x), *y;

The semantic patch could be improved to avoid these, but for the moment
they have been removed manually (2 occurrences).

// <smpl>
@initialize:ocaml@
@@

let infunction p =
  (* avoid macros *)
  (List.hd p).current_element <> "something_else"

let combined p1 p2 =
  (List.hd p1).line_end = (List.hd p2).line ||
  (((List.hd p1).line_end < (List.hd p2).line) &&
   ((List.hd p1).col < (List.hd p2).col))

@bad@
statement S;
declaration d;
position p;
@@

S@p
d

// special cases where newlines are needed (hope for no more than 5)
@@
expression e1,e2;
statement S;
position p != bad.p;
position p1;
position p2 :
    script:ocaml(p1) { infunction p1 && combined p1 p2 };
@@

- e1@p1,@S@p e2@p2;
+ e1; e2;

@@
expression e1,e2;
statement S;
position p != bad.p;
position p1;
position p2 :
    script:ocaml(p1) { infunction p1 && combined p1 p2 };
@@

- e1@p1,@S@p e2@p2;
+ e1; e2;

@@
expression e1,e2;
statement S;
position p != bad.p;
position p1;
position p2 :
    script:ocaml(p1) { infunction p1 && combined p1 p2 };
@@

- e1@p1,@S@p e2@p2;
+ e1; e2;

@@
expression e1,e2;
statement S;
position p != bad.p;
position p1;
position p2 :
    script:ocaml(p1) { infunction p1 && combined p1 p2 };
@@

- e1@p1,@S@p e2@p2;
+ e1; e2;

@@
expression e1,e2;
statement S;
position p != bad.p;
position p1;
position p2 :
    script:ocaml(p1) { infunction p1 && combined p1 p2 };
@@

- e1@p1,@S@p e2@p2;
+ e1; e2;

@r@
expression e1,e2;
statement S;
position p != bad.p;
@@

e1 ,@S@p e2;

@@
expression e1,e2;
position p1;
position p2 :
    script:ocaml(p1) { infunction p1 && not(combined p1 p2) };
statement S;
position r.p;
@@

e1@p1
-,@S@p
+;
e2@p2
... when any
// </smpl>

---

 drivers/media/dvb-frontends/m88ds3103.c             |    6 ++---
 drivers/media/dvb-frontends/rtl2832.c               |   14 ++++++------
 drivers/media/dvb-frontends/ts2020.c                |   10 ++++-----
 drivers/media/i2c/msp3400-kthreads.c                |   12 +++++++---
 drivers/media/pci/bt8xx/bttv-cards.c                |    6 +++--
 drivers/media/pci/saa7134/saa7134-video.c           |    7 ++++--
 drivers/media/platform/coda/coda-common.c           |    2 -
 drivers/media/platform/exynos4-is/fimc-core.c       |    6 +++--
 drivers/media/platform/s3c-camif/camif-core.c       |    6 +++--
 drivers/media/platform/sunxi/sun4i-csi/sun4i_v4l2.c |    2 -
 drivers/media/radio/radio-sf16fmr2.c                |    2 -
 drivers/media/tuners/mt2060.c                       |    2 -
 drivers/media/usb/au0828/au0828-video.c             |    2 -
 drivers/media/usb/dvb-usb-v2/dvbsky.c               |   22 ++++++++++----------
 drivers/media/usb/dvb-usb-v2/lmedm04.c              |    2 -
 drivers/media/usb/dvb-usb-v2/rtl28xxu.c             |    4 +--
 drivers/media/usb/dvb-usb/dib0700_devices.c         |    4 +--
 drivers/media/usb/em28xx/em28xx-audio.c             |   14 ++++++------
 drivers/media/usb/gspca/ov534.c                     |   12 +++++-----
 drivers/media/usb/pvrusb2/pvrusb2-devattr.c         |    2 -
 20 files changed, 75 insertions(+), 62 deletions(-)

WARNING: multiple messages have this Message-ID (diff)
From: Julia Lawall <Julia.Lawall@inria.fr>
To: linux-samsung-soc@vger.kernel.org
Cc: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Joe Perches" <joe@perches.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-media@vger.kernel.org
Subject: [PATCH 00/20] media: use semicolons rather than commas to separate statements
Date: Tue, 29 Sep 2020 13:14:23 +0000	[thread overview]
Message-ID: <1601385283-26144-1-git-send-email-Julia.Lawall@inria.fr> (raw)

These patches replace commas by semicolons.  This was done using the
Coccinelle semantic patch (http://coccinelle.lip6.fr/) shown below.

This semantic patch ensures that commas inside for loop headers will not be
transformed.  It also doesn't touch macro definitions.

Coccinelle ensures that braces are added as needed when a single-statement
branch turns into a multi-statement one.

This semantic patch has a few false positives, for variable delcarations
such as:

LIST_HEAD(x), *y;

The semantic patch could be improved to avoid these, but for the moment
they have been removed manually (2 occurrences).

// <smpl>
@initialize:ocaml@
@@

let infunction p   (* avoid macros *)
  (List.hd p).current_element <> "something_else"

let combined p1 p2   (List.hd p1).line_end = (List.hd p2).line ||
  (((List.hd p1).line_end < (List.hd p2).line) &&
   ((List.hd p1).col < (List.hd p2).col))

@bad@
statement S;
declaration d;
position p;
@@

S@p
d

// special cases where newlines are needed (hope for no more than 5)
@@
expression e1,e2;
statement S;
position p != bad.p;
position p1;
position p2 :
    script:ocaml(p1) { infunction p1 && combined p1 p2 };
@@

- e1@p1,@S@p e2@p2;
+ e1; e2;

@@
expression e1,e2;
statement S;
position p != bad.p;
position p1;
position p2 :
    script:ocaml(p1) { infunction p1 && combined p1 p2 };
@@

- e1@p1,@S@p e2@p2;
+ e1; e2;

@@
expression e1,e2;
statement S;
position p != bad.p;
position p1;
position p2 :
    script:ocaml(p1) { infunction p1 && combined p1 p2 };
@@

- e1@p1,@S@p e2@p2;
+ e1; e2;

@@
expression e1,e2;
statement S;
position p != bad.p;
position p1;
position p2 :
    script:ocaml(p1) { infunction p1 && combined p1 p2 };
@@

- e1@p1,@S@p e2@p2;
+ e1; e2;

@@
expression e1,e2;
statement S;
position p != bad.p;
position p1;
position p2 :
    script:ocaml(p1) { infunction p1 && combined p1 p2 };
@@

- e1@p1,@S@p e2@p2;
+ e1; e2;

@r@
expression e1,e2;
statement S;
position p != bad.p;
@@

e1 ,@S@p e2;

@@
expression e1,e2;
position p1;
position p2 :
    script:ocaml(p1) { infunction p1 && not(combined p1 p2) };
statement S;
position r.p;
@@

e1@p1
-,@S@p
+;
e2@p2
... when any
// </smpl>

---

 drivers/media/dvb-frontends/m88ds3103.c             |    6 ++---
 drivers/media/dvb-frontends/rtl2832.c               |   14 ++++++------
 drivers/media/dvb-frontends/ts2020.c                |   10 ++++-----
 drivers/media/i2c/msp3400-kthreads.c                |   12 +++++++---
 drivers/media/pci/bt8xx/bttv-cards.c                |    6 +++--
 drivers/media/pci/saa7134/saa7134-video.c           |    7 ++++--
 drivers/media/platform/coda/coda-common.c           |    2 -
 drivers/media/platform/exynos4-is/fimc-core.c       |    6 +++--
 drivers/media/platform/s3c-camif/camif-core.c       |    6 +++--
 drivers/media/platform/sunxi/sun4i-csi/sun4i_v4l2.c |    2 -
 drivers/media/radio/radio-sf16fmr2.c                |    2 -
 drivers/media/tuners/mt2060.c                       |    2 -
 drivers/media/usb/au0828/au0828-video.c             |    2 -
 drivers/media/usb/dvb-usb-v2/dvbsky.c               |   22 ++++++++++----------
 drivers/media/usb/dvb-usb-v2/lmedm04.c              |    2 -
 drivers/media/usb/dvb-usb-v2/rtl28xxu.c             |    4 +--
 drivers/media/usb/dvb-usb/dib0700_devices.c         |    4 +--
 drivers/media/usb/em28xx/em28xx-audio.c             |   14 ++++++------
 drivers/media/usb/gspca/ov534.c                     |   12 +++++-----
 drivers/media/usb/pvrusb2/pvrusb2-devattr.c         |    2 -
 20 files changed, 75 insertions(+), 62 deletions(-)

WARNING: multiple messages have this Message-ID (diff)
From: Julia Lawall <Julia.Lawall@inria.fr>
To: linux-samsung-soc@vger.kernel.org
Cc: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>,
	kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Joe Perches" <joe@perches.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Mauro Carvalho Chehab" <mchehab@kernel.org>,
	linux-arm-kernel@lists.infradead.org,
	linux-media@vger.kernel.org
Subject: [PATCH 00/20] media: use semicolons rather than commas to separate statements
Date: Tue, 29 Sep 2020 15:14:23 +0200	[thread overview]
Message-ID: <1601385283-26144-1-git-send-email-Julia.Lawall@inria.fr> (raw)

These patches replace commas by semicolons.  This was done using the
Coccinelle semantic patch (http://coccinelle.lip6.fr/) shown below.

This semantic patch ensures that commas inside for loop headers will not be
transformed.  It also doesn't touch macro definitions.

Coccinelle ensures that braces are added as needed when a single-statement
branch turns into a multi-statement one.

This semantic patch has a few false positives, for variable delcarations
such as:

LIST_HEAD(x), *y;

The semantic patch could be improved to avoid these, but for the moment
they have been removed manually (2 occurrences).

// <smpl>
@initialize:ocaml@
@@

let infunction p =
  (* avoid macros *)
  (List.hd p).current_element <> "something_else"

let combined p1 p2 =
  (List.hd p1).line_end = (List.hd p2).line ||
  (((List.hd p1).line_end < (List.hd p2).line) &&
   ((List.hd p1).col < (List.hd p2).col))

@bad@
statement S;
declaration d;
position p;
@@

S@p
d

// special cases where newlines are needed (hope for no more than 5)
@@
expression e1,e2;
statement S;
position p != bad.p;
position p1;
position p2 :
    script:ocaml(p1) { infunction p1 && combined p1 p2 };
@@

- e1@p1,@S@p e2@p2;
+ e1; e2;

@@
expression e1,e2;
statement S;
position p != bad.p;
position p1;
position p2 :
    script:ocaml(p1) { infunction p1 && combined p1 p2 };
@@

- e1@p1,@S@p e2@p2;
+ e1; e2;

@@
expression e1,e2;
statement S;
position p != bad.p;
position p1;
position p2 :
    script:ocaml(p1) { infunction p1 && combined p1 p2 };
@@

- e1@p1,@S@p e2@p2;
+ e1; e2;

@@
expression e1,e2;
statement S;
position p != bad.p;
position p1;
position p2 :
    script:ocaml(p1) { infunction p1 && combined p1 p2 };
@@

- e1@p1,@S@p e2@p2;
+ e1; e2;

@@
expression e1,e2;
statement S;
position p != bad.p;
position p1;
position p2 :
    script:ocaml(p1) { infunction p1 && combined p1 p2 };
@@

- e1@p1,@S@p e2@p2;
+ e1; e2;

@r@
expression e1,e2;
statement S;
position p != bad.p;
@@

e1 ,@S@p e2;

@@
expression e1,e2;
position p1;
position p2 :
    script:ocaml(p1) { infunction p1 && not(combined p1 p2) };
statement S;
position r.p;
@@

e1@p1
-,@S@p
+;
e2@p2
... when any
// </smpl>

---

 drivers/media/dvb-frontends/m88ds3103.c             |    6 ++---
 drivers/media/dvb-frontends/rtl2832.c               |   14 ++++++------
 drivers/media/dvb-frontends/ts2020.c                |   10 ++++-----
 drivers/media/i2c/msp3400-kthreads.c                |   12 +++++++---
 drivers/media/pci/bt8xx/bttv-cards.c                |    6 +++--
 drivers/media/pci/saa7134/saa7134-video.c           |    7 ++++--
 drivers/media/platform/coda/coda-common.c           |    2 -
 drivers/media/platform/exynos4-is/fimc-core.c       |    6 +++--
 drivers/media/platform/s3c-camif/camif-core.c       |    6 +++--
 drivers/media/platform/sunxi/sun4i-csi/sun4i_v4l2.c |    2 -
 drivers/media/radio/radio-sf16fmr2.c                |    2 -
 drivers/media/tuners/mt2060.c                       |    2 -
 drivers/media/usb/au0828/au0828-video.c             |    2 -
 drivers/media/usb/dvb-usb-v2/dvbsky.c               |   22 ++++++++++----------
 drivers/media/usb/dvb-usb-v2/lmedm04.c              |    2 -
 drivers/media/usb/dvb-usb-v2/rtl28xxu.c             |    4 +--
 drivers/media/usb/dvb-usb/dib0700_devices.c         |    4 +--
 drivers/media/usb/em28xx/em28xx-audio.c             |   14 ++++++------
 drivers/media/usb/gspca/ov534.c                     |   12 +++++-----
 drivers/media/usb/pvrusb2/pvrusb2-devattr.c         |    2 -
 20 files changed, 75 insertions(+), 62 deletions(-)

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

             reply	other threads:[~2020-09-29 13:57 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-29 13:14 Julia Lawall [this message]
2020-09-29 13:14 ` [PATCH 00/20] media: use semicolons rather than commas to separate statements Julia Lawall
2020-09-29 13:14 ` Julia Lawall
2020-09-29 13:14 ` [PATCH 01/20] media: coda: " Julia Lawall
2020-09-29 13:14   ` Julia Lawall
2020-09-29 14:06   ` Philipp Zabel
2020-09-29 14:06     ` Philipp Zabel
2020-09-29 13:14 ` [PATCH 02/20] media: em28xx-audio: " Julia Lawall
2020-09-29 13:14   ` Julia Lawall
2020-09-29 13:14 ` [PATCH 03/20] media: rtl28xxu: " Julia Lawall
2020-09-29 13:14   ` Julia Lawall
2020-09-29 13:14 ` [PATCH 04/20] media: saa7134: " Julia Lawall
2020-09-29 13:14   ` Julia Lawall
2020-09-29 15:57   ` Christophe JAILLET
2020-09-29 15:57     ` Christophe JAILLET
2020-09-29 16:46     ` Julia Lawall
2020-09-29 16:46       ` Julia Lawall
2020-09-29 13:14 ` [PATCH 05/20] media: m88ds3103: " Julia Lawall
2020-09-29 13:14   ` Julia Lawall
2020-09-29 13:14 ` [PATCH 06/20] media: gspca: ov534-ov772x: " Julia Lawall
2020-09-29 13:14   ` Julia Lawall
2020-09-29 13:14 ` [PATCH 07/20] media: s3c-camif: " Julia Lawall
2020-09-29 13:14   ` Julia Lawall
2020-09-29 13:14 ` [PATCH 08/20] media: sun4i-csi: " Julia Lawall
2020-09-29 13:14   ` Julia Lawall
2020-09-29 13:14   ` Julia Lawall
2020-09-29 13:14 ` [PATCH 09/20] media: pvrusb2: " Julia Lawall
2020-09-29 13:14   ` Julia Lawall
2020-09-29 13:14 ` [PATCH 10/20] media: lmedm04: " Julia Lawall
2020-09-29 13:14   ` Julia Lawall
2020-09-29 16:00   ` Christophe JAILLET
2020-09-29 16:00     ` Christophe JAILLET
2020-09-29 16:42     ` Joe Perches
2020-09-29 16:42       ` Joe Perches
2020-09-29 16:44       ` Julia Lawall
2020-09-29 16:44         ` Julia Lawall
2020-09-29 22:21         ` Joe Perches
2020-09-29 22:21           ` Joe Perches
2020-09-30  1:27           ` Joe Perches
2020-09-30  1:27             ` Joe Perches
2020-09-29 16:56       ` Julia Lawall
2020-09-29 16:56         ` Julia Lawall
2020-09-29 18:43       ` Julia Lawall
2020-09-29 18:43         ` Julia Lawall
2020-09-29 16:43     ` Julia Lawall
2020-09-29 16:43       ` Julia Lawall
2020-09-29 13:14 ` [PATCH 11/20] media: ts2020: " Julia Lawall
2020-09-29 13:14   ` Julia Lawall
2020-09-29 13:14 ` [PATCH 12/20] media: msp3400: " Julia Lawall
2020-09-29 13:14   ` Julia Lawall
2020-09-29 13:14 ` [PATCH 13/20] media: radio-sf16fmr2: " Julia Lawall
2020-09-29 13:14   ` Julia Lawall
2020-09-29 13:14 ` [PATCH 14/20] media: mt2060: " Julia Lawall
2020-09-29 13:14   ` Julia Lawall
2020-09-29 13:14 ` [PATCH 15/20] media: au0828: " Julia Lawall
2020-09-29 13:14   ` Julia Lawall
2020-09-29 13:14 ` [PATCH 16/20] media: dvbsky: " Julia Lawall
2020-09-29 13:14   ` Julia Lawall
2020-09-29 13:14 ` [PATCH 17/20] media: dib0700: " Julia Lawall
2020-09-29 13:14   ` Julia Lawall
2020-09-29 13:14 ` [PATCH 18/20] media: rtl2832: " Julia Lawall
2020-09-29 13:14   ` Julia Lawall
2020-09-29 13:14 ` [PATCH 19/20] media: exynos4-is: " Julia Lawall
2020-09-29 13:14   ` Julia Lawall
2020-09-29 13:14   ` Julia Lawall
2020-09-29 13:14 ` [PATCH 20/20] media: bttv: " Julia Lawall
2020-09-29 13:14   ` 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=1601385283-26144-1-git-send-email-Julia.Lawall@inria.fr \
    --to=julia.lawall@inria.fr \
    --cc=joe@perches.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=tglx@linutronix.de \
    --cc=valdis.kletnieks@vt.edu \
    /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.