diff mbox

[3/5] ALSA: revo: Remove unused variable

Message ID 1404214378-24669-3-git-send-email-sachin.kamat@samsung.com (mailing list archive)
State Accepted
Delegated to: Takashi Iwai
Headers show

Commit Message

Sachin Kamat July 1, 2014, 11:32 a.m. UTC
'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(-)

Comments

Takashi Iwai July 1, 2014, 11:57 a.m. UTC | #1
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
>
Sachin Kamat July 1, 2014, noon UTC | #2
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.
Takashi Iwai July 1, 2014, 12:04 p.m. UTC | #3
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
diff mbox

Patch

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,