linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ACPI / utils: remove redundant check if element is NULL
@ 2016-02-28 20:31 Colin King
  2016-03-10 23:34 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2016-02-28 20:31 UTC (permalink / raw)
  To: Rafael J . Wysocki, Len Brown, linux-acpi, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

element is &package->package.elements[i] which can never be NULL
so the check to see if it is NULL is redundant and can be removed.

Detected with static analysis by CoverityScan

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/acpi/utils.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c
index f2f9873..f12a724 100644
--- a/drivers/acpi/utils.c
+++ b/drivers/acpi/utils.c
@@ -201,10 +201,6 @@ acpi_extract_package(union acpi_object *package,
 		u8 **pointer = NULL;
 		union acpi_object *element = &(package->package.elements[i]);
 
-		if (!element) {
-			return AE_BAD_DATA;
-		}
-
 		switch (element->type) {
 
 		case ACPI_TYPE_INTEGER:
-- 
2.7.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ACPI / utils: remove redundant check if element is NULL
  2016-02-28 20:31 [PATCH] ACPI / utils: remove redundant check if element is NULL Colin King
@ 2016-03-10 23:34 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2016-03-10 23:34 UTC (permalink / raw)
  To: Colin King; +Cc: Rafael J . Wysocki, Len Brown, linux-acpi, linux-kernel

On Sunday, February 28, 2016 08:31:49 PM Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> element is &package->package.elements[i] which can never be NULL
> so the check to see if it is NULL is redundant and can be removed.
> 
> Detected with static analysis by CoverityScan
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied, thanks!

Rafael

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-10 23:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-28 20:31 [PATCH] ACPI / utils: remove redundant check if element is NULL Colin King
2016-03-10 23:34 ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).