1
0
Fork 0

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
zero-sugar-mainline-defconfig
Bartosz Golaszewski 2020-09-14 17:45:57 +02:00 committed by Alexandre Belloni
parent 955a123c14
commit 666f21413b
1 changed files with 1 additions and 1 deletions

View File

@ -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;