[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c6c7ddb2730611e5877240de033f5af3263fae0b.camel@xry111.site>
Date: Thu, 05 Sep 2024 19:58:15 +0800
From: Xi Ruoyao <xry111@...111.site>
To: Uros Bizjak <ubizjak@...il.com>
Cc: Huacai Chen <chenhuacai@...nel.org>, loongarch@...ts.linux.dev,
linux-kernel@...r.kernel.org, WANG Xuerui <kernel@...0n.name>, Thomas
Gleixner <tglx@...utronix.de>
Subject: Re: [PATCH v3] LoongArch/percpu: Simplify _percpu_read() and
_percpu_write()
On Thu, 2024-09-05 at 19:47 +0800, Huacai Chen wrote:
> > +#define _percpu_write(size, _pcp, _val) \
> > +do { \
> > + unsigned long __pcp_val = __pcpu_cast_##size(_val); \
> > + \
> > + if (0) { \
> > + typeof(_pcp) pto_tmp__; \
> > + pto_tmp__ = (_val); \
> > + (void)pto_tmp__; \
> > + } \
> Emmm, in V2 I just confirm that whether it is worth to use macro
> instead of inline functions, I think we don't really need such a
> checking here. :)
It's still (slighly) better (just from aesthetics view) to use inline
function instead of macro. Is it possible to clear the header
dependency and break the circle so we can still use __percpu in arch
percpu.h instead?
(Simply removing __percpu from the function parameter list causes many
warnings with make C=1.)
--
Xi Ruoyao <xry111@...111.site>
School of Aerospace Science and Technology, Xidian University
Powered by blists - more mailing lists