All of lore.kernel.org
 help / color / mirror / Atom feed
* How to post cleanup patches ?
@ 2016-08-03  1:12 ` Kuninori Morimoto
  0 siblings, 0 replies; 19+ messages in thread
From: Kuninori Morimoto @ 2016-08-03  1:12 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Liam Girdwood, Simon, linux-renesas-soc


Hi Mark

Now codec driver and component driver has duplicated callback function,
and snd_soc_register_codec() just copied it to component side.

	int snd_soc_register_codec(xxx) {
		...
 
		if (codec_drv->controls) {
			codec->component.controls = codec_drv->controls;
			codec->component.num_controls = codec_drv->num_controls;
		}
		if (codec_drv->dapm_widgets) {
			codec->component.dapm_widgets = codec_drv->dapm_widgets;
			codec->component.num_dapm_widgets = codec_drv->num_dapm_widgets;
		}
		if (codec_drv->dapm_routes) {
			codec->component.dapm_routes = codec_drv->dapm_routes;
			codec->component.num_dapm_routes = codec_drv->num_dapm_routes;
		}
		...
	}

I think we can cleanup this duplicated function, similar things happen on
.probe, .remove, and platform side too.

I would like to post cleanup patches for these.
As 1st step, remove codec duplicate callback.

But my concern is that you hate big-patch-set, and it is almost 70 patches.
Can I post these patches to ML ? or should I use git pull request ? or I shouldn't post ?

I will post main patches as sample patch

Best regards
---
Kuninori Morimoto

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

* How to post cleanup patches ?
@ 2016-08-03  1:12 ` Kuninori Morimoto
  0 siblings, 0 replies; 19+ messages in thread
From: Kuninori Morimoto @ 2016-08-03  1:12 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Liam Girdwood, Simon, linux-renesas-soc


Hi Mark

Now codec driver and component driver has duplicated callback function,
and snd_soc_register_codec() just copied it to component side.

	int snd_soc_register_codec(xxx) {
		...
 
		if (codec_drv->controls) {
			codec->component.controls = codec_drv->controls;
			codec->component.num_controls = codec_drv->num_controls;
		}
		if (codec_drv->dapm_widgets) {
			codec->component.dapm_widgets = codec_drv->dapm_widgets;
			codec->component.num_dapm_widgets = codec_drv->num_dapm_widgets;
		}
		if (codec_drv->dapm_routes) {
			codec->component.dapm_routes = codec_drv->dapm_routes;
			codec->component.num_dapm_routes = codec_drv->num_dapm_routes;
		}
		...
	}

I think we can cleanup this duplicated function, similar things happen on
.probe, .remove, and platform side too.

I would like to post cleanup patches for these.
As 1st step, remove codec duplicate callback.

But my concern is that you hate big-patch-set, and it is almost 70 patches.
Can I post these patches to ML ? or should I use git pull request ? or I shouldn't post ?

I will post main patches as sample patch

Best regards
---
Kuninori Morimoto

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

* [PATCH 1/xx][sample] ASoC: add COMPONENT_FUNC() macro for snd_soc_component_driver
  2016-08-03  1:12 ` Kuninori Morimoto
@ 2016-08-03  1:13   ` Kuninori Morimoto
  -1 siblings, 0 replies; 19+ messages in thread
From: Kuninori Morimoto @ 2016-08-03  1:13 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Liam Girdwood, Simon, linux-renesas-soc

snd_soc_component_driver requests some struct xxx, and int num_xxx.
To make initialize easy, this patch adds COMPONENT_FUNC() macro.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 include/sound/soc.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 6144882..41c21f9 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -795,6 +795,9 @@ struct snd_soc_component_driver {
 	int probe_order;
 	int remove_order;
 };
