LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 10/12] sound: au88x0_pcm.c fix integer as NULL pointer warning
@ 2008-02-28  0:56 Harvey Harrison
  2008-02-28 11:08 ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Harvey Harrison @ 2008-02-28  0:56 UTC (permalink / raw)
  To: Andrew Morton; +Cc: LKML

sound/pci/au88x0/au88x0_pcm.c:508:15: warning: Using plain integer as NULL pointer

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
 sound/pci/au88x0/au88x0_pcm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/pci/au88x0/au88x0_pcm.c b/sound/pci/au88x0/au88x0_pcm.c
index 526c6c5..232eb80 100644
--- a/sound/pci/au88x0/au88x0_pcm.c
+++ b/sound/pci/au88x0/au88x0_pcm.c
@@ -505,7 +505,7 @@ static int __devinit snd_vortex_new_pcm(vortex_t * chip, int idx, int nr)
 	int i;
 	int err, nr_capt;
 
-	if ((chip == 0) || (idx < 0) || (idx >= VORTEX_PCM_LAST))
+	if ((chip == NULL) || (idx < 0) || (idx >= VORTEX_PCM_LAST))
 		return -ENODEV;
 
 	/* idx indicates which kind of PCM device. ADB, SPDIF, I2S and A3D share the 
-- 
1.5.4.3.342.g99e8



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

* Re: [PATCH 10/12] sound: au88x0_pcm.c fix integer as NULL pointer warning
  2008-02-28  0:56 [PATCH 10/12] sound: au88x0_pcm.c fix integer as NULL pointer warning Harvey Harrison
@ 2008-02-28 11:08 ` Takashi Iwai
  2008-02-28 18:06   ` [PATCH 10/12v2] " Harvey Harrison
  0 siblings, 1 reply; 4+ messages in thread
From: Takashi Iwai @ 2008-02-28 11:08 UTC (permalink / raw)
  To: Harvey Harrison; +Cc: Andrew Morton, LKML

At Wed, 27 Feb 2008 16:56:08 -0800,
Harvey Harrison wrote:
> 
> sound/pci/au88x0/au88x0_pcm.c:508:15: warning: Using plain integer as NULL pointer
> 
> Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
> ---
>  sound/pci/au88x0/au88x0_pcm.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/sound/pci/au88x0/au88x0_pcm.c b/sound/pci/au88x0/au88x0_pcm.c
> index 526c6c5..232eb80 100644
> --- a/sound/pci/au88x0/au88x0_pcm.c
> +++ b/sound/pci/au88x0/au88x0_pcm.c
> @@ -505,7 +505,7 @@ static int __devinit snd_vortex_new_pcm(vortex_t * chip, int idx, int nr)
>  	int i;
>  	int err, nr_capt;
>  
> -	if ((chip == 0) || (idx < 0) || (idx >= VORTEX_PCM_LAST))
> +	if ((chip == NULL) || (idx < 0) || (idx >= VORTEX_PCM_LAST))

"if (!chip)" is the standard style.  Let's fix in that way.
Also, strip unneeded parentheses.


thanks,

Takashi

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

* [PATCH 10/12v2] sound: au88x0_pcm.c fix integer as NULL pointer warning
  2008-02-28 11:08 ` Takashi Iwai
@ 2008-02-28 18:06   ` Harvey Harrison
  2008-02-29 11:04     ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Harvey Harrison @ 2008-02-28 18:06 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: Andrew Morton, LKML

sound/pci/au88x0/au88x0_pcm.c:508:15: warning: Using plain integer as NULL pointer

Also some small codingstyle fixes.

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
---
 sound/pci/au88x0/au88x0_pcm.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/sound/pci/au88x0/au88x0_pcm.c b/sound/pci/au88x0/au88x0_pcm.c
index 526c6c5..f9a58b4 100644
--- a/sound/pci/au88x0/au88x0_pcm.c
+++ b/sound/pci/au88x0/au88x0_pcm.c
@@ -498,14 +498,14 @@ static struct snd_kcontrol_new snd_vortex_mixer_spdif[] __devinitdata = {
 };
 
 /* create a pcm device */
-static int __devinit snd_vortex_new_pcm(vortex_t * chip, int idx, int nr)
+static int __devinit snd_vortex_new_pcm(vortex_t *chip, int idx, int nr)
 {
 	struct snd_pcm *pcm;
 	struct snd_kcontrol *kctl;
 	int i;
 	int err, nr_capt;
 
-	if ((chip == 0) || (idx < 0) || (idx >= VORTEX_PCM_LAST))
+	if (!chip || idx < 0 || idx >= VORTEX_PCM_LAST)
 		return -ENODEV;
 
 	/* idx indicates which kind of PCM device. ADB, SPDIF, I2S and A3D share the 
@@ -514,9 +514,9 @@ static int __devinit snd_vortex_new_pcm(vortex_t * chip, int idx, int nr)
 		nr_capt = nr;
 	else
 		nr_capt = 0;
-	if ((err =
-	     snd_pcm_new(chip->card, vortex_pcm_prettyname[idx], idx, nr,
-			 nr_capt, &pcm)) < 0)
+	err = snd_pcm_new(chip->card, vortex_pcm_prettyname[idx], idx, nr,
+			  nr_capt, &pcm);
+	if (err < 0)
 		return err;
 	strcpy(pcm->name, vortex_pcm_name[idx]);
 	chip->pcm[idx] = pcm;
-- 
1.5.4.3.342.g99e8




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

* Re: [PATCH 10/12v2] sound: au88x0_pcm.c fix integer as NULL pointer warning
  2008-02-28 18:06   ` [PATCH 10/12v2] " Harvey Harrison
@ 2008-02-29 11:04     ` Takashi Iwai
  0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2008-02-29 11:04 UTC (permalink / raw)
  To: Harvey Harrison; +Cc: Andrew Morton, LKML

At Thu, 28 Feb 2008 10:06:49 -0800,
Harvey Harrison wrote:
> 
> sound/pci/au88x0/au88x0_pcm.c:508:15: warning: Using plain integer as NULL pointer
> 
> Also some small codingstyle fixes.
> 
> Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>

Applied to ALSA tree.  Thanks.


Takashi

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

end of thread, other threads:[~2008-02-29 11:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-28  0:56 [PATCH 10/12] sound: au88x0_pcm.c fix integer as NULL pointer warning Harvey Harrison
2008-02-28 11:08 ` Takashi Iwai
2008-02-28 18:06   ` [PATCH 10/12v2] " Harvey Harrison
2008-02-29 11:04     ` Takashi Iwai

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).