projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6133913
)
platform/x86: wmi: use !p to check for NULL
author
Barnabás Pőcze
<pobrn@protonmail.com>
Sat, 4 Sep 2021 17:55:52 +0000
(17:55 +0000)
committer
Hans de Goede
<hdegoede@redhat.com>
Tue, 14 Sep 2021 10:26:01 +0000
(12:26 +0200)
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>
Link:
https://lore.kernel.org/r/20210904175450.156801-19-pobrn@protonmail.com
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
drivers/platform/x86/wmi.c
patch
|
blob
|
history
diff --git
a/drivers/platform/x86/wmi.c
b/drivers/platform/x86/wmi.c
index 9ed8622545979b60cf0a31a09be5890337fc88b7..38364534e9eb65eaeec2b08ca18ae61a1b9350ca 100644
(file)
--- 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;