ALSA: hda: Delete an unnecessary check before the function call "snd_info_free_entry"
diff mbox

Message ID 558FBCA0.2090206@users.sourceforge.net
State New
Headers show

Commit Message

SF Markus Elfring June 28, 2015, 9:21 a.m. UTC
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 28 Jun 2015 11:15:28 +0200

The snd_info_free_entry() function tests whether its argument is NULL and
then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 sound/pci/hda/patch_hdmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Takashi Iwai June 29, 2015, 9:03 a.m. UTC | #1
At Sun, 28 Jun 2015 11:21:36 +0200,
SF Markus Elfring wrote:
> 
> From: Markus Elfring <elfring@users.sourceforge.net>
> Date: Sun, 28 Jun 2015 11:15:28 +0200
> 
> The snd_info_free_entry() function tests whether its argument is NULL and
> then returns immediately. Thus the test around the call is not needed.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>

Applied, thanks.


Takashi

> ---
>  sound/pci/hda/patch_hdmi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
> index f852734..2f24338 100644
> --- a/sound/pci/hda/patch_hdmi.c
> +++ b/sound/pci/hda/patch_hdmi.c
> @@ -591,7 +591,7 @@ static int eld_proc_new(struct hdmi_spec_per_pin *per_pin, int index)
>  
>  static void eld_proc_free(struct hdmi_spec_per_pin *per_pin)
>  {
> -	if (!per_pin->codec->bus->shutdown && per_pin->proc_entry) {
> +	if (!per_pin->codec->bus->shutdown) {
>  		snd_info_free_entry(per_pin->proc_entry);
>  		per_pin->proc_entry = NULL;
>  	}
> -- 
> 2.4.4
>

Patch
diff mbox

diff --git a/sound/pci/hda/patch_hdmi.c b/sound/pci/hda/patch_hdmi.c
index f852734..2f24338 100644
--- a/sound/pci/hda/patch_hdmi.c
+++ b/sound/pci/hda/patch_hdmi.c
@@ -591,7 +591,7 @@  static int eld_proc_new(struct hdmi_spec_per_pin *per_pin, int index)
 
 static void eld_proc_free(struct hdmi_spec_per_pin *per_pin)
 {
-	if (!per_pin->codec->bus->shutdown && per_pin->proc_entry) {
+	if (!per_pin->codec->bus->shutdown) {
 		snd_info_free_entry(per_pin->proc_entry);
 		per_pin->proc_entry = NULL;
 	}