From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Mon, 21 Sep 2020 19:32:00 +0800 From: "Meng, Fino" Subject: Re: [PATCH 3/4] cobalt/kernel: fix compile error for incompatible pointer type Message-ID: <20200921113200.GA18970@linux.intel.com> References: <20200918063234.8557-1-fino.meng@linux.intel.com> <96436f26-007a-41ee-17c6-247a17faa8c0@siemens.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <96436f26-007a-41ee-17c6-247a17faa8c0@siemens.com> List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: xenomai@xenomai.org On Fri, Sep 18, 2020 at 03:05:28PM +0200, Jan Kiszka wrote: > > > On 18.09.20 08:32, Fino Meng wrote: > > Signed-off-by: Fino Meng > > Signed-off-by: Mingliang Hu > > --- > > include/cobalt/kernel/stat.h | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/include/cobalt/kernel/stat.h b/include/cobalt/kernel/stat.h > > index b857cd19f..be529ad72 100644 > > --- a/include/cobalt/kernel/stat.h > > +++ b/include/cobalt/kernel/stat.h > > @@ -58,7 +58,7 @@ do { \ > > #define xnstat_exectime_set_current(sched, new_account) \ > > ({ \ > > xnstat_exectime_t *__prev; \ > > - __prev = (xnstat_exectime_t *)atomic_long_xchg(&(sched)->current_account, (long)(new_account)); \ > > + __prev = (xnstat_exectime_t *)atomic_long_xchg((atomic_long_t *)&(sched)->current_account, (long)(new_account)); \ > > Which upstream change made this necessary? Was the issue hidden behind too > relaxed compiler warnings, or was there a real type change? If the latter, > why is that cast OK? > > Jan due to this commit, atomic_long_xchg lost the force type conversion in macro: commit b5d47ef9ea5c5fe31d7eabeb79f697629bd9e2cb Refs: v4.19-rc6-94-gb5d47ef9ea5c Author: Mark Rutland AuthorDate: Tue Sep 4 11:48:27 2018 +0100 Commit: Ingo Molnar CommitDate: Thu Nov 1 11:00:55 2018 +0100 locking/atomics: Switch to generated atomic-long As a step towards ensuring the atomic* APIs are consistent, let's switch to wrappers generated by gen-atomic-long.h, using the same table that gen-atomic-fallbacks.h uses to fill in gaps in the atomic_* and atomic64_* APIs. ... include/asm-generic/atomic-long.h in 4.19 kernel: #define atomic_long_xchg(v, new) \ (ATOMIC_LONG_PFX(_xchg)((ATOMIC_LONG_PFX(_t) *)(v), (new))) #define ATOMIC_LONG_PFX(x) atomic ## x in 5.4 kernel: static inline long atomic_long_xchg(atomic_long_t *v, long i) { return atomic_xchg(v, i); } BR fino > > > __prev; \ > > }) > > > > -- > Siemens AG, Corporate Technology, CT RDA IOT SES-DE > Corporate Competence Center Embedded Linux