projects
/
linux-2.6-microblaze.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
d388f06
)
hwmon: pmbus: Use devm_krealloc_array
author
James Clark
<james.clark@arm.com>
Tue, 9 May 2023 09:49:39 +0000
(10:49 +0100)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Tue, 30 May 2023 20:07:15 +0000
(21:07 +0100)
Now that it exists, use it instead of doing the multiplication manually.
Acked-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: James Clark <james.clark@arm.com>
Link:
https://lore.kernel.org/r/20230509094942.396150-3-james.clark@arm.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/hwmon/pmbus/pmbus_core.c
patch
|
blob
|
history
diff --git
a/drivers/hwmon/pmbus/pmbus_core.c
b/drivers/hwmon/pmbus/pmbus_core.c
index
9d14954
..
fa06325
100644
(file)
--- a/
drivers/hwmon/pmbus/pmbus_core.c
+++ b/
drivers/hwmon/pmbus/pmbus_core.c
@@
-1191,9
+1191,9
@@
static int pmbus_add_attribute(struct pmbus_data *data, struct attribute *attr)
{
if (data->num_attributes >= data->max_attributes - 1) {
int new_max_attrs = data->max_attributes + PMBUS_ATTR_ALLOC_SIZE;
- void *new_attrs = devm_krealloc(data->dev, data->group.attrs,
-
new_max_attrs *
sizeof(void *),
- GFP_KERNEL);
+ void *new_attrs = devm_krealloc
_array
(data->dev, data->group.attrs,
+
new_max_attrs,
sizeof(void *),
+
GFP_KERNEL);
if (!new_attrs)
return -ENOMEM;
data->group.attrs = new_attrs;