Re: [PATCH 1/3] hwmon: (nct6775) Use nct6775_*() lock function pointers in nct6775_data.

From: Andy Shevchenko
Date: Wed Nov 24 2021 - 11:04:08 EST


On Mon, Nov 22, 2021 at 11:29 PM Denis Pauk <pauk.denis@xxxxxxxxx> wrote:

Better subject line (after prefix): Use lock function pointers in nct6775_data
(note no period and drop of redundancy)

> Prepare for platform specific callbacks usage:
> * Use nct6775 lock function pointers in struct nct6775_data instead
> direct calls.

...

> +static int nct6775_lock(struct nct6775_data *data)
> +{
> + mutex_lock(&data->update_lock);
> +
> + return 0;
> +}
> +
> +static void nct6775_unlock(struct nct6775_data *data, struct device *dev)
> +{
> + mutex_unlock(&data->update_lock);
> +}

Have you run `sparse` against this?
Install `sparse` in your distribution and make kernel with
`make W=1 C=1 CF=-D__CHECK_ENDIAN__ ...`

It might require using special annotations to these functions to make
static analysers happy.

--
With Best Regards,
Andy Shevchenko