All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] ALSA: hda: Remove unused variable
@ 2014-07-01 11:32 Sachin Kamat
  2014-07-01 11:32 ` [PATCH 2/5] ALSA: hdspm: Remove unused code Sachin Kamat
                   ` (5 more replies)
  0 siblings, 6 replies; 17+ messages in thread
From: Sachin Kamat @ 2014-07-01 11:32 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, Thierry Reding, Stephen Warren, spk.linux

'status' is not used in the function. Remove it.

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
Cc: Stephen Warren <swarren@wwwdotorg.org>
Cc: Thierry Reding <thierry.reding@gmail.com>
---
All patches in this series only compile tested.
---
 sound/pci/hda/hda_tegra.c |    4 ----
 1 file changed, 4 deletions(-)

diff --git a/sound/pci/hda/hda_tegra.c b/sound/pci/hda/hda_tegra.c
index a366ba9293a8..8cd7b06eecef 100644
--- a/sound/pci/hda/hda_tegra.c
+++ b/sound/pci/hda/hda_tegra.c
@@ -272,13 +272,9 @@ static int hda_tegra_resume(struct device *dev)
 	struct snd_card *card = dev_get_drvdata(dev);
 	struct azx *chip = card->private_data;
 	struct hda_tegra *hda = container_of(chip, struct hda_tegra, chip);
-	int status;
 
 	hda_tegra_enable_clocks(hda);
 
-	/* Read STATESTS before controller reset */
-	status = azx_readw(chip, STATESTS);
-
 	hda_tegra_init(hda);
 
 	azx_init_chip(chip, 1);
-- 
1.7.9.5

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

* [PATCH 2/5] ALSA: hdspm: Remove unused code
  2014-07-01 11:32 [PATCH 1/5] ALSA: hda: Remove unused variable Sachin Kamat
@ 2014-07-01 11:32 ` Sachin Kamat
  2014-07-01 11:58   ` Takashi Iwai
  2014-07-01 11:32 ` [PATCH 3/5] ALSA: revo: Remove unused variable Sachin Kamat
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Sachin Kamat @ 2014-07-01 11:32 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, spk.linux

Removed the code which is not used in the functions.

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
---
 sound/pci/rme9652/hdspm.c |   23 +++--------------------
 1 file changed, 3 insertions(+), 20 deletions(-)

diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index cb82b593473a..60ee41fda5d1 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -1257,14 +1257,13 @@ static int hdspm_rate_multiplier(struct hdspm *hdspm, int rate)
 /* check for external sample rate, returns the sample rate in Hz*/
 static int hdspm_external_sample_rate(struct hdspm *hdspm)
 {
-	unsigned int status, status2, timecode;
+	unsigned int status, status2;
 	int syncref, rate = 0, rate_bits;
 
 	switch (hdspm->io_type) {
 	case AES32:
 		status2 = hdspm_read(hdspm, HDSPM_statusRegister2);
 		status = hdspm_read(hdspm, HDSPM_statusRegister);
-		timecode = hdspm_read(hdspm, HDSPM_timecodeRegister);
 
 		syncref = hdspm_autosync_ref(hdspm);
 		switch (syncref) {
@@ -4873,18 +4872,15 @@ snd_hdspm_proc_read_madi(struct snd_info_entry *entry,
 			 struct snd_info_buffer *buffer)
 {
 	struct hdspm *hdspm = entry->private_data;
-	unsigned int status, status2, control, freq;
+	unsigned int status, status2;
 
 	char *pref_sync_ref;
 	char *autosync_ref;
 	char *system_clock_mode;
-	char *insel;
 	int x, x2;
 
 	status = hdspm_read(hdspm, HDSPM_statusRegister);
 	status2 = hdspm_read(hdspm, HDSPM_statusRegister2);
-	control = hdspm->control_register;
-	freq = hdspm_read(hdspm, HDSPM_timecodeRegister);
 
 	snd_iprintf(buffer, "%s (Card #%d) Rev.%x Status2first3bits: %x\n",
 			hdspm->card_name, hdspm->card->number + 1,
@@ -4947,17 +4943,6 @@ snd_hdspm_proc_read_madi(struct snd_info_entry *entry,
 	snd_iprintf(buffer, "Line out: %s\n",
 		(hdspm->control_register & HDSPM_LineOut) ? "on " : "off");
 
-	switch (hdspm->control_register & HDSPM_InputMask) {
-	case HDSPM_InputOptical:
-		insel = "Optical";
-		break;
-	case HDSPM_InputCoaxial:
-		insel = "Coaxial";
-		break;
-	default:
-		insel = "Unknown";
-	}
-
 	snd_iprintf(buffer,
 		"ClearTrackMarker = %s, Transmit in %s Channel Mode, "
 		"Auto Input %s\n",
@@ -5202,15 +5187,13 @@ snd_hdspm_proc_read_raydat(struct snd_info_entry *entry,
 			 struct snd_info_buffer *buffer)
 {
 	struct hdspm *hdspm = entry->private_data;
-	unsigned int status1, status2, status3, control, i;
+	unsigned int status1, status2, status3, i;
 	unsigned int lock, sync;
 
 	status1 = hdspm_read(hdspm, HDSPM_RD_STATUS_1); /* s1 */
 	status2 = hdspm_read(hdspm, HDSPM_RD_STATUS_2); /* freq */
 	status3 = hdspm_read(hdspm, HDSPM_RD_STATUS_3); /* s2 */
 
-	control = hdspm->control_register;
-
 	snd_iprintf(buffer, "STATUS1: 0x%08x\n", status1);
 	snd_iprintf(buffer, "STATUS2: 0x%08x\n", status2);
 	snd_iprintf(buffer, "STATUS3: 0x%08x\n", status3);
-- 
1.7.9.5

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

* [PATCH 3/5] ALSA: revo: Remove unused variable
  2014-07-01 11:32 [PATCH 1/5] ALSA: hda: Remove unused variable Sachin Kamat
  2014-07-01 11:32 ` [PATCH 2/5] ALSA: hdspm: Remove unused code Sachin Kamat
