linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ACPI: fix the process flow for 0 which return from acpi_register_gsi
@ 2016-10-12  1:20 MaJun
  2016-10-12  2:05 ` Hanjun Guo
  0 siblings, 1 reply; 4+ messages in thread
From: MaJun @ 2016-10-12  1:20 UTC (permalink / raw)
  To: linux-kernel, marc.zyngier, linux-acpi, rjw, lenb
  Cc: dingtianhong, guohanjun, majun258

The return value 0 from acpi_register_gsi() means irq mapping failed.
So, we should process this case in else branch.

Signed-off-by: MaJun <majun258@huawei.com>
---
 drivers/acpi/resource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
index 56241eb..9918326 100644
--- a/drivers/acpi/resource.c
+++ b/drivers/acpi/resource.c
@@ -416,7 +416,7 @@ static void acpi_dev_get_irqresource(struct resource *res, u32 gsi,
 
 	res->flags = acpi_dev_irq_flags(triggering, polarity, shareable);
 	irq = acpi_register_gsi(NULL, gsi, triggering, polarity);
-	if (irq >= 0) {
+	if (irq > 0) {
 		res->start = irq;
 		res->end = irq;
 	} else {
-- 
1.7.12.4



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

* Re: [PATCH] ACPI: fix the process flow for 0 which return from acpi_register_gsi
  2016-10-12  1:20 [PATCH] ACPI: fix the process flow for 0 which return from acpi_register_gsi MaJun
@ 2016-10-12  2:05 ` Hanjun Guo
  0 siblings, 0 replies; 4+ messages in thread
From: Hanjun Guo @ 2016-10-12  2:05 UTC (permalink / raw)
  To: MaJun, linux-kernel, marc.zyngier, linux-acpi, rjw, lenb; +Cc: dingtianhong

On 2016/10/12 9:20, MaJun wrote:
> The return value 0 from acpi_register_gsi() means irq mapping failed.
> So, we should process this case in else branch.
>
> Signed-off-by: MaJun <majun258@huawei.com>
> ---
>  drivers/acpi/resource.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
> index 56241eb..9918326 100644
> --- a/drivers/acpi/resource.c
> +++ b/drivers/acpi/resource.c
> @@ -416,7 +416,7 @@ static void acpi_dev_get_irqresource(struct resource *res, u32 gsi,
>  
>  	res->flags = acpi_dev_irq_flags(triggering, polarity, shareable);
>  	irq = acpi_register_gsi(NULL, gsi, triggering, polarity);
> -	if (irq >= 0) {
> +	if (irq > 0) {

On x86 or IA64, irq 0 is a valid irq number as far as I know.

Thanks
Hanjun


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

* [PATCH] ACPI: fix the process flow for 0 which return from acpi_register_gsi
@ 2016-12-01  7:41 Majun
  2016-12-01  7:43 ` majun (Euler7)
  0 siblings, 1 reply; 4+ messages in thread
From: Majun @ 2016-12-01  7:41 UTC (permalink / raw)
  To: linux-kernel, marc.zyngier, linux-acpi, robert.moore, lenb,
	lv.zheng, rafael.j.wysocki, devel, mark.rutland, robh+dt, jason
  Cc: dingtianhong, guohanjun, majun258

From: MaJun <majun258@huawei.com>

The return value 0 from acpi_register_gsi() means irq mapping failed.
So, we should process this case in else branch.

Signed-off-by: MaJun <majun258@huawei.com>
---
 drivers/acpi/resource.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
index 56241eb..9918326 100644
--- a/drivers/acpi/resource.c
+++ b/drivers/acpi/resource.c
@@ -416,7 +416,7 @@ static void acpi_dev_get_irqresource(struct resource *res, u32 gsi,
 
 	res->flags = acpi_dev_irq_flags(triggering, polarity, shareable);
 	irq = acpi_register_gsi(NULL, gsi, triggering, polarity);
-	if (irq >= 0) {
+	if (irq > 0) {
 		res->start = irq;
 		res->end = irq;
 	} else {
-- 
1.7.12.4



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

* Re: [PATCH] ACPI: fix the process flow for 0 which return from acpi_register_gsi
  2016-12-01  7:41 Majun
@ 2016-12-01  7:43 ` majun (Euler7)
  0 siblings, 0 replies; 4+ messages in thread
From: majun (Euler7) @ 2016-12-01  7:43 UTC (permalink / raw)
  To: linux-kernel, marc.zyngier, linux-acpi, robert.moore, lenb,
	lv.zheng, rafael.j.wysocki, devel, mark.rutland, robh+dt, jason
  Cc: majun258, dingtianhong, guohanjun

sorry, ignore this one..


在 2016/12/1 15:41, Majun 写道:
> From: MaJun <majun258@huawei.com>
> 
> The return value 0 from acpi_register_gsi() means irq mapping failed.
> So, we should process this case in else branch.
> 
> Signed-off-by: MaJun <majun258@huawei.com>
> ---
>  drivers/acpi/resource.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
> index 56241eb..9918326 100644
> --- a/drivers/acpi/resource.c
> +++ b/drivers/acpi/resource.c
> @@ -416,7 +416,7 @@ static void acpi_dev_get_irqresource(struct resource *res, u32 gsi,
>  
>  	res->flags = acpi_dev_irq_flags(triggering, polarity, shareable);
>  	irq = acpi_register_gsi(NULL, gsi, triggering, polarity);
> -	if (irq >= 0) {
> +	if (irq > 0) {
>  		res->start = irq;
>  		res->end = irq;
>  	} else {
> 


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

end of thread, other threads:[~2016-12-01  7:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-12  1:20 [PATCH] ACPI: fix the process flow for 0 which return from acpi_register_gsi MaJun
2016-10-12  2:05 ` Hanjun Guo
  -- strict thread matches above, loose matches on Subject: below --
2016-12-01  7:41 Majun
2016-12-01  7:43 ` majun (Euler7)

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