Skip to contentSkip to conversation

platform/x86: wmi: use sizeof(*p) in allocation

RFC PATCH In review Barnabás Pőcze 1 participant 1 message Sep 4, 2021 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

RFC PATCH 19/30 platform/x86: wmi: use sizeof(*p) in allocation

As per the coding style guide, the preferred way to pass the size of objects to allocator functions is sizeof(*p). Use that.

---
 drivers/platform/x86/wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/wmi.c +1 -1
index 0e721d868bf7..7f7dfb7f9aa8 100644
@@ -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;

--
2.33.0