Re: [PATCH 1/5] iio: backend: add support for decimation ratio set

From: Andy Shevchenko
Date: Mon Mar 24 2025 - 06:13:36 EST


On Mon, Mar 24, 2025 at 11:07:56AM +0200, Pop Ioan Daniel wrote:
> Add backend support for setting the decimation ratio used.

...

> +/**
> + * iio_backend_set_dec_rate - set decimation ratio
> + * @back: Backend device
> + * @rate: Rate in decimal
> +

Something is missing here...

> + * Return:
> + * 0 on success, negative error number on failure.

Please, double check that the style of Return section is the same as for the
rest of the functions in this file. If there are different styles choose one
which is simultaneously more recent and has more common sense in it (like
Returns: vs. Return, the preferred is the latter).

> + */

> +

Here is an uneeded blank line.

> +int iio_backend_set_dec_rate(struct iio_backend *back, unsigned int rate)
> +{

> + if (!rate)
> + return -EINVAL;

Yeah, besides missing style comment above, the function is undescribed. You
really need to add something meaningful in the kernel-doc and esp. explain
corner cases like this and choices made (why we fail it, what's wrong with 0?).

> + return iio_backend_op_call(back, set_dec_rate, rate);
> +}

--
With Best Regards,
Andy Shevchenko