From patchwork Wed Aug 14 23:16:42 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zach Brown X-Patchwork-Id: 2844894 Return-Path: X-Original-To: patchwork-linux-btrfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B81DB9F239 for ; Wed, 14 Aug 2013 23:17:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EB1F1206D2 for ; Wed, 14 Aug 2013 23:17:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 11E21206D0 for ; Wed, 14 Aug 2013 23:17:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933235Ab3HNXRh (ORCPT ); Wed, 14 Aug 2013 19:17:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:16571 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933416Ab3HNXRX (ORCPT ); Wed, 14 Aug 2013 19:17:23 -0400 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r7ENHNe5014658 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 14 Aug 2013 19:17:23 -0400 Received: from lenny.home.zabbo.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id r7ENHKSv017824 for ; Wed, 14 Aug 2013 19:17:23 -0400 From: Zach Brown To: linux-btrfs@vger.kernel.org Subject: [PATCH 12/15] btrfs-progs: fix unaligned compat endian warnings Date: Wed, 14 Aug 2013 16:16:42 -0700 Message-Id: <1376522205-16992-13-git-send-email-zab@redhat.com> In-Reply-To: <1376522205-16992-1-git-send-email-zab@redhat.com> References: <1376522205-16992-1-git-send-email-zab@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.11 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Spam-Status: No, score=-9.7 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The _una_ struct's entire job is to pass an argument to le*_to_cpu. So it's a little embarassing that it uses a native cpu types and generates endian warnings. ctree.h:1616:1: warning: incorrect type in assignment (different base types) ctree.h:1616:1: expected unsigned long long [unsigned] [usertype] x ctree.h:1616:1: got restricted __le64 [usertype] Signed-off-by: Zach Brown --- kerncompat.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/kerncompat.h b/kerncompat.h index 4d78288..1fc2b34 100644 --- a/kerncompat.h +++ b/kerncompat.h @@ -277,9 +277,9 @@ typedef u64 __bitwise __be64; #define le16_to_cpu(x) ((__force u16)(__le16)(x)) #endif -struct __una_u16 { u16 x; } __attribute__((__packed__)); -struct __una_u32 { u32 x; } __attribute__((__packed__)); -struct __una_u64 { u64 x; } __attribute__((__packed__)); +struct __una_u16 { __le16 x; } __attribute__((__packed__)); +struct __una_u32 { __le32 x; } __attribute__((__packed__)); +struct __una_u64 { __le64 x; } __attribute__((__packed__)); #define get_unaligned_le8(p) (*((u8 *)(p))) #define put_unaligned_le8(val,p) ((*((u8 *)(p))) = (val))