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:   Thu, 14 Mar 2019 03:03:18 -0500
From:   Steve French <smfrench@...il.com>
To:     Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
Cc:     Steve French <sfrench@...ba.org>,
        CIFS <linux-cifs@...r.kernel.org>,
        samba-technical <samba-technical@...ts.samba.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Sergey Senozhatsky <sergey.senozhatsky@...il.com>
Subject: Re: [PATCH 1/2] cifs: remove unused status severity defines

I am fine with taking a patch to get rid of __constant_cpu_to_XXX
(and converting to the same cpu_to_XXX with the "__constant")  in
fs/cifs  (assuming that that is still recommended).

On Thu, Mar 14, 2019 at 2:39 AM Sergey Senozhatsky
<sergey.senozhatsky.work@...il.com> wrote:
>
> On (03/14/19 02:19), Steve French wrote:
> > All of those uses of __constant_cpu_to_le32 apparently (at least
> > according to checkpatch) should be changed (someday) to cpu_to_le32
> > but I didn't research why the change from __constant_cpu_to_le32
> > --->   cpu_to_le32
>
> Probably historic reasons.
>
> Looking at linux 2.4.21
>
> /*
>  * Allow constant folding
>  */
> #if defined(__GNUC__) && (__GNUC__ >= 2) && defined(__OPTIMIZE__)
> #  define __swahw32(x) \
> (__builtin_constant_p((__u32)(x)) ? \
>  ___swahw32((x)) : \
>  __fswahw32((x)))
>
>
> My assumption would be that __GNUC__ < 2 did no support
> __builtin_constant_p?
>
>
> > If it has benefit - and checkpatch is right (it warned about
> > __constant_cpu_to_le32 being no longer preferred) ... perhaps would be
> > worth a followup patch to clean the rest of them up?   If you have any
> > context on why kernel code has moved away from using the older format
> > of __constant_cpu_to_.... would be useful to know if any benefit to
> > the change
>
> Right, that's what I'm going to do - send out patches and update the rest
> of __constant_cpu_to_XX users; so, eventually, __constant_cpu_to_XX
> can be removed.
>
>         -ss



-- 
Thanks,

Steve

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