[RFC PATCH v7 2/8] dpll: Add DPLL framework base functions

Kubalewski, Arkadiusz arkadiusz.kubalewski at intel.com
Tue Jun 6 11:50:29 PDT 2023


>From: Jiri Pirko <jiri at resnulli.us>
>Sent: Wednesday, May 3, 2023 10:09 AM
>
>Fri, Apr 28, 2023 at 02:20:03AM CEST, vadfed at meta.com wrote:
>>From: Vadim Fedorenko <vadim.fedorenko at linux.dev>
>
>[...]
>
>
>>+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.

>
>>+		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
>
>
>>+	if (!pin->prop.label) {
>>+		ret = -ENOMEM;
>>+		goto err;
>>+	}
>
>
>[...]



More information about the linux-arm-kernel mailing list