diff mbox series

[RFC,v1,18/30] platform/x86: wmi: use !p to check for NULL

Message ID 20210904175450.156801-19-pobrn@protonmail.com (mailing list archive)
State Accepted, archived
Headers show
Series platform/x86: wmi: minor improvements | expand

Commit Message

Barnabás Pőcze Sept. 4, 2021, 5:55 p.m. UTC
Other parts of the code use the `!p` idiom to check
for NULL pointers, convert `find_guid_context()` to
do the same.

Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com>
---
 drivers/platform/x86/wmi.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--
2.33.0
diff mbox series

Patch

diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index 979135a678e0..0e721d868bf7 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -141,10 +141,10 @@  static const void *find_guid_context(struct wmi_block *wblock,
 	const struct wmi_device_id *id;
 	guid_t guid_input;

-	if (wdriver->id_table == NULL)
+	id = wdriver->id_table;
+	if (!id)
 		return NULL;

-	id = wdriver->id_table;
 	while (*id->guid_string) {
 		if (guid_parse(id->guid_string, &guid_input))
 			continue;