[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <affc3d44-3fdc-ce54-322a-c0beec3e92c6@users.sourceforge.net>
Date: Wed, 24 Jan 2018 17:35:47 +0100
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: linux-input@...r.kernel.org,
Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: [PATCH 2/3] Input: apbps2: Improve a size determination in
apbps2_of_probe()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Wed, 24 Jan 2018 17:15:39 +0100
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@...rs.sourceforge.net>
---
drivers/input/serio/apbps2.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/serio/apbps2.c b/drivers/input/serio/apbps2.c
index 9b75c4e1bc13..a1c64df3b6cb 100644
--- a/drivers/input/serio/apbps2.c
+++ b/drivers/input/serio/apbps2.c
@@ -170,7 +170,7 @@ static int apbps2_of_probe(struct platform_device *ofdev)
/* Set reload register to core freq in kHz/10 */
iowrite32be(freq_hz / 10000, &priv->regs->reload);
- priv->io = kzalloc(sizeof(struct serio), GFP_KERNEL);
+ priv->io = kzalloc(sizeof(*priv->io), GFP_KERNEL);
if (!priv->io)
return -ENOMEM;
--
2.16.1
Powered by blists - more mailing lists