* [PATCH] powerpc: Remove duplicate definition for ppc_msgsnd_sync()
@ 2025-08-13 12:23 Gautam Menghani
2025-08-19 3:20 ` Ritesh Harjani
0 siblings, 1 reply; 2+ messages in thread
From: Gautam Menghani @ 2025-08-13 12:23 UTC (permalink / raw)
To: maddy, mpe, npiggin, christophe.leroy
Cc: Gautam Menghani, linuxppc-dev, linux-kernel
Remove duplicate definition of ppc_msgsnd_sync() introduced in commit
b87ac0218355 ('powerpc: Introduce msgsnd/doorbell barrier primitives').
No functional change intended.
Signed-off-by: Gautam Menghani <gautam@linux.ibm.com>
---
arch/powerpc/include/asm/dbell.h | 18 ++++++------------
1 file changed, 6 insertions(+), 12 deletions(-)
diff --git a/arch/powerpc/include/asm/dbell.h b/arch/powerpc/include/asm/dbell.h
index 3e9da22a2779..0b9ef726f92c 100644
--- a/arch/powerpc/include/asm/dbell.h
+++ b/arch/powerpc/include/asm/dbell.h
@@ -40,12 +40,6 @@ static inline void _ppc_msgsnd(u32 msg)
: : "i" (CPU_FTR_HVMODE), "r" (msg));
}
-/* sync before sending message */
-static inline void ppc_msgsnd_sync(void)
-{
- __asm__ __volatile__ ("sync" : : : "memory");
-}
-
/* sync after taking message interrupt */
static inline void ppc_msgsync(void)
{
@@ -76,12 +70,6 @@ static inline void _ppc_msgsnd(u32 msg)
__asm__ __volatile__ (PPC_MSGSND(%0) : : "r" (msg));
}
-/* sync before sending message */
-static inline void ppc_msgsnd_sync(void)
-{
- __asm__ __volatile__ ("sync" : : : "memory");
-}
-
/* sync after taking message interrupt */
static inline void ppc_msgsync(void)
{
@@ -91,6 +79,12 @@ static inline void ppc_msgsync(void)
extern void doorbell_exception(struct pt_regs *regs);
+/* sync before sending message */
+static inline void ppc_msgsnd_sync(void)
+{
+ __asm__ __volatile__ ("sync" : : : "memory");
+}
+
static inline void ppc_msgsnd(enum ppc_dbell type, u32 flags, u32 tag)
{
u32 msg = PPC_DBELL_TYPE(type) | (flags & PPC_DBELL_MSG_BRDCAST) |
--
2.50.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] powerpc: Remove duplicate definition for ppc_msgsnd_sync()
2025-08-13 12:23 [PATCH] powerpc: Remove duplicate definition for ppc_msgsnd_sync() Gautam Menghani
@ 2025-08-19 3:20 ` Ritesh Harjani
0 siblings, 0 replies; 2+ messages in thread
From: Ritesh Harjani @ 2025-08-19 3:20 UTC (permalink / raw)
To: Gautam Menghani, maddy, mpe, npiggin, christophe.leroy
Cc: Gautam Menghani, linuxppc-dev, linux-kernel
Gautam Menghani <gautam@linux.ibm.com> writes:
> Remove duplicate definition of ppc_msgsnd_sync() introduced in commit
> b87ac0218355 ('powerpc: Introduce msgsnd/doorbell barrier primitives').
>
> No functional change intended.
>
Earlier this function was duplicated at 2 places i.e. in
#ifdef CONFIG_PPC_BOOK3S and #else block. This patch takes those
duplicate definitions out and move it to a common place.
BTW, there is nothing sndmsg specific in this, so this could be open
coded as well. But as far as this patch is concerned, it looks good.
So please feel free to add:
Reviewed-by: Ritesh Harjani (IBM) <riteshh@linux.ibm.com>
> Signed-off-by: Gautam Menghani <gautam@linux.ibm.com>
> ---
> arch/powerpc/include/asm/dbell.h | 18 ++++++------------
> 1 file changed, 6 insertions(+), 12 deletions(-)
>
> diff --git a/arch/powerpc/include/asm/dbell.h b/arch/powerpc/include/asm/dbell.h
> index 3e9da22a2779..0b9ef726f92c 100644
> --- a/arch/powerpc/include/asm/dbell.h
> +++ b/arch/powerpc/include/asm/dbell.h
> @@ -40,12 +40,6 @@ static inline void _ppc_msgsnd(u32 msg)
> : : "i" (CPU_FTR_HVMODE), "r" (msg));
> }
>
> -/* sync before sending message */
> -static inline void ppc_msgsnd_sync(void)
> -{
> - __asm__ __volatile__ ("sync" : : : "memory");
> -}
> -
> /* sync after taking message interrupt */
> static inline void ppc_msgsync(void)
> {
> @@ -76,12 +70,6 @@ static inline void _ppc_msgsnd(u32 msg)
> __asm__ __volatile__ (PPC_MSGSND(%0) : : "r" (msg));
> }
>
> -/* sync before sending message */
> -static inline void ppc_msgsnd_sync(void)
> -{
> - __asm__ __volatile__ ("sync" : : : "memory");
> -}
> -
> /* sync after taking message interrupt */
> static inline void ppc_msgsync(void)
> {
> @@ -91,6 +79,12 @@ static inline void ppc_msgsync(void)
>
> extern void doorbell_exception(struct pt_regs *regs);
>
> +/* sync before sending message */
> +static inline void ppc_msgsnd_sync(void)
> +{
> + __asm__ __volatile__ ("sync" : : : "memory");
> +}
> +
> static inline void ppc_msgsnd(enum ppc_dbell type, u32 flags, u32 tag)
> {
> u32 msg = PPC_DBELL_TYPE(type) | (flags & PPC_DBELL_MSG_BRDCAST) |
> --
> 2.50.1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-08-19 3:36 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-13 12:23 [PATCH] powerpc: Remove duplicate definition for ppc_msgsnd_sync() Gautam Menghani
2025-08-19 3:20 ` Ritesh Harjani
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).