From: Jiri Pirko <jiri@resnulli.us>
Sent: Wednesday, May 3, 2023 10:09 AM
Fri, Apr 28, 2023 at 02:20:03AM CEST, vadfed@meta.com wrote:
quoted
From: Vadim Fedorenko <vadim.fedorenko@linux.dev>
[...]
quoted
+static struct dpll_pin *
+dpll_pin_alloc(u64 clock_id, u8 pin_idx, struct module *module,
+ const struct dpll_pin_properties *prop)
+{
+ struct dpll_pin *pin;
+ int ret, fs_size;
+
+ pin = kzalloc(sizeof(*pin), GFP_KERNEL);
+ if (!pin)
+ return ERR_PTR(-ENOMEM);
+ pin->pin_idx = pin_idx;
+ pin->clock_id = clock_id;
+ pin->module = module;
+ refcount_set(&pin->refcount, 1);
+ if (WARN_ON(!prop->label)) {
Why exactly label has to be mandatory? In mlx5, I have no use for it.
Please make it optional. IIRC, I asked for this in the last review
as well.
Fixed.
quoted
+ ret = -EINVAL;
+ goto err;
+ }
+ pin->prop.label = kstrdup(prop->label, GFP_KERNEL);
Labels should be static const string. Do you see a usecase when you need
to dup it? If not, remove this please.
Fixed.
Thank you,
Arkadiusz
quoted
+ if (!pin->prop.label) {
+ ret = -ENOMEM;
+ goto err;
+ }
[...]