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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 drivers/platform/x86/wmi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
--
2.33.0






[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux