Skip to contentSkip to conversation

sound/soc/fsl/fsl_ssi.c: let checking none-zero instead of checking NO_IRQ

PATCH Superseded Chen Gang 2 participants 5 messages Sep 23, 2013 – Sep 26, 2013

Subsystems (3)
lore
Share & tools
lore

Chen Gang

author
#0 lore raw

PATCH 1/1 sound/soc/fsl/fsl_ssi.c: let checking none-zero instead of checking NO_IRQ

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.

---
 sound/soc/fsl/fsl_ssi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/fsl/fsl_ssi.c +1 -1
index 6ac8730..6c17d3e 100644
@@ -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;
 	}
Signature · 1 line
1.7.7.6
author
#1 lore raw
Quoted 8 lines · Chen Gang

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.

Quoted 20 lines
---
 sound/soc/fsl/fsl_ssi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/fsl/fsl_ssi.c +1 -1
index 6ac8730..6c17d3e 100644
@@ -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;
 	}
Signature · 1 line
Chen Gang
author
#2 lore raw

PATCH v2 1/1 sound/soc/fsl/fsl_ssi.c: let check zero instead of check NO_IRQ

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.

---
 sound/soc/fsl/fsl_ssi.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/fsl/fsl_ssi.c +1 -1
index 6ac8730..6c17d3e 100644
@@ -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;
 	}
Signature · 1 line
1.7.7.6
maintainer Applied
#3 lore raw

Re: [PATCH v2] sound/soc/fsl/fsl_ssi.c: let check zero instead of check NO_IRQ

Quoted 3 lines · Chen Gang

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.

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev

author
#4 lore raw

Re: [PATCH v2] sound/soc/fsl/fsl_ssi.c: let check zero instead of check NO_IRQ

Quoted 7 lines · Mark Brown
Quoted 3 lines · Chen Gang

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

Signature · 1 line
Chen Gang