From: Andi Kleen Date: Mon, 6 Feb 2012 16:17:08 +0000 (-0800) Subject: ACPI: ec: Do request_region outside WARN() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d6795fe32da13bde39ea483e42799a22daa730b5;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git ACPI: ec: Do request_region outside WARN() WARN() is not supposed to have side effects, so move the request_regions outside. Signed-off-by: Andi Kleen Signed-off-by: Len Brown --- diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index b19a18dd994f..3268dcfbaa9b 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -812,10 +812,10 @@ static int acpi_ec_add(struct acpi_device *device) first_ec = ec; device->driver_data = ec; - WARN(!request_region(ec->data_addr, 1, "EC data"), - "Could not request EC data io port 0x%lx", ec->data_addr); - WARN(!request_region(ec->command_addr, 1, "EC cmd"), - "Could not request EC cmd io port 0x%lx", ec->command_addr); + ret = !!request_region(ec->data_addr, 1, "EC data"); + WARN(!ret, "Could not request EC data io port 0x%lx", ec->data_addr); + ret = !!request_region(ec->command_addr, 1, "EC cmd"); + WARN(!ret, "Could not request EC cmd io port 0x%lx", ec->command_addr); pr_info(PREFIX "GPE = 0x%lx, I/O: command/status = 0x%lx, data = 0x%lx\n", ec->gpe, ec->command_addr, ec->data_addr);