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


Groups > linux.kernel > #1269776 > unrolled thread

[PATCH] ACPI-EC: Delete an unnecessary check before the function call "acpi_ec_delete_query"

Started bySF Markus Elfring <elfring@users.sourceforge.net>
First post2015-11-15 23:00 +0100
Last post2015-11-15 23:00 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH] ACPI-EC: Delete an unnecessary check before the function call  "acpi_ec_delete_query" SF Markus Elfring <elfring@users.sourceforge.net> - 2015-11-15 23:00 +0100

#1269776 — [PATCH] ACPI-EC: Delete an unnecessary check before the function call "acpi_ec_delete_query"

FromSF Markus Elfring <elfring@users.sourceforge.net>
Date2015-11-15 23:00 +0100
Subject[PATCH] ACPI-EC: Delete an unnecessary check before the function call "acpi_ec_delete_query"
Message-ID<qvdv4-6Uk-7@gated-at.bofh.it>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sun, 15 Nov 2015 22:42:27 +0100

The acpi_ec_delete_query() function tests whether its argument is NULL
and then returns immediately. Thus the test around the call is not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/acpi/ec.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index f61a7c8..b420fb4 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -1103,7 +1103,7 @@ static int acpi_ec_query(struct acpi_ec *ec, u8 *data)
 	}
 
 err_exit:
-	if (result && q)
+	if (result)
 		acpi_ec_delete_query(q);
 	if (data)
 		*data = value;
-- 
2.6.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web