+#define COMPONENT_FUNC(name, func)		\
+	.name		= func,			\
+	.num_##name	= ARRAY_SIZE(func)
 
 struct snd_soc_component {
 	const char *name;
-- 
1.9.1

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

* [PATCH 1/xx][sample] ASoC: add COMPONENT_FUNC() macro for snd_soc_component_driver
@ 2016-08-03  1:13   ` Kuninori Morimoto
  0 siblings, 0 replies; 19+ messages in thread
From: Kuninori Morimoto @ 2016-08-03  1:13 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Liam Girdwood, Simon, linux-renesas-soc

snd_soc_component_driver requests some struct xxx, and int num_xxx.
To make initialize easy, this patch adds COMPONENT_FUNC() macro.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 include/sound/soc.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 6144882..41c21f9 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -795,6 +795,9 @@ struct snd_soc_component_driver {
 	int probe_order;
 	int remove_order;
 };
+#define COMPONENT_FUNC(name, func)		\
+	.name		= func,			\
+	.num_##name	= ARRAY_SIZE(func)
 
 struct snd_soc_component {
 	const char *name;
-- 
1.9.1

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

* [PATCH 2/xx][sample] ASoC: codec duplicated callback function goes to component on wm8978
  2016-08-03  1:12 ` Kuninori Morimoto
@ 2016-08-03  1:13   ` Kuninori Morimoto
  -1 siblings, 0 replies; 19+ messages in thread
From: Kuninori Morimoto @ 2016-08-03  1:13 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Liam Girdwood, Simon, linux-renesas-soc

codec driver and component driver has duplicated callback functions,
and codec side functions are just copied to component side when
register timing. This was quick-hack, but no longer needed.
This patch moves these functions from codec driver to component driver.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/codecs/wm8978.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/sound/soc/codecs/wm8978.c b/sound/soc/codecs/wm8978.c
index d36d600..6a6828c 100644
--- a/sound/soc/codecs/wm8978.c
+++ b/sound/soc/codecs/wm8978.c
@@ -999,12 +999,11 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8978 = {
 	.resume =	wm8978_resume,
 	.set_bias_level = wm8978_set_bias_level,
 
-	.controls = wm8978_snd_controls,
-	.num_controls = ARRAY_SIZE(wm8978_snd_controls),
-	.dapm_widgets = wm8978_dapm_widgets,
-	.num_dapm_widgets = ARRAY_SIZE(wm8978_dapm_widgets),
-	.dapm_routes = wm8978_dapm_routes,
-	.num_dapm_routes = ARRAY_SIZE(wm8978_dapm_routes),
+	.component_driver = {
+		COMPONENT_FUNC(controls,	wm8978_snd_controls),
+		COMPONENT_FUNC(dapm_widgets,	wm8978_dapm_widgets),
+		COMPONENT_FUNC(dapm_routes,	wm8978_dapm_routes),
+	},
 };
 
 static const struct regmap_config wm8978_regmap_config = {
-- 
1.9.1

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

* [PATCH 2/xx][sample] ASoC: codec duplicated callback function goes to component on wm8978
@ 2016-08-03  1:13   ` Kuninori Morimoto
  0 siblings, 0 replies; 19+ messages in thread
From: Kuninori Morimoto @ 2016-08-03  1:13 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Liam Girdwood, Simon, linux-renesas-soc

codec driver and component driver has duplicated callback functions,
and codec side functions are just copied to component side when
register timing. This was quick-hack, but no longer needed.
This patch moves these functions from codec driver to component driver.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/codecs/wm8978.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/sound/soc/codecs/wm8978.c b/sound/soc/codecs/wm8978.c
index d36d600..6a6828c 100644
--- a/sound/soc/codecs/wm8978.c
+++ b/sound/soc/codecs/wm8978.c
@@ -999,12 +999,11 @@ static struct snd_soc_codec_driver soc_codec_dev_wm8978 = {
 	.resume =	wm8978_resume,
 	.set_bias_level = wm8978_set_bias_level,
 
-	.controls = wm8978_snd_controls,
-	.num_controls = ARRAY_SIZE(wm8978_snd_controls),
-	.dapm_widgets = wm8978_dapm_widgets,
-	.num_dapm_widgets = ARRAY_SIZE(wm8978_dapm_widgets),
-	.dapm_routes = wm8978_dapm_routes,
-	.num_dapm_routes = ARRAY_SIZE(wm8978_dapm_routes),
+	.component_driver = {
+		COMPONENT_FUNC(controls,	wm8978_snd_controls),
+		COMPONENT_FUNC(dapm_widgets,	wm8978_dapm_widgets),
+		COMPONENT_FUNC(dapm_routes,	wm8978_dapm_routes),
+	},
 };
 
 static const struct regmap_config wm8978_regmap_config = {
-- 
1.9.1

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

* [PATCH 3/xx][sample] ASoC: remove codec duplicated callback function
  2016-08-03  1:12 ` Kuninori Morimoto
@ 2016-08-03  1:14   ` Kuninori Morimoto
  -1 siblings, 0 replies; 19+ messages in thread
From: Kuninori Morimoto @ 2016-08-03  1:14 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Liam Girdwood, Simon, linux-renesas-soc

codec driver and component driver has duplicated callback functions,
and codec side functions are just copied to component side when
register timing. This was quick-hack, but no longer needed.
This patch removes codec side duplicated callback function.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 include/sound/soc.h  |  8 --------
 sound/soc/soc-core.c | 13 -------------
 2 files changed, 21 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 41c21f9..4e36538 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -901,14 +901,6 @@ struct snd_soc_codec_driver {
 	int (*resume)(struct snd_soc_codec *);
 	struct snd_soc_component_driver component_driver;
 
-	/* Default control and setup, added after probe() is run */
-	const struct snd_kcontrol_new *controls;
-	int num_controls;
-	const struct snd_soc_dapm_widget *dapm_widgets;
-	int num_dapm_widgets;
-	const struct snd_soc_dapm_route *dapm_routes;
-	int num_dapm_routes;
-
 	/* codec wide operations */
 	int (*set_sysclk)(struct snd_soc_codec *codec,
 			  int clk_id, int source, unsigned int freq, int dir);
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 16369ca..edba975 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3333,19 +3333,6 @@ int snd_soc_register_codec(struct device *dev,
 	if (ret)
 		goto err_free;
 
-	if (codec_drv->controls) {
-		codec->component.controls = codec_drv->controls;
-		codec->component.num_controls = codec_drv->num_controls;
-	}
-	if (codec_drv->dapm_widgets) {
-		codec->component.dapm_widgets = codec_drv->dapm_widgets;
-		codec->component.num_dapm_widgets = codec_drv->num_dapm_widgets;
-	}
-	if (codec_drv->dapm_routes) {
-		codec->component.dapm_routes = codec_drv->dapm_routes;
-		codec->component.num_dapm_routes = codec_drv->num_dapm_routes;
-	}
-
 	if (codec_drv->probe)
 		codec->component.probe = snd_soc_codec_drv_probe;
 	if (codec_drv->remove)
-- 
1.9.1

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

* [PATCH 3/xx][sample] ASoC: remove codec duplicated callback function
@ 2016-08-03  1:14   ` Kuninori Morimoto
  0 siblings, 0 replies; 19+ messages in thread
From: Kuninori Morimoto @ 2016-08-03  1:14 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Liam Girdwood, Simon, linux-renesas-soc

codec driver and component driver has duplicated callback functions,
and codec side functions are just copied to component side when
register timing. This was quick-hack, but no longer needed.
This patch removes codec side duplicated callback function.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 include/sound/soc.h  |  8 --------
 sound/soc/soc-core.c | 13 -------------
 2 files changed, 21 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 41c21f9..4e36538 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -901,14 +901,6 @@ struct snd_soc_codec_driver {
 	int (*resume)(struct snd_soc_codec *);
 	struct snd_soc_component_driver component_driver;
 
-	/* Default control and setup, added after probe() is run */
-	const struct snd_kcontrol_new *controls;
-	int num_controls;
-	const struct snd_soc_dapm_widget *dapm_widgets;
-	int num_dapm_widgets;
-	const struct snd_soc_dapm_route *dapm_routes;
-	int num_dapm_routes;
-
 	/* codec wide operations */
 	int (*set_sysclk)(struct snd_soc_codec *codec,
 			  int clk_id, int source, unsigned int freq, int dir);
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 16369ca..edba975 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3333,19 +3333,6 @@ int snd_soc_register_codec(struct device *dev,
 	if (ret)
 		goto err_free;
 
-	if (codec_drv->controls) {
-		codec->component.controls = codec_drv->controls;
-		codec->component.num_controls = codec_drv->num_controls;
-	}
-	if (codec_drv->dapm_widgets) {
-		codec->component.dapm_widgets = codec_drv->dapm_widgets;
-		codec->component.num_dapm_widgets = codec_drv->num_dapm_widgets;
-	}
-	if (codec_drv->dapm_routes) {
-		codec->component.dapm_routes = codec_drv->dapm_routes;
-		codec->component.num_dapm_routes = codec_drv->num_dapm_routes;
-	}
-
 	if (codec_drv->probe)
 		codec->component.probe = snd_soc_codec_drv_probe;
 	if (codec_drv->remove)
-- 
1.9.1

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

* Re: [alsa-devel] [PATCH 2/xx][sample] ASoC: codec duplicated callback function goes to component on wm8978
  2016-08-03  1:13   ` Kuninori Morimoto
  (?)
@ 2016-08-03  5:16   ` kbuild test robot
  -1 siblings, 0 replies; 19+ messages in thread
From: kbuild test robot @ 2016-08-03  5:16 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: kbuild-all, Mark Brown, linux-renesas-soc, Linux-ALSA, Simon,
	Liam Girdwood

[-- Attachment #1: Type: text/plain, Size: 2080 bytes --]

Hi Kuninori,

[auto build test ERROR on asoc/for-next]
[also build test ERROR on v4.7 next-20160802]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Kuninori-Morimoto/ASoC-codec-duplicated-callback-function-goes-to-component-on-wm8978/20160803-130055
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: x86_64-randconfig-x015-201631 (attached as .config)
compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

>> sound/soc/codecs/wm8978.c:1003:3: error: implicit declaration of function 'COMPONENT_FUNC' [-Werror=implicit-function-declaration]
      COMPONENT_FUNC(controls, wm8978_snd_controls),
      ^~~~~~~~~~~~~~
>> sound/soc/codecs/wm8978.c:1003:18: error: 'controls' undeclared here (not in a function)
      COMPONENT_FUNC(controls, wm8978_snd_controls),
                     ^~~~~~~~
>> sound/soc/codecs/wm8978.c:1004:18: error: 'dapm_widgets' undeclared here (not in a function)
      COMPONENT_FUNC(dapm_widgets, wm8978_dapm_widgets),
                     ^~~~~~~~~~~~
>> sound/soc/codecs/wm8978.c:1005:18: error: 'dapm_routes' undeclared here (not in a function)
      COMPONENT_FUNC(dapm_routes, wm8978_dapm_routes),
                     ^~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/COMPONENT_FUNC +1003 sound/soc/codecs/wm8978.c

   997		.probe =	wm8978_probe,
   998		.suspend =	wm8978_suspend,
   999		.resume =	wm8978_resume,
  1000		.set_bias_level = wm8978_set_bias_level,
  1001	
  1002		.component_driver = {
> 1003			COMPONENT_FUNC(controls,	wm8978_snd_controls),
> 1004			COMPONENT_FUNC(dapm_widgets,	wm8978_dapm_widgets),
> 1005			COMPONENT_FUNC(dapm_routes,	wm8978_dapm_routes),
  1006		},
  1007	};
  1008	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 27400 bytes --]

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

* Re: [alsa-devel] [PATCH 3/xx][sample] ASoC: remove codec duplicated callback function
  2016-08-03  1:14   ` Kuninori Morimoto
  (?)
@ 2016-08-03  5:48   ` kbuild test robot
  -1 siblings, 0 replies; 19+ messages in thread
From: kbuild test robot @ 2016-08-03  5:48 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: kbuild-all, Mark Brown, linux-renesas-soc, Linux-ALSA, Simon,
	Liam Girdwood

[-- Attachment #1: Type: text/plain, Size: 20522 bytes --]

Hi Kuninori,

[auto build test ERROR on asoc/for-next]
[also build test ERROR on v4.7 next-20160802]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Kuninori-Morimoto/ASoC-remove-codec-duplicated-callback-function/20160803-130552
base:   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
config: i386-randconfig-s1-201631 (attached as .config)
compiler: gcc-6 (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All error/warnings (new ones prefixed by >>):

>> sound/soc/codecs/adau1701.c:768:2: error: unknown field 'controls' specified in initializer
     .controls  = adau1701_controls,
     ^
>> sound/soc/codecs/adau1701.c:768:2: warning: the address of 'adau1701_controls' will always evaluate as 'true' [-Waddress]
>> sound/soc/codecs/adau1701.c:769:2: error: unknown field 'num_controls' specified in initializer
     .num_controls  = ARRAY_SIZE(adau1701_controls),
     ^
   In file included from include/linux/list.h:8:0,
                    from include/linux/module.h:9,
                    from sound/soc/codecs/adau1701.c:11:
   include/linux/kernel.h:54:25: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
                            ^
>> sound/soc/codecs/adau1701.c:769:19: note: in expansion of macro 'ARRAY_SIZE'
     .num_controls  = ARRAY_SIZE(adau1701_controls),
                      ^~~~~~~~~~
   include/linux/kernel.h:54:25: note: (near initialization for 'adau1701_codec_drv.seq_notifier')
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
                            ^
>> sound/soc/codecs/adau1701.c:769:19: note: in expansion of macro 'ARRAY_SIZE'
     .num_controls  = ARRAY_SIZE(adau1701_controls),
                      ^~~~~~~~~~
>> sound/soc/codecs/adau1701.c:770:2: error: unknown field 'dapm_widgets' specified in initializer
     .dapm_widgets  = adau1701_dapm_widgets,
     ^
>> sound/soc/codecs/adau1701.c:770:2: warning: the address of 'adau1701_dapm_widgets' will always evaluate as 'true' [-Waddress]
>> sound/soc/codecs/adau1701.c:771:2: error: unknown field 'num_dapm_widgets' specified in initializer
     .num_dapm_widgets = ARRAY_SIZE(adau1701_dapm_widgets),
     ^
   In file included from include/linux/list.h:8:0,
                    from include/linux/module.h:9,
                    from sound/soc/codecs/adau1701.c:11:
   include/linux/kernel.h:54:25: warning: excess elements in struct initializer
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
                            ^
   sound/soc/codecs/adau1701.c:771:22: note: in expansion of macro 'ARRAY_SIZE'
     .num_dapm_widgets = ARRAY_SIZE(adau1701_dapm_widgets),
                         ^~~~~~~~~~
   include/linux/kernel.h:54:25: note: (near initialization for 'adau1701_codec_drv')
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
                            ^
   sound/soc/codecs/adau1701.c:771:22: note: in expansion of macro 'ARRAY_SIZE'
     .num_dapm_widgets = ARRAY_SIZE(adau1701_dapm_widgets),
                         ^~~~~~~~~~
>> sound/soc/codecs/adau1701.c:772:2: error: unknown field 'dapm_routes' specified in initializer
     .dapm_routes  = adau1701_dapm_routes,
     ^
>> sound/soc/codecs/adau1701.c:772:18: warning: excess elements in struct initializer
     .dapm_routes  = adau1701_dapm_routes,
                     ^~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/adau1701.c:772:18: note: (near initialization for 'adau1701_codec_drv')
>> sound/soc/codecs/adau1701.c:773:2: error: unknown field 'num_dapm_routes' specified in initializer
     .num_dapm_routes = ARRAY_SIZE(adau1701_dapm_routes),
     ^
   In file included from include/linux/list.h:8:0,
                    from include/linux/module.h:9,
                    from sound/soc/codecs/adau1701.c:11:
   include/linux/kernel.h:54:25: warning: excess elements in struct initializer
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
                            ^
   sound/soc/codecs/adau1701.c:773:21: note: in expansion of macro 'ARRAY_SIZE'
     .num_dapm_routes = ARRAY_SIZE(adau1701_dapm_routes),
                        ^~~~~~~~~~
   include/linux/kernel.h:54:25: note: (near initialization for 'adau1701_codec_drv')
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
                            ^
   sound/soc/codecs/adau1701.c:773:21: note: in expansion of macro 'ARRAY_SIZE'
     .num_dapm_routes = ARRAY_SIZE(adau1701_dapm_routes),
                        ^~~~~~~~~~
--
>> sound/soc/codecs/ak4104.c:248:2: error: unknown field 'dapm_widgets' specified in initializer
     .dapm_widgets = ak4104_dapm_widgets,
     ^
>> sound/soc/codecs/ak4104.c:248:18: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
     .dapm_widgets = ak4104_dapm_widgets,
                     ^~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/ak4104.c:248:18: note: (near initialization for 'soc_codec_device_ak4104.component_driver.name')
>> sound/soc/codecs/ak4104.c:249:2: error: unknown field 'num_dapm_widgets' specified in initializer
     .num_dapm_widgets = ARRAY_SIZE(ak4104_dapm_widgets),
     ^
   In file included from include/linux/list.h:8:0,
                    from include/linux/module.h:9,
                    from sound/soc/codecs/ak4104.c:12:
   include/linux/kernel.h:54:25: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
                            ^
>> sound/soc/codecs/ak4104.c:249:22: note: in expansion of macro 'ARRAY_SIZE'
     .num_dapm_widgets = ARRAY_SIZE(ak4104_dapm_widgets),
                         ^~~~~~~~~~
   include/linux/kernel.h:54:25: note: (near initialization for 'soc_codec_device_ak4104.set_sysclk')
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
                            ^
>> sound/soc/codecs/ak4104.c:249:22: note: in expansion of macro 'ARRAY_SIZE'
     .num_dapm_widgets = ARRAY_SIZE(ak4104_dapm_widgets),
                         ^~~~~~~~~~
>> sound/soc/codecs/ak4104.c:250:2: error: unknown field 'dapm_routes' specified in initializer
     .dapm_routes = ak4104_dapm_routes,
     ^
   sound/soc/codecs/ak4104.c:250:17: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
     .dapm_routes = ak4104_dapm_routes,
                    ^~~~~~~~~~~~~~~~~~
   sound/soc/codecs/ak4104.c:250:17: note: (near initialization for 'soc_codec_device_ak4104.set_pll')
>> sound/soc/codecs/ak4104.c:251:2: error: unknown field 'num_dapm_routes' specified in initializer
     .num_dapm_routes = ARRAY_SIZE(ak4104_dapm_routes),
     ^
   In file included from include/linux/list.h:8:0,
                    from include/linux/module.h:9,
                    from sound/soc/codecs/ak4104.c:12:
   include/linux/kernel.h:54:25: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
                            ^
   sound/soc/codecs/ak4104.c:251:21: note: in expansion of macro 'ARRAY_SIZE'
     .num_dapm_routes = ARRAY_SIZE(ak4104_dapm_routes),
                        ^~~~~~~~~~
   include/linux/kernel.h:54:25: note: (near initialization for 'soc_codec_device_ak4104.get_regmap')
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
                            ^
   sound/soc/codecs/ak4104.c:251:21: note: in expansion of macro 'ARRAY_SIZE'
     .num_dapm_routes = ARRAY_SIZE(ak4104_dapm_routes),
                        ^~~~~~~~~~
>> sound/soc/codecs/ak4104.c:242:62: warning: missing braces around initializer [-Wmissing-braces]
    static struct snd_soc_codec_driver soc_codec_device_ak4104 = {
                                                                 ^
   sound/soc/codecs/ak4104.c:242:62: note: (near initialization for 'soc_codec_device_ak4104')
   cc1: some warnings being treated as errors
--
>> sound/soc/codecs/ak4554.c:68:2: error: unknown field 'dapm_widgets' specified in initializer
     .dapm_widgets = ak4554_dapm_widgets,
     ^
>> sound/soc/codecs/ak4554.c:68:18: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
     .dapm_widgets = ak4554_dapm_widgets,
                     ^~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/ak4554.c:68:18: note: (near initialization for 'soc_codec_dev_ak4554.probe')
>> sound/soc/codecs/ak4554.c:69:2: error: unknown field 'num_dapm_widgets' specified in initializer
     .num_dapm_widgets = ARRAY_SIZE(ak4554_dapm_widgets),
     ^
   In file included from include/linux/list.h:8:0,
                    from include/linux/module.h:9,
                    from sound/soc/codecs/ak4554.c:12:
   include/linux/kernel.h:54:25: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
                            ^
>> sound/soc/codecs/ak4554.c:69:22: note: in expansion of macro 'ARRAY_SIZE'
     .num_dapm_widgets = ARRAY_SIZE(ak4554_dapm_widgets),
                         ^~~~~~~~~~
   include/linux/kernel.h:54:25: note: (near initialization for 'soc_codec_dev_ak4554.remove')
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
                            ^
>> sound/soc/codecs/ak4554.c:69:22: note: in expansion of macro 'ARRAY_SIZE'
     .num_dapm_widgets = ARRAY_SIZE(ak4554_dapm_widgets),
                         ^~~~~~~~~~
>> sound/soc/codecs/ak4554.c:70:2: error: unknown field 'dapm_routes' specified in initializer
     .dapm_routes = ak4554_dapm_routes,
     ^
   sound/soc/codecs/ak4554.c:70:17: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
     .dapm_routes = ak4554_dapm_routes,
                    ^~~~~~~~~~~~~~~~~~
   sound/soc/codecs/ak4554.c:70:17: note: (near initialization for 'soc_codec_dev_ak4554.suspend')
>> sound/soc/codecs/ak4554.c:71:2: error: unknown field 'num_dapm_routes' specified in initializer
     .num_dapm_routes = ARRAY_SIZE(ak4554_dapm_routes),
     ^
   In file included from include/linux/list.h:8:0,
                    from include/linux/module.h:9,
                    from sound/soc/codecs/ak4554.c:12:
   include/linux/kernel.h:54:25: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
                            ^
   sound/soc/codecs/ak4554.c:71:21: note: in expansion of macro 'ARRAY_SIZE'
     .num_dapm_routes = ARRAY_SIZE(ak4554_dapm_routes),
                        ^~~~~~~~~~
   include/linux/kernel.h:54:25: note: (near initialization for 'soc_codec_dev_ak4554.resume')
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
                            ^
   sound/soc/codecs/ak4554.c:71:21: note: in expansion of macro 'ARRAY_SIZE'
     .num_dapm_routes = ARRAY_SIZE(ak4554_dapm_routes),
                        ^~~~~~~~~~
   cc1: some warnings being treated as errors
--
>> sound/soc/codecs/cs35l32.c:234:2: error: unknown field 'dapm_widgets' specified in initializer
     .dapm_widgets = cs35l32_dapm_widgets,
     ^
>> sound/soc/codecs/cs35l32.c:234:18: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
     .dapm_widgets = cs35l32_dapm_widgets,
                     ^~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/cs35l32.c:234:18: note: (near initialization for 'soc_codec_dev_cs35l32.set_pll')
>> sound/soc/codecs/cs35l32.c:235:2: error: unknown field 'num_dapm_widgets' specified in initializer
     .num_dapm_widgets = ARRAY_SIZE(cs35l32_dapm_widgets),
     ^
   In file included from include/linux/list.h:8:0,
                    from include/linux/module.h:9,
                    from sound/soc/codecs/cs35l32.c:14:
   include/linux/kernel.h:54:25: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
                            ^
>> sound/soc/codecs/cs35l32.c:235:22: note: in expansion of macro 'ARRAY_SIZE'
     .num_dapm_widgets = ARRAY_SIZE(cs35l32_dapm_widgets),
                         ^~~~~~~~~~
   include/linux/kernel.h:54:25: note: (near initialization for 'soc_codec_dev_cs35l32.get_regmap')
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
                            ^
>> sound/soc/codecs/cs35l32.c:235:22: note: in expansion of macro 'ARRAY_SIZE'
     .num_dapm_widgets = ARRAY_SIZE(cs35l32_dapm_widgets),
                         ^~~~~~~~~~
>> sound/soc/codecs/cs35l32.c:236:2: error: unknown field 'dapm_routes' specified in initializer
     .dapm_routes = cs35l32_audio_map,
     ^
   sound/soc/codecs/cs35l32.c:236:17: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
     .dapm_routes = cs35l32_audio_map,
                    ^~~~~~~~~~~~~~~~~
   sound/soc/codecs/cs35l32.c:236:17: note: (near initialization for 'soc_codec_dev_cs35l32.read')
>> sound/soc/codecs/cs35l32.c:237:2: error: unknown field 'num_dapm_routes' specified in initializer
     .num_dapm_routes = ARRAY_SIZE(cs35l32_audio_map),
     ^
   In file included from include/linux/list.h:8:0,
                    from include/linux/module.h:9,
                    from sound/soc/codecs/cs35l32.c:14:
   include/linux/kernel.h:54:25: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
                            ^
   sound/soc/codecs/cs35l32.c:237:21: note: in expansion of macro 'ARRAY_SIZE'
     .num_dapm_routes = ARRAY_SIZE(cs35l32_audio_map),
                        ^~~~~~~~~~
   include/linux/kernel.h:54:25: note: (near initialization for 'soc_codec_dev_cs35l32.write')
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
                            ^
   sound/soc/codecs/cs35l32.c:237:21: note: in expansion of macro 'ARRAY_SIZE'
     .num_dapm_routes = ARRAY_SIZE(cs35l32_audio_map),
                        ^~~~~~~~~~
>> sound/soc/codecs/cs35l32.c:239:2: error: unknown field 'controls' specified in initializer
     .controls = cs35l32_snd_controls,
     ^
>> sound/soc/codecs/cs35l32.c:239:14: warning: initialization makes integer from pointer without a cast [-Wint-conversion]
     .controls = cs35l32_snd_controls,
                 ^~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/cs35l32.c:239:14: note: (near initialization for 'soc_codec_dev_cs35l32.reg_cache_size')
>> sound/soc/codecs/cs35l32.c:240:2: error: unknown field 'num_controls' specified in initializer
     .num_controls = ARRAY_SIZE(cs35l32_snd_controls),
     ^
   cc1: some warnings being treated as errors
--
>> sound/soc/codecs/cs42l73.c:1260:2: error: unknown field 'dapm_widgets' specified in initializer
     .dapm_widgets = cs42l73_dapm_widgets,
     ^
>> sound/soc/codecs/cs42l73.c:1260:18: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
     .dapm_widgets = cs42l73_dapm_widgets,
                     ^~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/cs42l73.c:1260:18: note: (near initialization for 'soc_codec_dev_cs42l73.seq_notifier')
>> sound/soc/codecs/cs42l73.c:1261:2: error: unknown field 'num_dapm_widgets' specified in initializer
     .num_dapm_widgets = ARRAY_SIZE(cs42l73_dapm_widgets),
     ^
>> sound/soc/codecs/cs42l73.c:1262:2: error: unknown field 'dapm_routes' specified in initializer
     .dapm_routes = cs42l73_audio_map,
     ^
>> sound/soc/codecs/cs42l73.c:1262:17: warning: excess elements in struct initializer
     .dapm_routes = cs42l73_audio_map,
                    ^~~~~~~~~~~~~~~~~
   sound/soc/codecs/cs42l73.c:1262:17: note: (near initialization for 'soc_codec_dev_cs42l73')
>> sound/soc/codecs/cs42l73.c:1263:2: error: unknown field 'num_dapm_routes' specified in initializer
     .num_dapm_routes = ARRAY_SIZE(cs42l73_audio_map),
     ^
   In file included from include/linux/list.h:8:0,
                    from include/linux/module.h:9,
                    from sound/soc/codecs/cs42l73.c:15:
   include/linux/kernel.h:54:25: warning: excess elements in struct initializer
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
                            ^
>> sound/soc/codecs/cs42l73.c:1263:21: note: in expansion of macro 'ARRAY_SIZE'
     .num_dapm_routes = ARRAY_SIZE(cs42l73_audio_map),
                        ^~~~~~~~~~
   include/linux/kernel.h:54:25: note: (near initialization for 'soc_codec_dev_cs42l73')
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
                            ^
>> sound/soc/codecs/cs42l73.c:1263:21: note: in expansion of macro 'ARRAY_SIZE'
     .num_dapm_routes = ARRAY_SIZE(cs42l73_audio_map),
                        ^~~~~~~~~~
>> sound/soc/codecs/cs42l73.c:1265:2: error: unknown field 'controls' specified in initializer
     .controls = cs42l73_snd_controls,
     ^
   sound/soc/codecs/cs42l73.c:1265:14: warning: excess elements in struct initializer
     .controls = cs42l73_snd_controls,
                 ^~~~~~~~~~~~~~~~~~~~
   sound/soc/codecs/cs42l73.c:1265:14: note: (near initialization for 'soc_codec_dev_cs42l73')
>> sound/soc/codecs/cs42l73.c:1266:2: error: unknown field 'num_controls' specified in initializer
     .num_controls = ARRAY_SIZE(cs42l73_snd_controls),
     ^
   In file included from include/linux/list.h:8:0,
                    from include/linux/module.h:9,
                    from sound/soc/codecs/cs42l73.c:15:
   include/linux/kernel.h:54:25: warning: excess elements in struct initializer
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
                            ^
   sound/soc/codecs/cs42l73.c:1266:18: note: in expansion of macro 'ARRAY_SIZE'
     .num_controls = ARRAY_SIZE(cs42l73_snd_controls),
                     ^~~~~~~~~~
   include/linux/kernel.h:54:25: note: (near initialization for 'soc_codec_dev_cs42l73')
    #define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]) + __must_be_array(arr))
                            ^
   sound/soc/codecs/cs42l73.c:1266:18: note: in expansion of macro 'ARRAY_SIZE'
     .num_controls = ARRAY_SIZE(cs42l73_snd_controls),
                     ^~~~~~~~~~
   cc1: some warnings being treated as errors
..

vim +/num_controls +769 sound/soc/codecs/adau1701.c

64fcc1fd Pascal Huerst      2015-04-20  762  	.remove			= adau1701_remove,
64fcc1fd Pascal Huerst      2015-04-20  763  	.resume			= adau1701_resume,
64fcc1fd Pascal Huerst      2015-04-20  764  	.suspend		= adau1701_suspend,
631ed8a2 Lars-Peter Clausen 2011-06-13  765  	.set_bias_level		= adau1701_set_bias_level,
eb3032f8 Axel Lin           2012-01-27  766  	.idle_bias_off		= true,
631ed8a2 Lars-Peter Clausen 2011-06-13  767  
631ed8a2 Lars-Peter Clausen 2011-06-13 @768  	.controls		= adau1701_controls,
631ed8a2 Lars-Peter Clausen 2011-06-13 @769  	.num_controls		= ARRAY_SIZE(adau1701_controls),
631ed8a2 Lars-Peter Clausen 2011-06-13 @770  	.dapm_widgets		= adau1701_dapm_widgets,
631ed8a2 Lars-Peter Clausen 2011-06-13 @771  	.num_dapm_widgets	= ARRAY_SIZE(adau1701_dapm_widgets),
631ed8a2 Lars-Peter Clausen 2011-06-13 @772  	.dapm_routes		= adau1701_dapm_routes,
631ed8a2 Lars-Peter Clausen 2011-06-13 @773  	.num_dapm_routes	= ARRAY_SIZE(adau1701_dapm_routes),
631ed8a2 Lars-Peter Clausen 2011-06-13  774  
631ed8a2 Lars-Peter Clausen 2011-06-13  775  	.set_sysclk		= adau1701_set_sysclk,
631ed8a2 Lars-Peter Clausen 2011-06-13  776  };

:::::: The code at line 769 was first introduced by commit
:::::: 631ed8a2134dae17d9e17f3c35c7290720f85199 ASoC: Add ADAU1701 codec driver

:::::: TO: Lars-Peter Clausen <lars@metafoo.de>
:::::: CC: Mark Brown <broonie@opensource.wolfsonmicro.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 24721 bytes --]

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

* Re: How to post cleanup patches ?
  2016-08-03  1:12 ` Kuninori Morimoto
                   ` (3 preceding siblings ...)
  (?)
@ 2016-08-03 10:56 ` Mark Brown
  2016-08-04  0:22     ` Kuninori Morimoto
  -1 siblings, 1 reply; 19+ messages in thread
From: Mark Brown @ 2016-08-03 10:56 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Linux-ALSA, Liam Girdwood, Simon, linux-renesas-soc

[-- Attachment #1: Type: text/plain, Size: 470 bytes --]

On Wed, Aug 03, 2016 at 01:12:25AM +0000, Kuninori Morimoto wrote:

> But my concern is that you hate big-patch-set, and it is almost 70 patches.
> Can I post these patches to ML ? or should I use git pull request ? or I shouldn't post ?

A very repetitive patch series which does the same thing to multiple
drivers (so is essentially the same patch lots of times) is not such a
problem, the problem is huge numbers of different patches that all need
individual review.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

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

* Re: [alsa-devel] [PATCH 1/xx][sample] ASoC: add COMPONENT_FUNC() macro for snd_soc_component_driver
  2016-08-03  1:13   ` Kuninori Morimoto
  (?)
@ 2016-08-03 19:16   ` Lars-Peter Clausen
  2016-08-04  0:39       ` Kuninori Morimoto
  -1 siblings, 1 reply; 19+ messages in thread
From: Lars-Peter Clausen @ 2016-08-03 19:16 UTC (permalink / raw)
  To: Kuninori Morimoto, Mark Brown
  Cc: linux-renesas-soc, Linux-ALSA, Simon, Liam Girdwood

On 08/03/2016 03:13 AM, Kuninori Morimoto wrote:
> snd_soc_component_driver requests some struct xxx, and int num_xxx.
> To make initialize easy, this patch adds COMPONENT_FUNC() macro.
> 
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  include/sound/soc.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/include/sound/soc.h b/include/sound/soc.h
> index 6144882..41c21f9 100644
> --- a/include/sound/soc.h
> +++ b/include/sound/soc.h
> @@ -795,6 +795,9 @@ struct snd_soc_component_driver {
>  	int probe_order;
>  	int remove_order;
>  };
> +#define COMPONENT_FUNC(name, func)		\
> +	.name		= func,			\
> +	.num_##name	= ARRAY_SIZE(func)

I'd avoid like to a void this kind of macro. Sure it slightly reduces
boilerplate code, but it is difficult to parse for both humans as well as
machines. Makes the code much less intuitive to understand and also breaks
automated scripts.

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

* Re: [alsa-devel] How to post cleanup patches ?
  2016-08-03  1:12 ` Kuninori Morimoto
                   ` (4 preceding siblings ...)
  (?)
@ 2016-08-03 19:20 ` Lars-Peter Clausen
  -1 siblings, 0 replies; 19+ messages in thread
From: Lars-Peter Clausen @ 2016-08-03 19:20 UTC (permalink / raw)
  To: Kuninori Morimoto, Mark Brown
  Cc: linux-renesas-soc, Linux-ALSA, Simon, Liam Girdwood

On 08/03/2016 03:12 AM, Kuninori Morimoto wrote:
> 
> Hi Mark
> 
> Now codec driver and component driver has duplicated callback function,
> and snd_soc_register_codec() just copied it to component side.
> 
> 	int snd_soc_register_codec(xxx) {
> 		...
>  
> 		if (codec_drv->controls) {
> 			codec->component.controls = codec_drv->controls;
> 			codec->component.num_controls = codec_drv->num_controls;
> 		}
> 		if (codec_drv->dapm_widgets) {
> 			codec->component.dapm_widgets = codec_drv->dapm_widgets;
> 			codec->component.num_dapm_widgets = codec_drv->num_dapm_widgets;
> 		}
> 		if (codec_drv->dapm_routes) {
> 			codec->component.dapm_routes = codec_drv->dapm_routes;
> 			codec->component.num_dapm_routes = codec_drv->num_dapm_routes;
> 		}
> 		...
> 	}
> 
> I think we can cleanup this duplicated function, similar things happen on
> .probe, .remove, and platform side too.
> 
> I would like to post cleanup patches for these.
> As 1st step, remove codec duplicate callback.
> 
> But my concern is that you hate big-patch-set, and it is almost 70 patches.
> Can I post these patches to ML ? or should I use git pull request ? or I shouldn't post ?

I left this step out on purpose during the componentization of
snd_soc_codec. Simply because it is a huge amount of code churn for very
little gain. If you want to do it, go ahead, but I don't think it is worth
the effort at this point.

I think of this as the final cleanup step once everything else is in place.
E.g. there are lots of CODEC drivers that don't actually need anything CODEC
specific, except that we need to know that it is a CODEC so we which
direction the capture and playback streams of the DAI go. If we can come up
with a generic to represent the DAI streams we could convert all these
drivers directly from snd_soc_codec_driver to snd_soc_component_driver.

I'd much rather see this conversion to be part of such an effort.

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

* Re: How to post cleanup patches ?
  2016-08-03 10:56 ` How to post cleanup patches ? Mark Brown
@ 2016-08-04  0:22     ` Kuninori Morimoto
  0 siblings, 0 replies; 19+ messages in thread
From: Kuninori Morimoto @ 2016-08-04  0:22 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Liam Girdwood, Simon, linux-renesas-soc


Hi Mark

> > But my concern is that you hate big-patch-set, and it is almost 70 patches.
> > Can I post these patches to ML ? or should I use git pull request ? or I shouldn't post ?
> 
> A very repetitive patch series which does the same thing to multiple
> drivers (so is essentially the same patch lots of times) is not such a
> problem, the problem is huge numbers of different patches that all need
> individual review.

OK, I see
I will post it to ML

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

* Re: How to post cleanup patches ?
@ 2016-08-04  0:22     ` Kuninori Morimoto
  0 siblings, 0 replies; 19+ messages in thread
From: Kuninori Morimoto @ 2016-08-04  0:22 UTC (permalink / raw)
  To: Mark Brown; +Cc: Linux-ALSA, Liam Girdwood, Simon, linux-renesas-soc


Hi Mark

> > But my concern is that you hate big-patch-set, and it is almost 70 patches.
> > Can I post these patches to ML ? or should I use git pull request ? or I shouldn't post ?
> 
> A very repetitive patch series which does the same thing to multiple
> drivers (so is essentially the same patch lots of times) is not such a
> problem, the problem is huge numbers of different patches that all need
> individual review.

OK, I see
I will post it to ML

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

* Re: [alsa-devel] [PATCH 1/xx][sample] ASoC: add COMPONENT_FUNC() macro for snd_soc_component_driver
  2016-08-03 19:16   ` [alsa-devel] " Lars-Peter Clausen
@ 2016-08-04  0:39       ` Kuninori Morimoto
  0 siblings, 0 replies; 19+ messages in thread
From: Kuninori Morimoto @ 2016-08-04  0:39 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Mark Brown, linux-renesas-soc, Linux-ALSA, Simon, Liam Girdwood


Hi Lars

Thank you for your feedback

> > snd_soc_component_driver requests some struct xxx, and int num_xxx.
> > To make initialize easy, this patch adds COMPONENT_FUNC() macro.
> > 
> > Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> > ---
> >  include/sound/soc.h | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/include/sound/soc.h b/include/sound/soc.h
> > index 6144882..41c21f9 100644
> > --- a/include/sound/soc.h
> > +++ b/include/sound/soc.h
> > @@ -795,6 +795,9 @@ struct snd_soc_component_driver {
> >  	int probe_order;
> >  	int remove_order;
> >  };
> > +#define COMPONENT_FUNC(name, func)		\
> > +	.name		= func,			\
> > +	.num_##name	= ARRAY_SIZE(func)
> 
> I'd avoid like to a void this kind of macro. Sure it slightly reduces
> boilerplate code, but it is difficult to parse for both humans as well as
> machines. Makes the code much less intuitive to understand and also breaks
> automated scripts.

Thanks, and yes agree.
Now, I'm creating many patches without above macro.

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

* Re: [alsa-devel] [PATCH 1/xx][sample] ASoC: add COMPONENT_FUNC() macro for snd_soc_component_driver
@ 2016-08-04  0:39       ` Kuninori Morimoto
  0 siblings, 0 replies; 19+ messages in thread
From: Kuninori Morimoto @ 2016-08-04  0:39 UTC (permalink / raw)
  To: Lars-Peter Clausen
  Cc: Mark Brown, linux-renesas-soc, Linux-ALSA, Simon, Liam Girdwood


Hi Lars

Thank you for your feedback

> > snd_soc_component_driver requests some struct xxx, and int num_xxx.
> > To make initialize easy, this patch adds COMPONENT_FUNC() macro.
> > 
> > Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> > ---
> >  include/sound/soc.h | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/include/sound/soc.h b/include/sound/soc.h
> > index 6144882..41c21f9 100644
> > --- a/include/sound/soc.h
> > +++ b/include/sound/soc.h
> > @@ -795,6 +795,9 @@ struct snd_soc_component_driver {
> >  	int probe_order;
> >  	int remove_order;
> >  };
> > +#define COMPONENT_FUNC(name, func)		\
> > +	.name		= func,			\
> > +	.num_##name	= ARRAY_SIZE(func)
> 
> I'd avoid like to a void this kind of macro. Sure it slightly reduces
> boilerplate code, but it is difficult to parse for both humans as well as
> machines. Makes the code much less intuitive to understand and also breaks
> automated scripts.

Thanks, and yes agree.
Now, I'm creating many patches without above macro.

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

* Applied "ASoC: remove codec duplicated callback function" to the asoc tree
  2016-08-03  1:14   ` Kuninori Morimoto
@ 2016-08-08 11:06     ` Mark Brown
  -1 siblings, 0 replies; 19+ messages in thread
From: Mark Brown @ 2016-08-08 11:06 UTC (permalink / raw)
  To: Kuninori Morimoto
  Cc: Mark Brown, Mark Brown, linux-renesas-soc, Linux-ALSA, Simon,
	Liam Girdwood

The patch

   ASoC: remove codec duplicated callback function

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 8073aefa60823acf205a1e6a5ea118297179d766 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Mon, 8 Aug 2016 09:36:49 +0000
Subject: [PATCH] ASoC: remove codec duplicated callback function

codec driver and component driver has duplicated callback functions,
and codec side functions are just copied to component side when
register timing. This was quick-hack, but no longer needed.
This patch removes codec side duplicated callback function.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 include/sound/soc.h  |  8 --------
 sound/soc/soc-core.c | 13 -------------
 2 files changed, 21 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 6144882cc96a..5eb2b38c3437 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -898,14 +898,6 @@ struct snd_soc_codec_driver {
 	int (*resume)(struct snd_soc_codec *);
 	struct snd_soc_component_driver component_driver;
 
-	/* Default control and setup, added after probe() is run */
-	const struct snd_kcontrol_new *controls;
-	int num_controls;
-	const struct snd_soc_dapm_widget *dapm_widgets;
-	int num_dapm_widgets;
-	const struct snd_soc_dapm_route *dapm_routes;
-	int num_dapm_routes;
-
 	/* codec wide operations */
 	int (*set_sysclk)(struct snd_soc_codec *codec,
 			  int clk_id, int source, unsigned int freq, int dir);
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 16369cad4803..edba975d893e 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3333,19 +3333,6 @@ int snd_soc_register_codec(struct device *dev,
 	if (ret)
 		goto err_free;
 
-	if (codec_drv->controls) {
-		codec->component.controls = codec_drv->controls;
-		codec->component.num_controls = codec_drv->num_controls;
-	}
-	if (codec_drv->dapm_widgets) {
-		codec->component.dapm_widgets = codec_drv->dapm_widgets;
-		codec->component.num_dapm_widgets = codec_drv->num_dapm_widgets;
-	}
-	if (codec_drv->dapm_routes) {
-		codec->component.dapm_routes = codec_drv->dapm_routes;
-		codec->component.num_dapm_routes = codec_drv->num_dapm_routes;
-	}
-
 	if (codec_drv->probe)
 		codec->component.probe = snd_soc_codec_drv_probe;
 	if (codec_drv->remove)
-- 
2.8.1

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

* Applied "ASoC: remove codec duplicated callback function" to the asoc tree
@ 2016-08-08 11:06     ` Mark Brown
  0 siblings, 0 replies; 19+ messages in thread
From: Mark Brown @ 2016-08-08 11:06 UTC (permalink / raw)
  To: Kuninori Morimoto; +Cc: Mark Brown

The patch

   ASoC: remove codec duplicated callback function

has been applied to the asoc tree at

   git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git 

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

>From 8073aefa60823acf205a1e6a5ea118297179d766 Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Date: Mon, 8 Aug 2016 09:36:49 +0000
Subject: [PATCH] ASoC: remove codec duplicated callback function

codec driver and component driver has duplicated callback functions,
and codec side functions are just copied to component side when
register timing. This was quick-hack, but no longer needed.
This patch removes codec side duplicated callback function.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 include/sound/soc.h  |  8 --------
 sound/soc/soc-core.c | 13 -------------
 2 files changed, 21 deletions(-)

diff --git a/include/sound/soc.h b/include/sound/soc.h
index 6144882cc96a..5eb2b38c3437 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -898,14 +898,6 @@ struct snd_soc_codec_driver {
 	int (*resume)(struct snd_soc_codec *);
 	struct snd_soc_component_driver component_driver;
 
-	/* Default control and setup, added after probe() is run */
-	const struct snd_kcontrol_new *controls;
-	int num_controls;
-	const struct snd_soc_dapm_widget *dapm_widgets;
-	int num_dapm_widgets;
-	const struct snd_soc_dapm_route *dapm_routes;
-	int num_dapm_routes;
-
 	/* codec wide operations */
 	int (*set_sysclk)(struct snd_soc_codec *codec,
 			  int clk_id, int source, unsigned int freq, int dir);
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 16369cad4803..edba975d893e 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -3333,19 +3333,6 @@ int snd_soc_register_codec(struct device *dev,
 	if (ret)
 		goto err_free;
 
-	if (codec_drv->controls) {
-		codec->component.controls = codec_drv->controls;
-		codec->component.num_controls = codec_drv->num_controls;
-	}
-	if (codec_drv->dapm_widgets) {
-		codec->component.dapm_widgets = codec_drv->dapm_widgets;
-		codec->component.num_dapm_widgets = codec_drv->num_dapm_widgets;
-	}
-	if (codec_drv->dapm_routes) {
-		codec->component.dapm_routes = codec_drv->dapm_routes;
-		codec->component.num_dapm_routes = codec_drv->num_dapm_routes;
-	}
-
 	if (codec_drv->probe)
 		codec->component.probe = snd_soc_codec_drv_probe;
 	if (codec_drv->remove)
-- 
2.8.1

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

end of thread, other threads:[~2016-08-08 11:06 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-03  1:12 How to post cleanup patches ? Kuninori Morimoto
2016-08-03  1:12 ` Kuninori Morimoto
2016-08-03  1:13 ` [PATCH 1/xx][sample] ASoC: add COMPONENT_FUNC() macro for snd_soc_component_driver Kuninori Morimoto
2016-08-03  1:13   ` Kuninori Morimoto
2016-08-03 19:16   ` [alsa-devel] " Lars-Peter Clausen
2016-08-04  0:39     ` Kuninori Morimoto
2016-08-04  0:39       ` Kuninori Morimoto
2016-08-03  1:13 ` [PATCH 2/xx][sample] ASoC: codec duplicated callback function goes to component on wm8978 Kuninori Morimoto
2016-08-03  1:13   ` Kuninori Morimoto
2016-08-03  5:16   ` [alsa-devel] " kbuild test robot
2016-08-03  1:14 ` [PATCH 3/xx][sample] ASoC: remove codec duplicated callback function Kuninori Morimoto
2016-08-03  1:14   ` Kuninori Morimoto
2016-08-03  5:48   ` [alsa-devel] " kbuild test robot
2016-08-08 11:06   ` Applied "ASoC: remove codec duplicated callback function" to the asoc tree Mark Brown
2016-08-08 11:06     ` Mark Brown
2016-08-03 10:56 ` How to post cleanup patches ? Mark Brown
2016-08-04  0:22   ` Kuninori Morimoto
2016-08-04  0:22     ` Kuninori Morimoto
2016-08-03 19:20 ` [alsa-devel] " Lars-Peter Clausen

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.