Blob Blame History Raw
From 1ebe62bec4120fd79967edbe990f2eea285a6e80 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= <pobrn@protonmail.com>
Date: Sat, 4 Sep 2021 17:55:26 +0000
Subject: [PATCH] platform/x86: wmi: remove unnecessary checks
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Git-commit: 1ebe62bec4120fd79967edbe990f2eea285a6e80
References: git-fixes
Patch-mainline: v5.16-rc1

The `find_guid_context()` is only called from one place,
and `wblock` and `wdriver` cannot be NULL there.
So remove the currently redundant checks.

Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
Link: https://lore.kernel.org/r/20210904175450.156801-11-pobrn@protonmail.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Oliver Neukum <oneukum@suse.com>
---
 drivers/platform/x86/wmi.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index 1ae42dcb4036..147cc5086f2a 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -135,8 +135,6 @@ static const void *find_guid_context(struct wmi_block *wblock,
 	const struct wmi_device_id *id;
 	guid_t guid_input;
 
-	if (wblock == NULL || wdriver == NULL)
-		return NULL;
 	if (wdriver->id_table == NULL)
 		return NULL;
 
-- 
2.34.1