summaryrefslogtreecommitdiffstats
path: root/drivers/mfd
diff options
context:
space:
mode:
authorMarkus Elfring <elfring@users.sourceforge.net>2018-03-08 14:05:41 +0100
committerLee Jones <lee.jones@linaro.org>2018-05-16 09:21:48 +0100
commit3eec4faddc92c8347d8cdc616aad4e3906ace186 (patch)
tree21a8b612597246ad989b59514c4c4051cd3ad4db /drivers/mfd
parenta9241b0921171bc8e595fa200aa021565cefcdcd (diff)
downloadop-kernel-dev-3eec4faddc92c8347d8cdc616aad4e3906ace186.zip
op-kernel-dev-3eec4faddc92c8347d8cdc616aad4e3906ace186.tar.gz
mfd: sm501: Improve a size determination in two functions
Replace the specification of data structures by pointer dereferences 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@users.sourceforge.net> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/sm501.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c
index 7298d6b..4f4957e 100644
--- a/drivers/mfd/sm501.c
+++ b/drivers/mfd/sm501.c
@@ -1383,7 +1383,7 @@ static int sm501_plat_probe(struct platform_device *dev)
struct sm501_devdata *sm;
int ret;
- sm = kzalloc(sizeof(struct sm501_devdata), GFP_KERNEL);
+ sm = kzalloc(sizeof(*sm), GFP_KERNEL);
if (sm == NULL) {
ret = -ENOMEM;
goto err1;
@@ -1572,7 +1572,7 @@ static int sm501_pci_probe(struct pci_dev *dev,
struct sm501_devdata *sm;
int err;
- sm = kzalloc(sizeof(struct sm501_devdata), GFP_KERNEL);
+ sm = kzalloc(sizeof(*sm), GFP_KERNEL);
if (sm == NULL) {
err = -ENOMEM;
goto err1;
OpenPOWER on IntegriCloud