mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: William Breathitt Gray <william.gray@linaro.org>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] counter: 104-quad-8: Migrate to the regmap API
Date: Tue, 11 Apr 2023 17:37:32 +0300	[thread overview]
Message-ID: <ZDVwrEZh1y88Hw8b@smile.fi.intel.com> (raw)
In-Reply-To: <20230410141252.143998-1-william.gray@linaro.org>

On Mon, Apr 10, 2023 at 10:12:52AM -0400, William Breathitt Gray wrote:
> The regmap API supports IO port accessors so we can take advantage of
> regmap abstractions rather than handling access to the device registers
> directly in the driver.

Looking at the statistics it's a bit unfortunate that LoCs are risen,
perhaps you can add more points why regmap is better than direct IO
accessors.

...

> +	int state;

state...

> +	state = regmap_test_bits(priv->map, QUAD8_INDEX_INPUT_LEVELS, BIT(signal->id - 16));
> +	if (state < 0)
> +		return state;

...

> +	int ret;

ret...

> +	ret = regmap_write(priv->map, QUAD8_CONTROL(count->id),
> +			   SELECT_RLD | RESET_BP | TRANSFER_CNTR_TO_OL);
> +	if (ret)
> +		goto exit_unlock;

...

> +	int err;

err...

> +	err = regmap_write(priv->map, QUAD8_CONTROL(id), SELECT_RLD | RESET_BP);
> +	if (err)
> +		return err;

...

Maybe a bit of consistency?


...

> +	int err;
> +	unsigned int status;
>  	unsigned long irq_status;
>  	unsigned long channel;
>  	unsigned int flg_pins;
>  	u8 event;

Perhaps longer lines first? Hence

	int ret;

to be here.

-- 
With Best Regards,
Andy Shevchenko



      reply	other threads:[~2023-04-11 14:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-10 14:12 William Breathitt Gray
2023-04-11 14:37 ` Andy Shevchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZDVwrEZh1y88Hw8b@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=william.gray@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®