diff options
author | Bartosz Golaszewski <bgolaszewski@baylibre.com> | 2020-09-14 17:45:57 +0200 |
---|---|---|
committer | Alexandre Belloni <alexandre.belloni@bootlin.com> | 2020-09-15 10:50:37 +0200 |
commit | 666f21413b881e159efaf862f119d4d058fa2c4a (patch) | |
tree | 2abd90d99c7657b23d781369a3de486ceb7b6d1c /drivers/rtc/rtc-rx8010.c | |
parent | rtc: rx8010: use a helper variable for client->dev in probe() (diff) | |
download | linux-666f21413b881e159efaf862f119d4d058fa2c4a.tar.xz linux-666f21413b881e159efaf862f119d4d058fa2c4a.zip |
rtc: rx8010: prefer sizeof(*val) over sizeof(struct type_of_val)
Using the size of the variable is preferred over using the size of its
type when allocating memory. Convert the call to devm_kzalloc() in
probe().
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20200914154601.32245-11-brgl@bgdev.pl
Diffstat (limited to 'drivers/rtc/rtc-rx8010.c')
-rw-r--r-- | drivers/rtc/rtc-rx8010.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/rtc/rtc-rx8010.c b/drivers/rtc/rtc-rx8010.c index dba7c3f87d9e..aa357f800ad4 100644 --- a/drivers/rtc/rtc-rx8010.c +++ b/drivers/rtc/rtc-rx8010.c @@ -429,7 +429,7 @@ static int rx8010_probe(struct i2c_client *client, return -EIO; } - rx8010 = devm_kzalloc(dev, sizeof(struct rx8010_data), GFP_KERNEL); + rx8010 = devm_kzalloc(dev, sizeof(*rx8010), GFP_KERNEL); if (!rx8010) return -ENOMEM; |