Skip to content

Commit

Permalink
ARM: OMAP2+: Improve a size determination in sr_dev_init()
Browse files Browse the repository at this point in the history
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@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Markus Elfring authored and Tony Lindgren committed Jun 8, 2017
1 parent 1a61a2a commit 1dfb5b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/arm/mach-omap2/sr_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ static int __init sr_dev_init(struct omap_hwmod *oh, void *user)
char *name = "smartreflex";
static int i;

sr_data = kzalloc(sizeof(struct omap_sr_data), GFP_KERNEL);
sr_data = kzalloc(sizeof(*sr_data), GFP_KERNEL);
if (!sr_data) {
pr_err("%s: Unable to allocate memory for %s sr_data\n",
__func__, oh->name);
Expand Down

0 comments on commit 1dfb5b5

Please sign in to comment.