diff mbox series

[RFC,v1,19/30] platform/x86: wmi: use sizeof(*p) in allocation

Message ID 20210904175450.156801-20-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:56 p.m. UTC
As per the coding style guide, the preferred way
to pass the size of objects to allocator functions
is `sizeof(*p)`. Use that.

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

--
2.33.0
diff mbox series

Patch

diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index 0e721d868bf7..7f7dfb7f9aa8 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -1176,7 +1176,7 @@  static int parse_wdg(struct device *wmi_bus_dev, struct acpi_device *device)
 		if (guid_already_parsed(device, &gblock[i].guid))
 			continue;

-		wblock = kzalloc(sizeof(struct wmi_block), GFP_KERNEL);
+		wblock = kzalloc(sizeof(*wblock), GFP_KERNEL);
 		if (!wblock) {
 			retval = -ENOMEM;
 			break;