[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Fri, 2 Feb 2018 16:02:12 +0100
From: SF Markus Elfring <elfring@...rs.sourceforge.net>
To: linux-i2c@...r.kernel.org, Guan Xuetao <gxt@...c.pku.edu.cn>,
Wolfram Sang <wsa@...-dreams.de>
Cc: LKML <linux-kernel@...r.kernel.org>,
kernel-janitors@...r.kernel.org
Subject: [PATCH 2/2] i2c-puv3: Improve a size determination in
puv3_i2c_probe()
From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Fri, 2 Feb 2018 15:43:21 +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.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
drivers/i2c/busses/i2c-puv3.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/i2c/busses/i2c-puv3.c b/drivers/i2c/busses/i2c-puv3.c
index 5bd001d01bef..929fd12b92de 100644
--- a/drivers/i2c/busses/i2c-puv3.c
+++ b/drivers/i2c/busses/i2c-puv3.c
@@ -196,7 +196,7 @@ static int puv3_i2c_probe(struct platform_device *pdev)
if (!request_mem_region(mem->start, resource_size(mem), "puv3_i2c"))
return -EBUSY;
- adapter = kzalloc(sizeof(struct i2c_adapter), GFP_KERNEL);
+ adapter = kzalloc(sizeof(*adapter), GFP_KERNEL);
if (adapter == NULL) {
rc = -ENOMEM;
goto fail_nomem;
--
2.16.1
Powered by blists - more mailing lists