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>
---
sound/firewire/fireworks/fireworks_pcm.c | 2 +-
sound/pci/hda/patch_ca0132.c | 2 +-
sound/pci/hda/patch_hdmi.c | 2 +-
sound/soc/codecs/madera.c | 4 ++--
sound/soc/codecs/wm8350.c | 3 ++-
sound/soc/intel/boards/bytcr_rt5651.c | 2 +-
sound/soc/samsung/snow.c | 2 +-
sound/soc/soc-dapm.c | 2 +-
sound/soc/sof/intel/hda-dsp.c | 2 +-
9 files changed, 11 insertions(+), 10 deletions(-)
Replace commas with semicolons. What is done is essentially described by
the following Coccinelle semantic patch (http://coccinelle.lip6.fr/):
// <smpl>
@@ expression e1,e2; @@
e1
-,
+;
e2
... when any
// </smpl>
Signed-off-by: Julia Lawall <[email protected]>
---
sound/soc/codecs/madera.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/madera.c b/sound/soc/codecs/madera.c
index 680f31a6493a..f4ed7e04673f 100644
--- a/sound/soc/codecs/madera.c
+++ b/sound/soc/codecs/madera.c
@@ -3019,11 +3019,11 @@ static int madera_hw_params_rate(struct snd_pcm_substream *substream,
tar = 2 << MADERA_AIF1_RATE_SHIFT;
break;
case MADERA_CLK_ASYNCCLK_1:
- reg = MADERA_ASYNC_SAMPLE_RATE_1,
+ reg = MADERA_ASYNC_SAMPLE_RATE_1;
tar = 8 << MADERA_AIF1_RATE_SHIFT;
break;
case MADERA_CLK_ASYNCCLK_2:
- reg = MADERA_ASYNC_SAMPLE_RATE_2,
+ reg = MADERA_ASYNC_SAMPLE_RATE_2;
tar = 9 << MADERA_AIF1_RATE_SHIFT;
break;
default:
Replace commas with semicolons. What is done is essentially described by
the following Coccinelle semantic patch (http://coccinelle.lip6.fr/):
// <smpl>
@@ expression e1,e2; @@
e1
-,
+;
e2
... when any
// </smpl>
Signed-off-by: Julia Lawall <[email protected]>
---
sound/firewire/fireworks/fireworks_pcm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/firewire/fireworks/fireworks_pcm.c b/sound/firewire/fireworks/fireworks_pcm.c
index 980580dfbb39..a0d5db1d8eb2 100644
--- a/sound/firewire/fireworks/fireworks_pcm.c
+++ b/sound/firewire/fireworks/fireworks_pcm.c
@@ -148,7 +148,7 @@ pcm_init_hw_params(struct snd_efw *efw,
}
/* limit rates */
- runtime->hw.rates = efw->supported_sampling_rate,
+ runtime->hw.rates = efw->supported_sampling_rate;
snd_pcm_limit_hw_rates(runtime);
limit_channels(&runtime->hw, pcm_channels);
Replace commas with semicolons. What is done is essentially described by
the following Coccinelle semantic patch (http://coccinelle.lip6.fr/):
// <smpl>
@@ expression e1,e2; @@
e1
-,
+;
e2
... when any
// </smpl>
Signed-off-by: Julia Lawall <[email protected]>
---
sound/soc/intel/boards/bytcr_rt5651.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/intel/boards/bytcr_rt5651.c b/sound/soc/intel/boards/bytcr_rt5651.c
index 688b5e0a49e3..64d3fc4a3225 100644
--- a/sound/soc/intel/boards/bytcr_rt5651.c
+++ b/sound/soc/intel/boards/bytcr_rt5651.c
@@ -143,7 +143,7 @@ static int byt_rt5651_prepare_and_enable_pll1(struct snd_soc_dai *codec_dai,
/* Configure the PLL before selecting it */
if (!(byt_rt5651_quirk & BYT_RT5651_MCLK_EN)) {
- clk_id = RT5651_PLL1_S_BCLK1,
+ clk_id = RT5651_PLL1_S_BCLK1;
clk_freq = rate * bclk_ratio;
} else {
clk_id = RT5651_PLL1_S_MCLK;
Replace commas with semicolons. What is done is essentially described by
the following Coccinelle semantic patch (http://coccinelle.lip6.fr/):
// <smpl>
@@ expression e1,e2; @@
e1
-,
+;
e2
... when any
// </smpl>
Signed-off-by: Julia Lawall <[email protected]>
---
sound/soc/samsung/snow.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/samsung/snow.c b/sound/soc/samsung/snow.c
index 07163f07c6d5..989af624dd11 100644
--- a/sound/soc/samsung/snow.c
+++ b/sound/soc/samsung/snow.c
@@ -189,7 +189,7 @@ static int snow_probe(struct platform_device *pdev)
return PTR_ERR(priv->clk_i2s_bus);
}
} else {
- link->codecs->dai_name = "HiFi",
+ link->codecs->dai_name = "HiFi";
link->cpus->of_node = of_parse_phandle(dev->of_node,
"samsung,i2s-controller", 0);
On Sun, Oct 11, 2020 at 11:19:37AM +0200, Julia Lawall wrote:
> Replace commas with semicolons. What is done is essentially described by
> the following Coccinelle semantic patch (http://coccinelle.lip6.fr/):
>
> // <smpl>
> @@ expression e1,e2; @@
> e1
> -,
> +;
> e2
> ... when any
> // </smpl>
>
> Signed-off-by: Julia Lawall <[email protected]>
>
> ---
> sound/soc/samsung/snow.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Krzysztof Kozlowski <[email protected]>
Best regards,
Krzysztof
On 2020-10-11 11:19 AM, Julia Lawall wrote:
> Replace commas with semicolons. What is done is essentially described by
> the following Coccinelle semantic patch (http://coccinelle.lip6.fr/):
>
> // <smpl>
> @@ expression e1,e2; @@
> e1
> -,
> +;
> e2
> ... when any
> // </smpl>
>
> Signed-off-by: Julia Lawall <[email protected]>
>
Acked-by: Cezary Rojewski <[email protected]>
Thanks,
Czarek
> ---
> sound/soc/intel/boards/bytcr_rt5651.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/sound/soc/intel/boards/bytcr_rt5651.c b/sound/soc/intel/boards/bytcr_rt5651.c
> index 688b5e0a49e3..64d3fc4a3225 100644
> --- a/sound/soc/intel/boards/bytcr_rt5651.c
> +++ b/sound/soc/intel/boards/bytcr_rt5651.c
> @@ -143,7 +143,7 @@ static int byt_rt5651_prepare_and_enable_pll1(struct snd_soc_dai *codec_dai,
>
> /* Configure the PLL before selecting it */
> if (!(byt_rt5651_quirk & BYT_RT5651_MCLK_EN)) {
> - clk_id = RT5651_PLL1_S_BCLK1,
> + clk_id = RT5651_PLL1_S_BCLK1;
> clk_freq = rate * bclk_ratio;
> } else {
> clk_id = RT5651_PLL1_S_MCLK;
>
On Sun, 11 Oct 2020 11:19:35 +0200,
Julia Lawall wrote:
>
> Replace commas with semicolons. What is done is essentially described by
> the following Coccinelle semantic patch (http://coccinelle.lip6.fr/):
>
> // <smpl>
> @@ expression e1,e2; @@
> e1
> -,
> +;
> e2
> ... when any
> // </smpl>
>
> Signed-off-by: Julia Lawall <[email protected]>
Applied now. Thanks.
Takashi
On Sun, Oct 11, 2020 at 11:19:38AM +0200, Julia Lawall wrote:
> Replace commas with semicolons. What is done is essentially described by
> the following Coccinelle semantic patch (http://coccinelle.lip6.fr/):
>
> // <smpl>
> @@ expression e1,e2; @@
> e1
> -,
> +;
> e2
> ... when any
> // </smpl>
>
> Signed-off-by: Julia Lawall <[email protected]>
>
> ---
Acked-by: Charles Keepax <[email protected]>
Thanks,
Charles