Re: [Intel-gfx] [RFC DO NOT MERGE] treewide: use __xchg in most obvious places
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Andrzej Hajda <andrzej.hajda@xxxxxxxxx>
- Subject: Re: [Intel-gfx] [RFC DO NOT MERGE] treewide: use __xchg in most obvious places
- From: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
- Date: Tue, 10 Jan 2023 15:52:20 +0200
- Cc: Mark Rutland <mark.rutland@xxxxxxx>, linux-ia64@xxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, dri-devel@xxxxxxxxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, linux-riscv@xxxxxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-hexagon@xxxxxxxxxxxxxxx, linux-snps-arc@xxxxxxxxxxxxxxxxxxx, Boqun Feng <boqun.feng@xxxxxxxxx>, linux-xtensa@xxxxxxxxxxxxxxxx, Arnd Bergmann <arnd@xxxxxxxx>, intel-gfx@xxxxxxxxxxxxxxxxxxxxx, linux-m68k@xxxxxxxxxxxxxxx, openrisc@xxxxxxxxxxxxxxxxxxxx, loongarch@xxxxxxxxxxxxxxx, Rodrigo Vivi <rodrigo.vivi@xxxxxxxxx>, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, Daniel Vetter <daniel@xxxxxxxx>, linux-alpha@xxxxxxxxxxxxxxx, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, linuxppc-dev@xxxxxxxxxxxxxxxx
- In-reply-to: <1bfae3d0-8c0b-ea83-7184-db847a4a969f@intel.com>
- Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo
- References: <Y7b6/7coJEVlTVxK@phenom.ffwll.local> <20230110105306.3973122-1-andrzej.hajda@intel.com> <Y71G1tkmUzM4BLxn@smile.fi.intel.com> <1bfae3d0-8c0b-ea83-7184-db847a4a969f@intel.com>
On Tue, Jan 10, 2023 at 01:46:37PM +0100, Andrzej Hajda wrote:
> On 10.01.2023 12:07, Andy Shevchenko wrote:
> > On Tue, Jan 10, 2023 at 11:53:06AM +0100, Andrzej Hajda wrote:
...
> > > + return __xchg(&p_chain->p_prod_elem,
> > > + (void *)(((u8 *)p_chain->p_prod_elem) + p_chain->elem_size));
> >
> > Wondering if you still need a (void *) casting after the change. Ditto for the
> > rest of similar cases.
>
> IMHO it is not needed also before the change and IIRC gcc has an extension
> which allows to drop (u8 *) cast as well [1].
I guess you can drop at least the former one.
> [1]: https://gcc.gnu.org/onlinedocs/gcc/Pointer-Arith.html
...
> > Btw, is it done by coccinelle? If no, why not providing the script?
>
> Yes I have used cocci. My cocci skills are far from perfect, so I did not
> want to share my dirty code, but this is nothing secret:
Thank you! It's not about secrecy, it's about automation / error proofness.
--
With Best Regards,
Andy Shevchenko
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]