linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steve French <smfrench@gmail.com>
To: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Steve French <sfrench@samba.org>,
	CIFS <linux-cifs@vger.kernel.org>,
	samba-technical <samba-technical@lists.samba.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Subject: Re: [PATCH 1/2] cifs: remove unused status severity defines
Date: Thu, 14 Mar 2019 03:03:18 -0500	[thread overview]
Message-ID: <CAH2r5msU25CMDfTON2fSTpg5tmt7O_2sguFDL96b=vys5u+ViQ@mail.gmail.com> (raw)
In-Reply-To: <20190314073954.GA5272@jagdpanzerIV>

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@gmail.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

  reply	other threads:[~2019-03-14  8:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-14  6:17 [PATCH 1/2] cifs: remove unused status severity defines Sergey Senozhatsky
2019-03-14  6:17 ` [PATCH 2/2] cifs: don't use __constant_cpu_to_le32() Sergey Senozhatsky
2019-03-15 12:31   ` David Laight
2019-03-15 14:29     ` Sergey Senozhatsky
2019-03-14  6:54 ` [PATCH 1/2] cifs: remove unused status severity defines Steve French
2019-03-14  7:04   ` Steve French
2019-03-14  7:12     ` Sergey Senozhatsky
2019-03-14  7:19       ` Steve French
2019-03-14  7:39         ` Sergey Senozhatsky
2019-03-14  8:03           ` Steve French [this message]
2019-03-14  7:08   ` Sergey Senozhatsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH2r5msU25CMDfTON2fSTpg5tmt7O_2sguFDL96b=vys5u+ViQ@mail.gmail.com' \
    --to=smfrench@gmail.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=samba-technical@lists.samba.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=sfrench@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).