platform/x86: Use ACPI_FAILURE at appropriate places
authorAxel Lin <axel.lin@ingics.com>
Mon, 19 Sep 2016 01:33:51 +0000 (09:33 +0800)
committerDarren Hart <dvhart@linux.intel.com>
Tue, 13 Dec 2016 17:29:01 +0000 (09:29 -0800)
Use ACPI_FAILURE() to replace !ACPI_SUCCESS(), this avoid !! operations.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
drivers/platform/x86/intel-hid.c
drivers/platform/x86/intel-smartconnect.c
drivers/platform/x86/intel-vbtn.c
drivers/platform/x86/panasonic-laptop.c
drivers/platform/x86/thinkpad_acpi.c

index ed5874217ee76cf4364d8bbd6f8e49f26e19c215..00cbeca2108db62f6f74828ddad42636b12dbb7f 100644 (file)
@@ -69,7 +69,7 @@ static int intel_hid_set_enable(struct device *device, int enable)
 
        arg0.integer.value = enable;
        status = acpi_evaluate_object(ACPI_HANDLE(device), "HDSM", &args, NULL);
-       if (!ACPI_SUCCESS(status)) {
+       if (ACPI_FAILURE(status)) {
                dev_warn(device, "failed to %sable hotkeys\n",
                         enable ? "en" : "dis");
                return -EIO;
@@ -148,7 +148,7 @@ static void notify_handler(acpi_handle handle, u32 event, void *context)
        }
 
        status = acpi_evaluate_integer(handle, "HDEM", NULL, &ev_index);
-       if (!ACPI_SUCCESS(status)) {
+       if (ACPI_FAILURE(status)) {
                dev_warn(&device->dev, "failed to get event index\n");
                return;
        }
@@ -167,7 +167,7 @@ static int intel_hid_probe(struct platform_device *device)
        int err;
 
        status = acpi_evaluate_integer(handle, "HDMM", NULL, &mode);
-       if (!ACPI_SUCCESS(status)) {
+       if (ACPI_FAILURE(status)) {
                dev_warn(&device->dev, "failed to read mode\n");
                return -ENODEV;
        }
index 04cf5dffdfd9152436719e69955df00afe30e144..bbe4c06c769f66eabf8ed956cbb3361ef8407220 100644 (file)
@@ -29,7 +29,7 @@ static int smartconnect_acpi_init(struct acpi_device *acpi)
        acpi_status status;
 
        status = acpi_evaluate_integer(acpi->handle, "GAOS", NULL, &value);
-       if (!ACPI_SUCCESS(status))
+       if (ACPI_FAILURE(status))
                return -EINVAL;
 
        if (value & 0x1) {
index 146d02f8c9bc01c99c791bb45ba8df77ce7bb64b..f04a394d52d6d2e3443a6f549f477530174b7876 100644 (file)
@@ -97,7 +97,7 @@ static int intel_vbtn_probe(struct platform_device *device)
        int err;
 
        status = acpi_evaluate_object(handle, "VBDL", NULL, NULL);
-       if (!ACPI_SUCCESS(status)) {
+       if (ACPI_FAILURE(status)) {
                dev_warn(&device->dev, "failed to read Intel Virtual Button driver\n");
                return -ENODEV;
        }
index 3f870972247c4ac6b9103e8c1a86f7634b8ff051..59b8eb626dcce6547296c5e84e5dfa34f4e64bb7 100644 (file)
@@ -458,7 +458,7 @@ static void acpi_pcc_generate_keyinput(struct pcc_acpi *pcc)
 
        rc = acpi_evaluate_integer(pcc->handle, METHOD_HKEY_QUERY,
                                   NULL, &result);
-       if (!ACPI_SUCCESS(rc)) {
+       if (ACPI_FAILURE(rc)) {
                ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
                                 "error getting hotkey status\n"));
                return;
index b65ce7519411a87f2d279360df1b8fe252efce0b..31fb979b1bfef62bd63291c176d07b4c2808a399 100644 (file)
@@ -9018,7 +9018,7 @@ static int mute_led_on_off(struct tp_led_table *t, bool state)
        acpi_handle temp;
        int output;
 
-       if (!ACPI_SUCCESS(acpi_get_handle(hkey_handle, t->name, &temp))) {
+       if (ACPI_FAILURE(acpi_get_handle(hkey_handle, t->name, &temp))) {
                pr_warn("Thinkpad ACPI has no %s interface.\n", t->name);
                return -EIO;
        }