mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <sha@pengutronix.de>
To: Ahmad Fatoum <a.fatoum@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/2] include: asm-generic/atomic.h: always define atomic/atomic_64
Date: Thu, 21 Sep 2023 14:11:51 +0200	[thread overview]
Message-ID: <20230921121151.GM637806@pengutronix.de> (raw)
In-Reply-To: <20230921094354.265824-1-a.fatoum@pengutronix.de>

On Thu, Sep 21, 2023 at 11:43:53AM +0200, Ahmad Fatoum wrote:
> 64-bit accesses are always atomic in barebox, because we have nothing
> that would interrupt them. Thus define them unconditionally in the
> asm-generic header. This shows that an include for the s64 time is
> missing, so add that as well.
> 
> Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
> ---
>  include/asm-generic/atomic.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/include/asm-generic/atomic.h b/include/asm-generic/atomic.h
> index 45fc5da57594..27b0f73b487b 100644
> --- a/include/asm-generic/atomic.h
> +++ b/include/asm-generic/atomic.h
> @@ -8,12 +8,13 @@
>  #ifndef __ASM_GENERIC_ATOMIC_H
>  #define __ASM_GENERIC_ATOMIC_H
>  
> +#include <linux/types.h>
> +
>  #ifdef CONFIG_SMP
>  #error SMP not supported
>  #endif
>  #define ATOMIC_INIT(i)	{ (i) }
>  
> -#ifdef CONFIG_64BIT
>  typedef struct { s64 counter; } atomic64_t;
>  
>  #define atomic64_read(v)	((v)->counter)
> @@ -59,7 +60,7 @@ static inline int atomic64_add_negative(s64 i, volatile atomic64_t *v)
>  	return val < 0;
>  }
>  
> -#else
> +
>  typedef struct { volatile int counter; } atomic_t;
>  
>  #define ATOMIC_INIT(i)	{ (i) }
> @@ -114,7 +115,6 @@ static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
>  {
>  	*addr &= ~mask;
>  }
> -#endif
>  
>  /* Atomic operations are already serializing on ARM */
>  #define smp_mb__before_atomic_dec()	barrier()
> -- 
> 2.39.2
> 
> 
> 

-- 
Pengutronix e.K.                           |                             |
Steuerwalder Str. 21                       | http://www.pengutronix.de/  |
31137 Hildesheim, Germany                  | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



      parent reply	other threads:[~2023-09-21 12:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-21  9:43 Ahmad Fatoum
2023-09-21  9:43 ` [PATCH 2/2] include: add linux/atomic.h header Ahmad Fatoum
2023-09-21 12:11 ` Sascha Hauer [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=20230921121151.GM637806@pengutronix.de \
    --to=sha@pengutronix.de \
    --cc=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.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