mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Sverdlin, Alexander" <alexander.sverdlin@siemens.com>
To: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>
Cc: "o.rempel@pengutronix.de" <o.rempel@pengutronix.de>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"wbg@kernel.org" <wbg@kernel.org>
Subject: Re: [PATCH] counter: interrupt-cnt: Convert atomic_t -> atomic_long_t
Date: Fri, 2 May 2025 09:24:18 +0000	[thread overview]
Message-ID: <91c00e75bc25267d57863494d638f0a43e499ac4.camel@siemens.com> (raw)
In-Reply-To: <20250331152222.2263776-1-alexander.sverdlin@siemens.com>

Dear maintainers,

On Mon, 2025-03-31 at 17:22 +0200, A. Sverdlin wrote:
> From: Alexander Sverdlin <alexander.sverdlin@siemens.com>
> 
> Convert the internal counter type to atomic_long_t, which:
> - doesn't change much for existing in-tree users as they are 32-bit anyway
>   (stm32/i.MX6)
> - doesn't introduce performace penalty on 32-bit platforms
> - provides 64-bit resolution on 64-bit platforms with virtually no
>   preformance penalty
> 
> Signed-off-by: Alexander Sverdlin <alexander.sverdlin@siemens.com>

I've noticed that the patch has been marked as "Changes Requested" in
the patchwork, could it be a mistake? Because I never received any
change request.

> ---
>  drivers/counter/interrupt-cnt.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/counter/interrupt-cnt.c b/drivers/counter/interrupt-cnt.c
> index 949598d51575a..8df5457b0a076 100644
> --- a/drivers/counter/interrupt-cnt.c
> +++ b/drivers/counter/interrupt-cnt.c
> @@ -15,7 +15,7 @@
>  #define INTERRUPT_CNT_NAME "interrupt-cnt"
>  
>  struct interrupt_cnt_priv {
> -	atomic_t count;
> +	atomic_long_t count;
>  	struct gpio_desc *gpio;
>  	int irq;
>  	bool enabled;
> @@ -29,7 +29,7 @@ static irqreturn_t interrupt_cnt_isr(int irq, void *dev_id)
>  	struct counter_device *counter = dev_id;
>  	struct interrupt_cnt_priv *priv = counter_priv(counter);
>  
> -	atomic_inc(&priv->count);
> +	atomic_long_inc(&priv->count);
>  
>  	counter_push_event(counter, COUNTER_EVENT_CHANGE_OF_STATE, 0);
>  
> @@ -89,7 +89,7 @@ static int interrupt_cnt_read(struct counter_device *counter,
>  {
>  	struct interrupt_cnt_priv *priv = counter_priv(counter);
>  
> -	*val = atomic_read(&priv->count);
> +	*val = atomic_long_read(&priv->count);
>  
>  	return 0;
>  }
> @@ -102,7 +102,7 @@ static int interrupt_cnt_write(struct counter_device *counter,
>  	if (val != (typeof(priv->count.counter))val)
>  		return -ERANGE;
>  
> -	atomic_set(&priv->count, val);
> +	atomic_long_set(&priv->count, val);
>  
>  	return 0;
>  }

-- 
Alexander Sverdlin
Siemens AG
www.siemens.com

  reply	other threads:[~2025-05-02  9:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-31 15:22 A. Sverdlin
2025-05-02  9:24 ` Sverdlin, Alexander [this message]
2025-05-02 12:19   ` Oleksij Rempel
2025-05-05 12:04   ` Jonathan Cameron
2025-05-02 15:11 ` William Breathitt Gray

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=91c00e75bc25267d57863494d638f0a43e499ac4.camel@siemens.com \
    --to=alexander.sverdlin@siemens.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=wbg@kernel.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®