From patchwork Thu Mar 16 03:18:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qu Wenruo X-Patchwork-Id: 9627025 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8BC0660522 for ; Thu, 16 Mar 2017 03:18:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 822DE28506 for ; Thu, 16 Mar 2017 03:18:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 766D02863E; Thu, 16 Mar 2017 03:18:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0A58285B5 for ; Thu, 16 Mar 2017 03:18:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751374AbdCPDSr (ORCPT ); Wed, 15 Mar 2017 23:18:47 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:13989 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1750885AbdCPDSp (ORCPT ); Wed, 15 Mar 2017 23:18:45 -0400 X-IronPort-AV: E=Sophos;i="5.22,518,1449504000"; d="scan'208";a="16632987" Received: from unknown (HELO cn.fujitsu.com) ([10.167.33.5]) by heian.cn.fujitsu.com with ESMTP; 16 Mar 2017 11:18:37 +0800 Received: from G08CNEXCHPEKD01.g08.fujitsu.local (unknown [10.167.33.80]) by cn.fujitsu.com (Postfix) with ESMTP id ACBFF49F9A64; Thu, 16 Mar 2017 11:18:37 +0800 (CST) Received: from localhost.localdomain (10.167.226.34) by G08CNEXCHPEKD01.g08.fujitsu.local (10.167.33.89) with Microsoft SMTP Server (TLS) id 14.3.319.2; Thu, 16 Mar 2017 11:18:36 +0800 From: Qu Wenruo To: CC: Subject: [PATCH 1/2] btrfs-progs: kerncompat: Fix re-definition of __bitwise Date: Thu, 16 Mar 2017 11:18:30 +0800 Message-ID: <20170316031831.28006-1-quwenruo@cn.fujitsu.com> X-Mailer: git-send-email 2.12.0 MIME-Version: 1.0 X-Originating-IP: [10.167.226.34] X-yoursite-MailScanner-ID: ACBFF49F9A64.A1616 X-yoursite-MailScanner: Found to be clean X-yoursite-MailScanner-From: quwenruo@cn.fujitsu.com Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In latest linux api headers, __bitwise is already defined in /usr/include/linux/types.h. So kerncompat.h will re-define __bitwise, and cause gcc warning. Fix it by checking if __bitwise is already define. Signed-off-by: Qu Wenruo --- The patch is based on devel branch with the following head: commit 64abe9f619b614e589339046b6c45dfb8fa8e2a9 Author: David Sterba Date: Wed Mar 15 12:28:16 2017 +0100 btrfs-progs: tests: misc/019, use fssum --- kerncompat.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kerncompat.h b/kerncompat.h index 958bea43..fa96715f 100644 --- a/kerncompat.h +++ b/kerncompat.h @@ -317,11 +317,13 @@ static inline void assert_trace(const char *assertion, const char *filename, #define container_of(ptr, type, member) ({ \ const typeof( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type,member) );}) +#ifndef __bitwise #ifdef __CHECKER__ #define __bitwise __bitwise__ #else #define __bitwise -#endif +#endif /* __CHECKER__ */ +#endif /* __bitwise */ /* Alignment check */ #define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)