diff mbox

[2/4] x86/ioapic: Fix setup_res() failing to get resource

Message ID 1469549597-19253-3-git-send-email-rui.y.wang@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wang, Rui Y July 26, 2016, 4:13 p.m. UTC
setup_res() doesn't actually get any resoure because it mistakenly
checks the return value of acpi_dev_filter_resource_type(), which
returns 0 on success, and 1 on failure. Fix it by taking the return
value of non-zero as failing to match the specified resource type.

Signed-off-by: Rui Wang <rui.y.wang@intel.com>
---
 drivers/acpi/ioapic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Bjorn Helgaas July 26, 2016, 8:21 p.m. UTC | #1
On Wed, Jul 27, 2016 at 12:13:15AM +0800, Rui Wang wrote:
> setup_res() doesn't actually get any resoure because it mistakenly

s/resoure/resource/

> checks the return value of acpi_dev_filter_resource_type(), which
> returns 0 on success, and 1 on failure. Fix it by taking the return
> value of non-zero as failing to match the specified resource type.
> 
> Signed-off-by: Rui Wang <rui.y.wang@intel.com>
> ---
>  drivers/acpi/ioapic.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/ioapic.c b/drivers/acpi/ioapic.c
> index 0f272e2..daf4a40 100644
> --- a/drivers/acpi/ioapic.c
> +++ b/drivers/acpi/ioapic.c
> @@ -46,7 +46,7 @@ static acpi_status setup_res(struct acpi_resource *acpi_res, void *data)
>  	struct resource_win win;
>  
>  	res->flags = 0;
> -	if (acpi_dev_filter_resource_type(acpi_res, IORESOURCE_MEM) == 0)
> +	if (acpi_dev_filter_resource_type(acpi_res, IORESOURCE_MEM))
>  		return AE_OK;
>  
>  	if (!acpi_dev_resource_memory(acpi_res, res)) {
> -- 
> 1.8.3.1
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/acpi/ioapic.c b/drivers/acpi/ioapic.c
index 0f272e2..daf4a40 100644
--- a/drivers/acpi/ioapic.c
+++ b/drivers/acpi/ioapic.c
@@ -46,7 +46,7 @@  static acpi_status setup_res(struct acpi_resource *acpi_res, void *data)
 	struct resource_win win;
 
 	res->flags = 0;
-	if (acpi_dev_filter_resource_type(acpi_res, IORESOURCE_MEM) == 0)
+	if (acpi_dev_filter_resource_type(acpi_res, IORESOURCE_MEM))
 		return AE_OK;
 
 	if (!acpi_dev_resource_memory(acpi_res, res)) {