All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA: ctxfi: Change structure initialisation to C99 style
@ 2016-06-17 14:45 Amitoj Kaur Chawla
  2016-06-17 15:00   ` Takashi Iwai
  0 siblings, 1 reply; 3+ messages in thread
From: Amitoj Kaur Chawla @ 2016-06-17 14:45 UTC (permalink / raw)
  To: perex, tiwai, alsa-devel, linux-kernel
  Cc: julia.lawall, michael.leibowitz, keescook

For readability and to allow for structure randomisation, replace the
in order struct initialisation style with explicit field style.

The Coccinelle semantic patch used to make this change is as follows:

@decl@
identifier i1,fld;
type T;
field list[n] fs;
@@

struct i1 {
 fs
 T fld;
 ...};

@@
identifier decl.i1,i2,decl.fld;
expression e;
position bad.p, bad.fix;
@@

struct i1 i2@p = { ...,
+ .fld = e
- e@fix
 ,...};

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
---
 sound/pci/ctxfi/cthw20k2.c | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/sound/pci/ctxfi/cthw20k2.c b/sound/pci/ctxfi/cthw20k2.c
index 9dc2950..6414ecf 100644
--- a/sound/pci/ctxfi/cthw20k2.c
+++ b/sound/pci/ctxfi/cthw20k2.c
@@ -1615,23 +1615,23 @@ static int hw_dac_init(struct hw *hw, const struct dac_conf *info)
 	int i;
 	struct regs_cs4382 cs_read = {0};
 	struct regs_cs4382 cs_def = {
-				   0x00000001,  /* Mode Control 1 */
-				   0x00000000,  /* Mode Control 2 */
-				   0x00000084,  /* Mode Control 3 */
-				   0x00000000,  /* Filter Control */
-				   0x00000000,  /* Invert Control */
-				   0x00000024,  /* Mixing Control Pair 1 */
-				   0x00000000,  /* Vol Control A1 */
-				   0x00000000,  /* Vol Control B1 */
-				   0x00000024,  /* Mixing Control Pair 2 */
-				   0x00000000,  /* Vol Control A2 */
-				   0x00000000,  /* Vol Control B2 */
-				   0x00000024,  /* Mixing Control Pair 3 */
-				   0x00000000,  /* Vol Control A3 */
-				   0x00000000,  /* Vol Control B3 */
-				   0x00000024,  /* Mixing Control Pair 4 */
-				   0x00000000,  /* Vol Control A4 */
-				   0x00000000   /* Vol Control B4 */
+		.mode_control_1 = 0x00000001, /* Mode Control 1 */
+		.mode_control_2 = 0x00000000, /* Mode Control 2 */
+		.mode_control_3 = 0x00000084, /* Mode Control 3 */
+		.filter_control = 0x00000000, /* Filter Control */
+		.invert_control = 0x00000000, /* Invert Control */
+		.mix_control_P1 = 0x00000024, /* Mixing Control Pair 1 */
+		.vol_control_A1 = 0x00000000, /* Vol Control A1 */
+		.vol_control_B1 = 0x00000000, /* Vol Control B1 */
+		.mix_control_P2 = 0x00000024, /* Mixing Control Pair 2 */
+		.vol_control_A2 = 0x00000000, /* Vol Control A2 */
+		.vol_control_B2 = 0x00000000, /* Vol Control B2 */
+		.mix_control_P3 = 0x00000024, /* Mixing Control Pair 3 */
+		.vol_control_A3 = 0x00000000, /* Vol Control A3 */
+		.vol_control_B3 = 0x00000000, /* Vol Control B3 */
+		.mix_control_P4 = 0x00000024, /* Mixing Control Pair 4 */
+		.vol_control_A4 = 0x00000000, /* Vol Control A4 */
+		.vol_control_B4 = 0x00000000  /* Vol Control B4 */
 				 };
 
 	if (hw->model == CTSB1270) {
-- 
1.9.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ALSA: ctxfi: Change structure initialisation to C99 style
  2016-06-17 14:45 [PATCH] ALSA: ctxfi: Change structure initialisation to C99 style Amitoj Kaur Chawla
@ 2016-06-17 15:00   ` Takashi Iwai
  0 siblings, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2016-06-17 15:00 UTC (permalink / raw)
  To: Amitoj Kaur Chawla
  Cc: alsa-devel, perex, linux-kernel, keescook, michael.leibowitz,
	julia.lawall

On Fri, 17 Jun 2016 16:45:54 +0200,
Amitoj Kaur Chawla wrote:
> 
> For readability and to allow for structure randomisation, replace the
> in order struct initialisation style with explicit field style.
> 
> The Coccinelle semantic patch used to make this change is as follows:
> 
> @decl@
> identifier i1,fld;
> type T;
> field list[n] fs;
> @@
> 
> struct i1 {
>  fs
>  T fld;
>  ...};
> 
> @@
> identifier decl.i1,i2,decl.fld;
> expression e;
> position bad.p, bad.fix;
> @@
> 
> struct i1 i2@p = { ...,
> + .fld = e
> - e@fix
>  ,...};
> 
> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>

Applied, thanks.


Takashi

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] ALSA: ctxfi: Change structure initialisation to C99 style
@ 2016-06-17 15:00   ` Takashi Iwai
  0 siblings, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2016-06-17 15:00 UTC (permalink / raw)
  To: Amitoj Kaur Chawla
  Cc: alsa-devel, perex, linux-kernel, keescook, michael.leibowitz,
	julia.lawall

On Fri, 17 Jun 2016 16:45:54 +0200,
Amitoj Kaur Chawla wrote:
> 
> For readability and to allow for structure randomisation, replace the
> in order struct initialisation style with explicit field style.
> 
> The Coccinelle semantic patch used to make this change is as follows:
> 
> @decl@
> identifier i1,fld;
> type T;
> field list[n] fs;
> @@
> 
> struct i1 {
>  fs
>  T fld;
>  ...};
> 
> @@
> identifier decl.i1,i2,decl.fld;
> expression e;
> position bad.p, bad.fix;
> @@
> 
> struct i1 i2@p = { ...,
> + .fld = e
> - e@fix
>  ,...};
> 
> Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>

Applied, thanks.


Takashi

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-06-17 15:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-06-17 14:45 [PATCH] ALSA: ctxfi: Change structure initialisation to C99 style Amitoj Kaur Chawla
2016-06-17 15:00 ` Takashi Iwai
2016-06-17 15:00   ` Takashi Iwai

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.