alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] sound/soc/fsl/fsl_ssi.c: let checking none-zero instead of checking NO_IRQ
@ 2013-09-23  3:24 Chen Gang
  2013-09-23  3:35 ` Chen Gang
  0 siblings, 1 reply; 5+ messages in thread
From: Chen Gang @ 2013-09-23  3:24 UTC (permalink / raw)
  To: lgirdwood, Mark Brown, perex, Takashi Iwai; +Cc: alsa-devel, linuxppc-dev

NO_IRQ may be defined as '(unsigned int) -1' in some architectures
(arm, sh ...), and either may not be defined in some architectures
which can enable SND_SOC_FSL_SSI (e.g. allmodconfig for arc).

When irq_of_parse_and_map() fails, it will always return 0, so need let
checking none-zero instead of checking NO_IRQ, or will cause compiling
issue or run time bug in some architectures.


Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
 sound/soc/fsl/fsl_ssi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 6ac8730..6c17d3e 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -936,7 +936,7 @@ static int fsl_ssi_probe(struct platform_device *pdev)
 	ssi_private->ssi_phys = res.start;
 
 	ssi_private->irq = irq_of_parse_and_map(np, 0);
-	if (ssi_private->irq == NO_IRQ) {
+	if (!ssi_private->irq) {
 		dev_err(&pdev->dev, "no irq for node %s\n", np->full_name);
 		return -ENXIO;
 	}
-- 
1.7.7.6

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

* Re: [PATCH] sound/soc/fsl/fsl_ssi.c: let checking none-zero instead of checking NO_IRQ
  2013-09-23  3:24 [PATCH] sound/soc/fsl/fsl_ssi.c: let checking none-zero instead of checking NO_IRQ Chen Gang
@ 2013-09-23  3:35 ` Chen Gang
  2013-09-23  3:36   ` [PATCH v2] sound/soc/fsl/fsl_ssi.c: let check zero instead of check NO_IRQ Chen Gang
  0 siblings, 1 reply; 5+ messages in thread
From: Chen Gang @ 2013-09-23  3:35 UTC (permalink / raw)
  To: lgirdwood, Mark Brown, perex, Takashi Iwai; +Cc: alsa-devel, linuxppc-dev

On 09/23/2013 11:24 AM, Chen Gang wrote:
> NO_IRQ may be defined as '(unsigned int) -1' in some architectures
> (arm, sh ...), and either may not be defined in some architectures
> which can enable SND_SOC_FSL_SSI (e.g. allmodconfig for arc).
> 
> When irq_of_parse_and_map() fails, it will always return 0, so need let
> checking none-zero instead of checking NO_IRQ, or will cause compiling
> issue or run time bug in some architectures.
> 

Oh, sorry, the subject and comment are incorrect, need use "zero"
instead of "none-zero".

I will send patch v2 for it.

> 
> Signed-off-by: Chen Gang <gang.chen@asianux.com>
> ---
>  sound/soc/fsl/fsl_ssi.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
> index 6ac8730..6c17d3e 100644
> --- a/sound/soc/fsl/fsl_ssi.c
> +++ b/sound/soc/fsl/fsl_ssi.c
> @@ -936,7 +936,7 @@ static int fsl_ssi_probe(struct platform_device *pdev)
>  	ssi_private->ssi_phys = res.start;
>  
>  	ssi_private->irq = irq_of_parse_and_map(np, 0);
> -	if (ssi_private->irq == NO_IRQ) {
> +	if (!ssi_private->irq) {
>  		dev_err(&pdev->dev, "no irq for node %s\n", np->full_name);
>  		return -ENXIO;
>  	}
> 


-- 
Chen Gang

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

* [PATCH v2] sound/soc/fsl/fsl_ssi.c: let check zero instead of check NO_IRQ
  2013-09-23  3:35 ` Chen Gang
@ 2013-09-23  3:36   ` Chen Gang
  2013-09-26 10:29     ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Chen Gang @ 2013-09-23  3:36 UTC (permalink / raw)
  To: lgirdwood, Mark Brown, perex, Takashi Iwai; +Cc: alsa-devel, linuxppc-dev

NO_IRQ may be defined as '(unsigned int) -1' in some architectures
(arm, sh ...), and either may not be defined in some architectures
which can enable SND_SOC_FSL_SSI (e.g. allmodconfig for arc).

When irq_of_parse_and_map() fails, it will always return 0, so need
check zero instead of NO_IRQ, or will cause compiling issue or run
time bug in some architectures.


Signed-off-by: Chen Gang <gang.chen@asianux.com>
---
 sound/soc/fsl/fsl_ssi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 6ac8730..6c17d3e 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -936,7 +936,7 @@ static int fsl_ssi_probe(struct platform_device *pdev)
 	ssi_private->ssi_phys = res.start;
 
 	ssi_private->irq = irq_of_parse_and_map(np, 0);
-	if (ssi_private->irq == NO_IRQ) {
+	if (!ssi_private->irq) {
 		dev_err(&pdev->dev, "no irq for node %s\n", np->full_name);
 		return -ENXIO;
 	}
-- 
1.7.7.6

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

* Re: [PATCH v2] sound/soc/fsl/fsl_ssi.c: let check zero instead of check NO_IRQ
  2013-09-23  3:36   ` [PATCH v2] sound/soc/fsl/fsl_ssi.c: let check zero instead of check NO_IRQ Chen Gang
@ 2013-09-26 10:29     ` Mark Brown
  2013-09-26 10:40       ` Chen Gang
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2013-09-26 10:29 UTC (permalink / raw)
  To: Chen Gang; +Cc: Takashi Iwai, alsa-devel, linuxppc-dev, lgirdwood, perex


[-- Attachment #1.1: Type: text/plain, Size: 279 bytes --]

On Mon, Sep 23, 2013 at 11:36:21AM +0800, Chen Gang wrote:
> NO_IRQ may be defined as '(unsigned int) -1' in some architectures
> (arm, sh ...), and either may not be defined in some architectures
> which can enable SND_SOC_FSL_SSI (e.g. allmodconfig for arc).

Applied, thanks.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 150 bytes --]

_______________________________________________
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

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

* Re: [PATCH v2] sound/soc/fsl/fsl_ssi.c: let check zero instead of check NO_IRQ
  2013-09-26 10:29     ` Mark Brown
@ 2013-09-26 10:40       ` Chen Gang
  0 siblings, 0 replies; 5+ messages in thread
From: Chen Gang @ 2013-09-26 10:40 UTC (permalink / raw)
  To: Mark Brown; +Cc: Takashi Iwai, alsa-devel, linuxppc-dev, lgirdwood, perex

On 09/26/2013 06:29 PM, Mark Brown wrote:
> On Mon, Sep 23, 2013 at 11:36:21AM +0800, Chen Gang wrote:
>> NO_IRQ may be defined as '(unsigned int) -1' in some architectures
>> (arm, sh ...), and either may not be defined in some architectures
>> which can enable SND_SOC_FSL_SSI (e.g. allmodconfig for arc).
> 
> Applied, thanks.
> 

Thank you too.  :-)

-- 
Chen Gang

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

end of thread, other threads:[~2013-09-26 10:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-23  3:24 [PATCH] sound/soc/fsl/fsl_ssi.c: let checking none-zero instead of checking NO_IRQ Chen Gang
2013-09-23  3:35 ` Chen Gang
2013-09-23  3:36   ` [PATCH v2] sound/soc/fsl/fsl_ssi.c: let check zero instead of check NO_IRQ Chen Gang
2013-09-26 10:29     ` Mark Brown
2013-09-26 10:40       ` Chen Gang

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).