linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Jeff Layton <jeff.layton@primarydata.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	trond.myklebust@primarydata.com, bfields@fieldses.org,
	linux-nfs@vger.kernel.org
Subject: Re: [PATCH 6/7] sunrpc: clean up sparse endianness warnings in gss_krb5_wrap.c
Date: Wed, 16 Jul 2014 01:13:32 -0700	[thread overview]
Message-ID: <20140716081332.GD29924@infradead.org> (raw)
In-Reply-To: <20140715133614.38361d58@tlielax.poochiereds.net>

On Tue, Jul 15, 2014 at 01:36:14PM -0400, Jeff Layton wrote:
> > >  
> > > +	*(__be16 *)(ptr + 2) = (__force __be16)cpu_to_le16(kctx->gk5e->signalg);
> > 
> > This looks silly.  This should be:
> > 
> > 	*(__le16 *)(ptr + 2) = cpu_to_le16(kctx->gk5e->signalg);
> > 
> > Maybe with a comment somewhere explaining why we're doing little endian
> > encoding here if it's not obvious from the surrounding code.
> > 
> 
> The spec doesn't really define these as little-endian values, it's just
> an opaque series of bytes that the kernel implementation happens to
> handle as little-endian (see RFC 1964, section 1.2.1). Maybe I should
> reverse the bytes and we can just make that cpu_to_be16 instead?

Sounds okay to me.

> So the code is correct, AFAICT -- it's just odd...

It might be correct, but with the added cast it's simply too ugly to
live.


  reply	other threads:[~2014-07-16  8:13 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-14  1:57 [PATCH 0/7] sunrpc: sparse warning cleanups Jeff Layton
2014-07-14  1:57 ` [PATCH 1/7] sunrpc: remove __rcu annotation from struct gss_cl_ctx->gc_gss_ctx Jeff Layton
2014-07-14 14:23   ` Arnd Bergmann
2014-07-14 15:02     ` Jeff Layton
2014-07-14 15:29       ` Arnd Bergmann
2014-07-14  1:57 ` [PATCH 2/7] sunrpc: fix RCU handling of gc_ctx field Jeff Layton
2014-07-14  1:57 ` [PATCH 3/7] sunrpc: clean up endianness warnings in setup_token Jeff Layton
2014-07-15 17:08   ` Christoph Hellwig
2014-07-15 17:32     ` Jeff Layton
2014-07-14  1:57 ` [PATCH 4/7] sunrpc: xdr_get_next_encode_buffer can be static Jeff Layton
2014-07-15 17:02   ` Christoph Hellwig
2014-07-15 17:17     ` Jeff Layton
2014-07-14  1:57 ` [PATCH 5/7] sunrpc: clean up sparse endianness warnings in gss_krb5_seal.c Jeff Layton
2014-07-15 17:03   ` Christoph Hellwig
2014-07-14  1:57 ` [PATCH 6/7] sunrpc: clean up sparse endianness warnings in gss_krb5_wrap.c Jeff Layton
2014-07-15 17:04   ` Christoph Hellwig
2014-07-15 17:36     ` Jeff Layton
2014-07-16  8:13       ` Christoph Hellwig [this message]
2014-07-14  1:57 ` [PATCH 7/7] sunrpc: remove "ec" argument from encrypt_v2 operation Jeff Layton
2014-07-15 17:05   ` Christoph Hellwig
2014-07-15 17:33     ` Jeff Layton
2014-07-16 10:52 ` [PATCH v2 0/5] sunrpc: sparse warning cleanups Jeff Layton
2014-07-16 10:52   ` [PATCH v2 1/5] sunrpc: remove __rcu annotation from struct gss_cl_ctx->gc_gss_ctx Jeff Layton
2014-07-16 10:52   ` [PATCH v2 2/5] sunrpc: fix RCU handling of gc_ctx field Jeff Layton
2014-07-16 10:52   ` [PATCH v2 3/5] sunrpc: clean up sparse endianness warnings in gss_krb5_seal.c Jeff Layton
2014-07-16 10:52   ` [PATCH v2 4/5] sunrpc: clean up sparse endianness warnings in gss_krb5_wrap.c Jeff Layton
2014-07-16 10:52   ` [PATCH v2 5/5] sunrpc: remove "ec" argument from encrypt_v2 operation Jeff Layton
2014-07-30 17:56   ` [PATCH v2 0/5] sunrpc: sparse warning cleanups Jeff Layton

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=20140716081332.GD29924@infradead.org \
    --to=hch@infradead.org \
    --cc=bfields@fieldses.org \
    --cc=jeff.layton@primarydata.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@primarydata.com \
    /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).