Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

extcon: Use sizeof(*pointer) instead of sizeof(type)

It is preferred to use sizeof(*pointer) instead of sizeof(type).
The type of the variable can change and one needs not change
the former (unlike the latter). No functional change intended.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>

authored by

Andy Shevchenko and committed by
Chanwoo Choi
ef753fb4 7bba9e81

+5 -8
+5 -8
drivers/extcon/extcon.c
··· 1098 1098 if (!edev->max_supported) 1099 1099 return 0; 1100 1100 1101 - edev->cables = kcalloc(edev->max_supported, 1102 - sizeof(struct extcon_cable), 1101 + edev->cables = kcalloc(edev->max_supported, sizeof(*edev->cables), 1103 1102 GFP_KERNEL); 1104 1103 if (!edev->cables) 1105 1104 return -ENOMEM; ··· 1160 1161 for (index = 0; edev->mutually_exclusive[index]; index++) 1161 1162 ; 1162 1163 1163 - edev->attrs_muex = kcalloc(index + 1, 1164 - sizeof(struct attribute *), 1164 + edev->attrs_muex = kcalloc(index + 1, sizeof(*edev->attrs_muex), 1165 1165 GFP_KERNEL); 1166 1166 if (!edev->attrs_muex) 1167 1167 return -ENOMEM; 1168 1168 1169 - edev->d_attrs_muex = kcalloc(index, 1170 - sizeof(struct device_attribute), 1169 + edev->d_attrs_muex = kcalloc(index, sizeof(*edev->d_attrs_muex), 1171 1170 GFP_KERNEL); 1172 1171 if (!edev->d_attrs_muex) { 1173 1172 kfree(edev->attrs_muex); ··· 1211 1214 return 0; 1212 1215 1213 1216 edev->extcon_dev_type.groups = kcalloc(edev->max_supported + 2, 1214 - sizeof(struct attribute_group *), 1215 - GFP_KERNEL); 1217 + sizeof(*edev->extcon_dev_type.groups), 1218 + GFP_KERNEL); 1216 1219 if (!edev->extcon_dev_type.groups) 1217 1220 return -ENOMEM; 1218 1221