[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190314073954.GA5272@jagdpanzerIV>
Date: Thu, 14 Mar 2019 16:39:54 +0900
From: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
To: Steve French <smfrench@...il.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
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
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
Powered by blists - more mailing lists