lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 10 Jan 2023 15:52:20 +0200
From:   Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To:     Andrzej Hajda <andrzej.hajda@...el.com>
Cc:     Mark Rutland <mark.rutland@....com>, linux-ia64@...r.kernel.org,
        linux-sh@...r.kernel.org, Peter Zijlstra <peterz@...radead.org>,
        dri-devel@...ts.freedesktop.org, linux-mips@...r.kernel.org,
        sparclinux@...r.kernel.org, linux-riscv@...ts.infradead.org,
        linux-s390@...r.kernel.org, linux-hexagon@...r.kernel.org,
        linux-snps-arc@...ts.infradead.org,
        Boqun Feng <boqun.feng@...il.com>,
        linux-xtensa@...ux-xtensa.org, Arnd Bergmann <arnd@...db.de>,
        intel-gfx@...ts.freedesktop.org, linux-m68k@...ts.linux-m68k.org,
        openrisc@...ts.librecores.org, loongarch@...ts.linux.dev,
        Rodrigo Vivi <rodrigo.vivi@...el.com>,
        linux-arm-kernel@...ts.infradead.org, linux-parisc@...r.kernel.org,
        linux-kernel@...r.kernel.org, Daniel Vetter <daniel@...ll.ch>,
        linux-alpha@...r.kernel.org,
        Andrew Morton <akpm@...ux-foundation.org>,
        linuxppc-dev@...ts.ozlabs.org
Subject: Re: [Intel-gfx] [RFC DO NOT MERGE] treewide: use __xchg in most
 obvious places

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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