Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1499312 > unrolled thread

[PATCH] ACPI: fix the process flow for 0 which return from acpi_register_gsi

Started byMaJun <majun258@huawei.com>
First post2016-10-12 03:30 +0200
Last post2016-10-12 04:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] ACPI: fix the process flow for 0 which return from acpi_register_gsi MaJun <majun258@huawei.com> - 2016-10-12 03:30 +0200
    Re: [PATCH] ACPI: fix the process flow for 0 which return from  acpi_register_gsi Hanjun Guo <guohanjun@huawei.com> - 2016-10-12 04:10 +0200

#1499312 — [PATCH] ACPI: fix the process flow for 0 which return from acpi_register_gsi

FromMaJun <majun258@huawei.com>
Date2016-10-12 03:30 +0200
Subject[PATCH] ACPI: fix the process flow for 0 which return from acpi_register_gsi
Message-ID<srgwN-5Oo-1@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1499315 — Re: [PATCH] ACPI: fix the process flow for 0 which return from acpi_register_gsi

FromHanjun Guo <guohanjun@huawei.com>
Date2016-10-12 04:10 +0200
SubjectRe: [PATCH] ACPI: fix the process flow for 0 which return from acpi_register_gsi
Message-ID<srh9v-6ic-9@gated-at.bofh.it>
In reply to#1499312
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web