@ 2014-07-01 11:32 ` Sachin Kamat
  2014-07-01 11:57   ` Takashi Iwai
  2014-07-01 11:32 ` [PATCH 4/5] ALSA: echoaudio: " Sachin Kamat
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Sachin Kamat @ 2014-07-01 11:32 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, spk.linux

'err' is not used in the function. Remove it.

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
---
 sound/pci/ice1712/revo.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/pci/ice1712/revo.c b/sound/pci/ice1712/revo.c
index 1112ec1953be..0168aaa5f58c 100644
--- a/sound/pci/ice1712/revo.c
+++ b/sound/pci/ice1712/revo.c
@@ -481,7 +481,6 @@ static int ap192_ak4114_init(struct snd_ice1712 *ice)
 	static const unsigned char ak4114_init_txcsb[] = {
 		0x41, 0x02, 0x2c, 0x00, 0x00
 	};
-	int err;
 
 	struct revo51_spec *spec;
 	spec = kzalloc(sizeof(*spec), GFP_KERNEL);
@@ -489,7 +488,7 @@ static int ap192_ak4114_init(struct snd_ice1712 *ice)
 		return -ENOMEM;
 	ice->spec = spec;
 
-	err = snd_ak4114_create(ice->card,
+	snd_ak4114_create(ice->card,
 				 ap192_ak4114_read,
 				 ap192_ak4114_write,
 				 ak4114_init_vals, ak4114_init_txcsb,
-- 
1.7.9.5

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

* [PATCH 4/5] ALSA: echoaudio: Remove unused variable
  2014-07-01 11:32 [PATCH 1/5] ALSA: hda: Remove unused variable Sachin Kamat
  2014-07-01 11:32 ` [PATCH 2/5] ALSA: hdspm: Remove unused code Sachin Kamat
  2014-07-01 11:32 ` [PATCH 3/5] ALSA: revo: Remove unused variable Sachin Kamat
@ 2014-07-01 11:32 ` Sachin Kamat
  2014-07-01 12:06   ` Takashi Iwai
  2014-07-01 11:32 ` [PATCH 5/5] ALSA: mixart: " Sachin Kamat
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 17+ messages in thread
From: Sachin Kamat @ 2014-07-01 11:32 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, spk.linux

'chip' is not used in the function. Remove it.

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
---
 sound/pci/echoaudio/echoaudio.c |    6 ------
 1 file changed, 6 deletions(-)

diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c
index 9f10c9e0df5e..631aaa4046ad 100644
--- a/sound/pci/echoaudio/echoaudio.c
+++ b/sound/pci/echoaudio/echoaudio.c
@@ -1754,9 +1754,6 @@ static struct snd_kcontrol_new snd_echo_vumeters_switch = {
 static int snd_echo_vumeters_info(struct snd_kcontrol *kcontrol,
 				  struct snd_ctl_elem_info *uinfo)
 {
-	struct echoaudio *chip;
-
-	chip = snd_kcontrol_chip(kcontrol);
 	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
 	uinfo->count = 96;
 	uinfo->value.integer.min = ECHOGAIN_MINOUT;
@@ -1798,9 +1795,6 @@ static struct snd_kcontrol_new snd_echo_vumeters = {
 static int snd_echo_channels_info_info(struct snd_kcontrol *kcontrol,
 				       struct snd_ctl_elem_info *uinfo)
 {
-	struct echoaudio *chip;
-
-	chip = snd_kcontrol_chip(kcontrol);
 	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
 	uinfo->count = 6;
 	uinfo->value.integer.min = 0;
-- 
1.7.9.5

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

* [PATCH 5/5] ALSA: mixart: Remove unused variable
  2014-07-01 11:32 [PATCH 1/5] ALSA: hda: Remove unused variable Sachin Kamat
                   ` (2 preceding siblings ...)
  2014-07-01 11:32 ` [PATCH 4/5] ALSA: echoaudio: " Sachin Kamat
@ 2014-07-01 11:32 ` Sachin Kamat
  2014-07-01 12:06   ` Takashi Iwai
  2014-07-01 11:56 ` [PATCH 1/5] ALSA: hda: " Takashi Iwai
  2014-07-01 15:07 ` Stephen Warren
  5 siblings, 1 reply; 17+ messages in thread
From: Sachin Kamat @ 2014-07-01 11:32 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, spk.linux

'err' is not used in the function. Remove it.

Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
---
 sound/pci/mixart/mixart_core.c |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/sound/pci/mixart/mixart_core.c b/sound/pci/mixart/mixart_core.c
index 71f4bdcc4055..84f67450924e 100644
--- a/sound/pci/mixart/mixart_core.c
+++ b/sound/pci/mixart/mixart_core.c
@@ -151,13 +151,11 @@ static int send_msg( struct mixart_mgr *mgr,
 {
 	u32 headptr, tailptr;
 	u32 msg_frame_address;
-	int err, i;
+	int i;
 
 	if (snd_BUG_ON(msg->size % 4))
 		return -EINVAL;
 
-	err = 0;
-
 	/* get message frame address */
 	tailptr = readl_be(MIXART_MEM(mgr, MSG_INBOUND_FREE_TAIL));
 	headptr = readl_be(MIXART_MEM(mgr, MSG_INBOUND_FREE_HEAD));
-- 
1.7.9.5

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

* Re: [PATCH 1/5] ALSA: hda: Remove unused variable
  2014-07-01 11:32 [PATCH 1/5] ALSA: hda: Remove unused variable Sachin Kamat
                   ` (3 preceding siblings ...)
  2014-07-01 11:32 ` [PATCH 5/5] ALSA: mixart: " Sachin Kamat
@ 2014-07-01 11:56 ` Takashi Iwai
  2014-07-01 12:03   ` Sachin Kamat
  2014-07-01 15:07 ` Stephen Warren
  5 siblings, 1 reply; 17+ messages in thread
From: Takashi Iwai @ 2014-07-01 11:56 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: Thierry Reding, alsa-devel, Stephen Warren, spk.linux

At Tue,  1 Jul 2014 17:02:54 +0530,
Sachin Kamat wrote:
> 
> 'status' is not used in the function. Remove it.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
> Cc: Stephen Warren <swarren@wwwdotorg.org>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> ---
> All patches in this series only compile tested.

Removing such a line is unsafe, thus it must be tested.  It changes
the hardware access pattern and sometimes the read is intentionally
there although the value isn't used.

That said, without testing, I won't apply such patches.


thanks,

Takashi


> ---
>  sound/pci/hda/hda_tegra.c |    4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/sound/pci/hda/hda_tegra.c b/sound/pci/hda/hda_tegra.c
> index a366ba9293a8..8cd7b06eecef 100644
> --- a/sound/pci/hda/hda_tegra.c
> +++ b/sound/pci/hda/hda_tegra.c
> @@ -272,13 +272,9 @@ static int hda_tegra_resume(struct device *dev)
>  	struct snd_card *card = dev_get_drvdata(dev);
>  	struct azx *chip = card->private_data;
>  	struct hda_tegra *hda = container_of(chip, struct hda_tegra, chip);
> -	int status;
>  
>  	hda_tegra_enable_clocks(hda);
>  
> -	/* Read STATESTS before controller reset */
> -	status = azx_readw(chip, STATESTS);
> -
>  	hda_tegra_init(hda);
>  
>  	azx_init_chip(chip, 1);
> -- 
> 1.7.9.5
> 

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

* Re: [PATCH 3/5] ALSA: revo: Remove unused variable
  2014-07-01 11:32 ` [PATCH 3/5] ALSA: revo: Remove unused variable Sachin Kamat
@ 2014-07-01 11:57   ` Takashi Iwai
  2014-07-01 12:00     ` Sachin Kamat
  0 siblings, 1 reply; 17+ messages in thread
From: Takashi Iwai @ 2014-07-01 11:57 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: alsa-devel, spk.linux

At Tue,  1 Jul 2014 17:02:56 +0530,
Sachin Kamat wrote:
> 
> 'err' is not used in the function. Remove it.

Better to handle the error case than ignoring it.


thanks,

Takashi

> 
> Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
> ---
>  sound/pci/ice1712/revo.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/sound/pci/ice1712/revo.c b/sound/pci/ice1712/revo.c
> index 1112ec1953be..0168aaa5f58c 100644
> --- a/sound/pci/ice1712/revo.c
> +++ b/sound/pci/ice1712/revo.c
> @@ -481,7 +481,6 @@ static int ap192_ak4114_init(struct snd_ice1712 *ice)
>  	static const unsigned char ak4114_init_txcsb[] = {
>  		0x41, 0x02, 0x2c, 0x00, 0x00
>  	};
> -	int err;
>  
>  	struct revo51_spec *spec;
>  	spec = kzalloc(sizeof(*spec), GFP_KERNEL);
> @@ -489,7 +488,7 @@ static int ap192_ak4114_init(struct snd_ice1712 *ice)
>  		return -ENOMEM;
>  	ice->spec = spec;
>  
> -	err = snd_ak4114_create(ice->card,
> +	snd_ak4114_create(ice->card,
>  				 ap192_ak4114_read,
>  				 ap192_ak4114_write,
>  				 ak4114_init_vals, ak4114_init_txcsb,
> -- 
> 1.7.9.5
> 

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

* Re: [PATCH 2/5] ALSA: hdspm: Remove unused code
  2014-07-01 11:32 ` [PATCH 2/5] ALSA: hdspm: Remove unused code Sachin Kamat
@ 2014-07-01 11:58   ` Takashi Iwai
  0 siblings, 0 replies; 17+ messages in thread
From: Takashi Iwai @ 2014-07-01 11:58 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: alsa-devel, spk.linux

At Tue,  1 Jul 2014 17:02:55 +0530,
Sachin Kamat wrote:
> 
> Removed the code which is not used in the functions.

Again, this also changes the hardware access pattern, so I'd take only
if it's tested.


thanks,

Takashi

> 
> Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
> ---
>  sound/pci/rme9652/hdspm.c |   23 +++--------------------
>  1 file changed, 3 insertions(+), 20 deletions(-)
> 
> diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
> index cb82b593473a..60ee41fda5d1 100644
> --- a/sound/pci/rme9652/hdspm.c
> +++ b/sound/pci/rme9652/hdspm.c
> @@ -1257,14 +1257,13 @@ static int hdspm_rate_multiplier(struct hdspm *hdspm, int rate)
>  /* check for external sample rate, returns the sample rate in Hz*/
>  static int hdspm_external_sample_rate(struct hdspm *hdspm)
>  {
> -	unsigned int status, status2, timecode;
> +	unsigned int status, status2;
>  	int syncref, rate = 0, rate_bits;
>  
>  	switch (hdspm->io_type) {
>  	case AES32:
>  		status2 = hdspm_read(hdspm, HDSPM_statusRegister2);
>  		status = hdspm_read(hdspm, HDSPM_statusRegister);
> -		timecode = hdspm_read(hdspm, HDSPM_timecodeRegister);
>  
>  		syncref = hdspm_autosync_ref(hdspm);
>  		switch (syncref) {
> @@ -4873,18 +4872,15 @@ snd_hdspm_proc_read_madi(struct snd_info_entry *entry,
>  			 struct snd_info_buffer *buffer)
>  {
>  	struct hdspm *hdspm = entry->private_data;
> -	unsigned int status, status2, control, freq;
> +	unsigned int status, status2;
>  
>  	char *pref_sync_ref;
>  	char *autosync_ref;
>  	char *system_clock_mode;
> -	char *insel;
>  	int x, x2;
>  
>  	status = hdspm_read(hdspm, HDSPM_statusRegister);
>  	status2 = hdspm_read(hdspm, HDSPM_statusRegister2);
> -	control = hdspm->control_register;
> -	freq = hdspm_read(hdspm, HDSPM_timecodeRegister);
>  
>  	snd_iprintf(buffer, "%s (Card #%d) Rev.%x Status2first3bits: %x\n",
>  			hdspm->card_name, hdspm->card->number + 1,
> @@ -4947,17 +4943,6 @@ snd_hdspm_proc_read_madi(struct snd_info_entry *entry,
>  	snd_iprintf(buffer, "Line out: %s\n",
>  		(hdspm->control_register & HDSPM_LineOut) ? "on " : "off");
>  
> -	switch (hdspm->control_register & HDSPM_InputMask) {
> -	case HDSPM_InputOptical:
> -		insel = "Optical";
> -		break;
> -	case HDSPM_InputCoaxial:
> -		insel = "Coaxial";
> -		break;
> -	default:
> -		insel = "Unknown";
> -	}
> -
>  	snd_iprintf(buffer,
>  		"ClearTrackMarker = %s, Transmit in %s Channel Mode, "
>  		"Auto Input %s\n",
> @@ -5202,15 +5187,13 @@ snd_hdspm_proc_read_raydat(struct snd_info_entry *entry,
>  			 struct snd_info_buffer *buffer)
>  {
>  	struct hdspm *hdspm = entry->private_data;
> -	unsigned int status1, status2, status3, control, i;
> +	unsigned int status1, status2, status3, i;
>  	unsigned int lock, sync;
>  
>  	status1 = hdspm_read(hdspm, HDSPM_RD_STATUS_1); /* s1 */
>  	status2 = hdspm_read(hdspm, HDSPM_RD_STATUS_2); /* freq */
>  	status3 = hdspm_read(hdspm, HDSPM_RD_STATUS_3); /* s2 */
>  
> -	control = hdspm->control_register;
> -
>  	snd_iprintf(buffer, "STATUS1: 0x%08x\n", status1);
>  	snd_iprintf(buffer, "STATUS2: 0x%08x\n", status2);
>  	snd_iprintf(buffer, "STATUS3: 0x%08x\n", status3);
> -- 
> 1.7.9.5
> 

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

* Re: [PATCH 3/5] ALSA: revo: Remove unused variable
  2014-07-01 11:57   ` Takashi Iwai
@ 2014-07-01 12:00     ` Sachin Kamat
  2014-07-01 12:04       ` Takashi Iwai
  0 siblings, 1 reply; 17+ messages in thread
From: Sachin Kamat @ 2014-07-01 12:00 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

On Tue, Jul 1, 2014 at 5:27 PM, Takashi Iwai <tiwai@suse.de> wrote:
> At Tue,  1 Jul 2014 17:02:56 +0530,
> Sachin Kamat wrote:
>>
>> 'err' is not used in the function. Remove it.
>
> Better to handle the error case than ignoring it.

A comment below the code says
"/* error ignored; it's no fatal error */"

Hence, I removed it.

Regards,
Sachin.

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

* Re: [PATCH 1/5] ALSA: hda: Remove unused variable
  2014-07-01 11:56 ` [PATCH 1/5] ALSA: hda: " Takashi Iwai
@ 2014-07-01 12:03   ` Sachin Kamat
  2014-07-01 12:06     ` Takashi Iwai
  0 siblings, 1 reply; 17+ messages in thread
From: Sachin Kamat @ 2014-07-01 12:03 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel, Stephen Warren, Thierry Reding

On Tue, Jul 1, 2014 at 5:26 PM, Takashi Iwai <tiwai@suse.de> wrote:
> At Tue,  1 Jul 2014 17:02:54 +0530,
> Sachin Kamat wrote:
>>
>> 'status' is not used in the function. Remove it.
>>
>> Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
>> Cc: Stephen Warren <swarren@wwwdotorg.org>
>> Cc: Thierry Reding <thierry.reding@gmail.com>
>> ---
>> All patches in this series only compile tested.
>
> Removing such a line is unsafe, thus it must be tested.  It changes
> the hardware access pattern and sometimes the read is intentionally
> there although the value isn't used.
>
> That said, without testing, I won't apply such patches.

Right. I understand. That is the reason I explicitly mentioned that patches
are untested.
However, in the above cases how about removing the local variable (return value)
and just keeping the read/write calls?

Regards,
Sachin.

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

* Re: [PATCH 3/5] ALSA: revo: Remove unused variable
  2014-07-01 12:00     ` Sachin Kamat
@ 2014-07-01 12:04       ` Takashi Iwai
  0 siblings, 0 replies; 17+ messages in thread
From: Takashi Iwai @ 2014-07-01 12:04 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: alsa-devel

At Tue, 1 Jul 2014 17:30:22 +0530,
Sachin Kamat wrote:
> 
> On Tue, Jul 1, 2014 at 5:27 PM, Takashi Iwai <tiwai@suse.de> wrote:
> > At Tue,  1 Jul 2014 17:02:56 +0530,
> > Sachin Kamat wrote:
> >>
> >> 'err' is not used in the function. Remove it.
> >
> > Better to handle the error case than ignoring it.
> 
> A comment below the code says
> "/* error ignored; it's no fatal error */"
> 
> Hence, I removed it.

The comment is wrong, then :)
If kmalloc for such a size fails, it's usually in a very bad
situation.


Takashi

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

* Re: [PATCH 1/5] ALSA: hda: Remove unused variable
  2014-07-01 12:03   ` Sachin Kamat
@ 2014-07-01 12:06     ` Takashi Iwai
  0 siblings, 0 replies; 17+ messages in thread
From: Takashi Iwai @ 2014-07-01 12:06 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: alsa-devel, Stephen Warren, Thierry Reding

At Tue, 1 Jul 2014 17:33:25 +0530,
Sachin Kamat wrote:
> 
> On Tue, Jul 1, 2014 at 5:26 PM, Takashi Iwai <tiwai@suse.de> wrote:
> > At Tue,  1 Jul 2014 17:02:54 +0530,
> > Sachin Kamat wrote:
> >>
> >> 'status' is not used in the function. Remove it.
> >>
> >> Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
> >> Cc: Stephen Warren <swarren@wwwdotorg.org>
> >> Cc: Thierry Reding <thierry.reding@gmail.com>
> >> ---
> >> All patches in this series only compile tested.
> >
> > Removing such a line is unsafe, thus it must be tested.  It changes
> > the hardware access pattern and sometimes the read is intentionally
> > there although the value isn't used.
> >
> > That said, without testing, I won't apply such patches.
> 
> Right. I understand. That is the reason I explicitly mentioned that patches
> are untested.
> However, in the above cases how about removing the local variable (return value)
> and just keeping the read/write calls?

If the call is needed, yes, at best with some comments.
But until someone really tests that it's unnecessary, there is no big
reason to touch the code.


Takashi

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

* Re: [PATCH 4/5] ALSA: echoaudio: Remove unused variable
  2014-07-01 11:32 ` [PATCH 4/5] ALSA: echoaudio: " Sachin Kamat
@ 2014-07-01 12:06   ` Takashi Iwai
  0 siblings, 0 replies; 17+ messages in thread
From: Takashi Iwai @ 2014-07-01 12:06 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: alsa-devel, spk.linux

At Tue,  1 Jul 2014 17:02:57 +0530,
Sachin Kamat wrote:
> 
> 'chip' is not used in the function. Remove it.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>

Applied, thanks.


Takashi

> ---
>  sound/pci/echoaudio/echoaudio.c |    6 ------
>  1 file changed, 6 deletions(-)
> 
> diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio/echoaudio.c
> index 9f10c9e0df5e..631aaa4046ad 100644
> --- a/sound/pci/echoaudio/echoaudio.c
> +++ b/sound/pci/echoaudio/echoaudio.c
> @@ -1754,9 +1754,6 @@ static struct snd_kcontrol_new snd_echo_vumeters_switch = {
>  static int snd_echo_vumeters_info(struct snd_kcontrol *kcontrol,
>  				  struct snd_ctl_elem_info *uinfo)
>  {
> -	struct echoaudio *chip;
> -
> -	chip = snd_kcontrol_chip(kcontrol);
>  	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
>  	uinfo->count = 96;
>  	uinfo->value.integer.min = ECHOGAIN_MINOUT;
> @@ -1798,9 +1795,6 @@ static struct snd_kcontrol_new snd_echo_vumeters = {
>  static int snd_echo_channels_info_info(struct snd_kcontrol *kcontrol,
>  				       struct snd_ctl_elem_info *uinfo)
>  {
> -	struct echoaudio *chip;
> -
> -	chip = snd_kcontrol_chip(kcontrol);
>  	uinfo->type = SNDRV_CTL_ELEM_TYPE_INTEGER;
>  	uinfo->count = 6;
>  	uinfo->value.integer.min = 0;
> -- 
> 1.7.9.5
> 

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

* Re: [PATCH 5/5] ALSA: mixart: Remove unused variable
  2014-07-01 11:32 ` [PATCH 5/5] ALSA: mixart: " Sachin Kamat
@ 2014-07-01 12:06   ` Takashi Iwai
  0 siblings, 0 replies; 17+ messages in thread
From: Takashi Iwai @ 2014-07-01 12:06 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: alsa-devel, spk.linux

At Tue,  1 Jul 2014 17:02:58 +0530,
Sachin Kamat wrote:
> 
> 'err' is not used in the function. Remove it.
> 
> Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>

Applied, thanks.


Takashi

> ---
>  sound/pci/mixart/mixart_core.c |    4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/sound/pci/mixart/mixart_core.c b/sound/pci/mixart/mixart_core.c
> index 71f4bdcc4055..84f67450924e 100644
> --- a/sound/pci/mixart/mixart_core.c
> +++ b/sound/pci/mixart/mixart_core.c
> @@ -151,13 +151,11 @@ static int send_msg( struct mixart_mgr *mgr,
>  {
>  	u32 headptr, tailptr;
>  	u32 msg_frame_address;
> -	int err, i;
> +	int i;
>  
>  	if (snd_BUG_ON(msg->size % 4))
>  		return -EINVAL;
>  
> -	err = 0;
> -
>  	/* get message frame address */
>  	tailptr = readl_be(MIXART_MEM(mgr, MSG_INBOUND_FREE_TAIL));
>  	headptr = readl_be(MIXART_MEM(mgr, MSG_INBOUND_FREE_HEAD));
> -- 
> 1.7.9.5
> 

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

* Re: [PATCH 1/5] ALSA: hda: Remove unused variable
  2014-07-01 11:32 [PATCH 1/5] ALSA: hda: Remove unused variable Sachin Kamat
                   ` (4 preceding siblings ...)
  2014-07-01 11:56 ` [PATCH 1/5] ALSA: hda: " Takashi Iwai
@ 2014-07-01 15:07 ` Stephen Warren
  2014-07-01 15:47   ` Dylan Reid
  5 siblings, 1 reply; 17+ messages in thread
From: Stephen Warren @ 2014-07-01 15:07 UTC (permalink / raw)
  To: Dylan Reid; +Cc: alsa-devel, tiwai, Sachin Kamat, Thierry Reding, spk.linux

On 07/01/2014 05:32 AM, Sachin Kamat wrote:
> 'status' is not used in the function. Remove it.

CCing Dylan Reid for comments/testing since he wrote or upstreamed this
code.

> Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
> Cc: Stephen Warren <swarren@wwwdotorg.org>
> Cc: Thierry Reding <thierry.reding@gmail.com>
> ---
> All patches in this series only compile tested.
> ---
>  sound/pci/hda/hda_tegra.c |    4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/sound/pci/hda/hda_tegra.c b/sound/pci/hda/hda_tegra.c
> index a366ba9293a8..8cd7b06eecef 100644
> --- a/sound/pci/hda/hda_tegra.c
> +++ b/sound/pci/hda/hda_tegra.c
> @@ -272,13 +272,9 @@ static int hda_tegra_resume(struct device *dev)
>  	struct snd_card *card = dev_get_drvdata(dev);
>  	struct azx *chip = card->private_data;
>  	struct hda_tegra *hda = container_of(chip, struct hda_tegra, chip);
> -	int status;
>  
>  	hda_tegra_enable_clocks(hda);
>  
> -	/* Read STATESTS before controller reset */
> -	status = azx_readw(chip, STATESTS);
> -
>  	hda_tegra_init(hda);
>  
>  	azx_init_chip(chip, 1);
> 

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

* Re: [PATCH 1/5] ALSA: hda: Remove unused variable
  2014-07-01 15:07 ` Stephen Warren
@ 2014-07-01 15:47   ` Dylan Reid
  2014-07-01 15:56     ` Takashi Iwai
  0 siblings, 1 reply; 17+ messages in thread
From: Dylan Reid @ 2014-07-01 15:47 UTC (permalink / raw)
  To: Stephen Warren
  Cc: alsa-devel, Takashi Iwai, Sachin Kamat, Thierry Reding, spk.linux

On Tue, Jul 1, 2014 at 8:07 AM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 07/01/2014 05:32 AM, Sachin Kamat wrote:
>> 'status' is not used in the function. Remove it.
>
> CCing Dylan Reid for comments/testing since he wrote or upstreamed this
> code.

Thanks, I gave this a try on a couple of systems this morning.  HDMI
audio still works through suspend/resume cycles.

>
>> Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
>> Cc: Stephen Warren <swarren@wwwdotorg.org>

Tested-by: Dylan Reid <dgreid@chromium.org>

>> Cc: Thierry Reding <thierry.reding@gmail.com>
>> ---
>> All patches in this series only compile tested.
>> ---
>>  sound/pci/hda/hda_tegra.c |    4 ----
>>  1 file changed, 4 deletions(-)
>>
>> diff --git a/sound/pci/hda/hda_tegra.c b/sound/pci/hda/hda_tegra.c
>> index a366ba9293a8..8cd7b06eecef 100644
>> --- a/sound/pci/hda/hda_tegra.c
>> +++ b/sound/pci/hda/hda_tegra.c
>> @@ -272,13 +272,9 @@ static int hda_tegra_resume(struct device *dev)
>>       struct snd_card *card = dev_get_drvdata(dev);
>>       struct azx *chip = card->private_data;
>>       struct hda_tegra *hda = container_of(chip, struct hda_tegra, chip);
>> -     int status;
>>
>>       hda_tegra_enable_clocks(hda);
>>
>> -     /* Read STATESTS before controller reset */
>> -     status = azx_readw(chip, STATESTS);
>> -
>>       hda_tegra_init(hda);
>>
>>       azx_init_chip(chip, 1);
>>
>

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

* Re: [PATCH 1/5] ALSA: hda: Remove unused variable
  2014-07-01 15:47   ` Dylan Reid
@ 2014-07-01 15:56     ` Takashi Iwai
  0 siblings, 0 replies; 17+ messages in thread
From: Takashi Iwai @ 2014-07-01 15:56 UTC (permalink / raw)
  To: Dylan Reid
  Cc: alsa-devel, Stephen Warren, Sachin Kamat, Thierry Reding, spk.linux

At Tue, 1 Jul 2014 08:47:39 -0700,
Dylan Reid wrote:
> 
> On Tue, Jul 1, 2014 at 8:07 AM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> > On 07/01/2014 05:32 AM, Sachin Kamat wrote:
> >> 'status' is not used in the function. Remove it.
> >
> > CCing Dylan Reid for comments/testing since he wrote or upstreamed this
> > code.
> 
> Thanks, I gave this a try on a couple of systems this morning.  HDMI
> audio still works through suspend/resume cycles.
> 
> >
> >> Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com>
> >> Cc: Stephen Warren <swarren@wwwdotorg.org>
> 
> Tested-by: Dylan Reid <dgreid@chromium.org>

Great, I applied the patch now.  Thanks!


Takashi

> 
> >> Cc: Thierry Reding <thierry.reding@gmail.com>
> >> ---
> >> All patches in this series only compile tested.
> >> ---
> >>  sound/pci/hda/hda_tegra.c |    4 ----
> >>  1 file changed, 4 deletions(-)
> >>
> >> diff --git a/sound/pci/hda/hda_tegra.c b/sound/pci/hda/hda_tegra.c
> >> index a366ba9293a8..8cd7b06eecef 100644
> >> --- a/sound/pci/hda/hda_tegra.c
> >> +++ b/sound/pci/hda/hda_tegra.c
> >> @@ -272,13 +272,9 @@ static int hda_tegra_resume(struct device *dev)
> >>       struct snd_card *card = dev_get_drvdata(dev);
> >>       struct azx *chip = card->private_data;
> >>       struct hda_tegra *hda = container_of(chip, struct hda_tegra, chip);
> >> -     int status;
> >>
> >>       hda_tegra_enable_clocks(hda);
> >>
> >> -     /* Read STATESTS before controller reset */
> >> -     status = azx_readw(chip, STATESTS);
> >> -
> >>       hda_tegra_init(hda);
> >>
> >>       azx_init_chip(chip, 1);
> >>
> >
> 

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

end of thread, other threads:[~2014-07-01 15:56 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-01 11:32 [PATCH 1/5] ALSA: hda: Remove unused variable Sachin Kamat
2014-07-01 11:32 ` [PATCH 2/5] ALSA: hdspm: Remove unused code Sachin Kamat
2014-07-01 11:58   ` Takashi Iwai
2014-07-01 11:32 ` [PATCH 3/5] ALSA: revo: Remove unused variable Sachin Kamat
2014-07-01 11:57   ` Takashi Iwai
2014-07-01 12:00     ` Sachin Kamat
2014-07-01 12:04       ` Takashi Iwai
2014-07-01 11:32 ` [PATCH 4/5] ALSA: echoaudio: " Sachin Kamat
2014-07-01 12:06   ` Takashi Iwai
2014-07-01 11:32 ` [PATCH 5/5] ALSA: mixart: " Sachin Kamat
2014-07-01 12:06   ` Takashi Iwai
2014-07-01 11:56 ` [PATCH 1/5] ALSA: hda: " Takashi Iwai
2014-07-01 12:03   ` Sachin Kamat
2014-07-01 12:06     ` Takashi Iwai
2014-07-01 15:07 ` Stephen Warren
2014-07-01 15:47   ` Dylan Reid
2014-07-01 15:56     ` 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.