Thread (41 messages) 41 messages, 10 authors, 2023-02-15

Re: [Intel-gfx] [RFC DO NOT MERGE] treewide: use __xchg in most obvious places

From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Date: 2023-01-10 13:54:23
Also in: dri-devel, intel-gfx, linux-alpha, linux-arm-kernel, linux-m68k, linux-mips, linux-riscv, linux-s390, linux-sh, lkml, loongarch, sparclinux

On Tue, Jan 10, 2023 at 01:46:37PM +0100, Andrzej Hajda wrote:
On 10.01.2023 12:07, Andy Shevchenko wrote:
quoted
On Tue, Jan 10, 2023 at 11:53:06AM +0100, Andrzej Hajda wrote:
...
quoted
quoted
+	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
...
quoted
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

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help