[PATCH 5/7] sunrpc: clean up sparse endianness warnings in gss_krb5_seal.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



KG2_TOK_MIC is a "palindrome" so byte swapping is a no-op here.

Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxxxxxxx>
---
 net/sunrpc/auth_gss/gss_krb5_seal.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/sunrpc/auth_gss/gss_krb5_seal.c b/net/sunrpc/auth_gss/gss_krb5_seal.c
index 94ad57ff7169..3cf49ea54ca9 100644
--- a/net/sunrpc/auth_gss/gss_krb5_seal.c
+++ b/net/sunrpc/auth_gss/gss_krb5_seal.c
@@ -106,13 +106,13 @@ setup_token_v2(struct krb5_ctx *ctx, struct xdr_netobj *token)
 	 * just start the token */
 	krb5_hdr = ptr = (__be16 *)token->data;
 
-	*ptr++ = KG2_TOK_MIC;
+	*ptr++ = cpu_to_be16(KG2_TOK_MIC);
 	p = (u8 *)ptr;
 	*p++ = flags;
 	*p++ = 0xff;
 	ptr = (__be16 *)p;
-	*ptr++ = 0xffff;
-	*ptr++ = 0xffff;
+	*ptr++ = cpu_to_be16(0xffff);
+	*ptr++ = cpu_to_be16(0xffff);
 
 	token->len = GSS_KRB5_TOK_HDR_LEN + ctx->gk5e->cksumlength;
 	return krb5_hdr;
@@ -181,7 +181,7 @@ gss_get_mic_v2(struct krb5_ctx *ctx, struct xdr_buf *text,
 	spin_lock(&krb5_seq_lock);
 	seq_send = ctx->seq_send64++;
 	spin_unlock(&krb5_seq_lock);
-	*((u64 *)(krb5_hdr + 8)) = cpu_to_be64(seq_send);
+	*((__be64 *)(krb5_hdr + 8)) = cpu_to_be64(seq_send);
 
 	if (ctx->initiate) {
 		cksumkey = ctx->initiator_sign;
-- 
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux