[PATCH 5/6] PNP: Improve a size determination in quirk_awe32_add_ports()
From: SF Markus Elfring
Date: Mon May 15 2017 - 15:20:22 EST
From: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
Date: Mon, 15 May 2017 20:32:12 +0200
Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@xxxxxxxxxxxxxxxxxxxxx>
---
drivers/pnp/quirks.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pnp/quirks.c b/drivers/pnp/quirks.c
index 34e2d4563bbd..f9be5f3fb7ea 100644
--- a/drivers/pnp/quirks.c
+++ b/drivers/pnp/quirks.c
@@ -29,5 +29,5 @@ static void quirk_awe32_add_ports(struct pnp_dev *dev,
{
struct pnp_option *new_option;
- new_option = kmalloc(sizeof(struct pnp_option), GFP_KERNEL);
+ new_option = kmalloc(sizeof(*new_option), GFP_KERNEL);
if (!new_option) {
--
2.13.0