From patchwork Fri Sep 15 12:37:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Beniamino Galvani X-Patchwork-Id: 814258 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=65.50.211.133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fdoKvgTE"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xtw1L6CH6z9s7C for ; Fri, 15 Sep 2017 22:38:30 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=Aby3iXr0IduN52ARR98slvtUt9cMoPg2d4Bc4bMsqGE=; b=fdo KvgTEl2VGrCjTeWMP0iEPCzZWjW1W8uUzlU8Ii6MlCfmToDKy8CXED34MjFKbb/vkfTR0KVaPXRV3 XbTV9vzeMpQafp19P7RuuVetjDqsxum76fUsJ/IQEjicu2oU1Uk3/cmgwZAsRhd/7ymd815qZGEtS pUYU09KeAyWTnDuttvjHLFziQaUrejJoarZ75mbaS+zCDo+MgMlLaOvF8sbP2IQWiVbEtygBrta9V nRcoUGiJVWu+rp9rsRE6HcZR9orcGUPUwmJYd864QFtM4ocHjD/ub7r6XMtEZbdz6SlrXZloMEB9v uPJQVc6knhirpA15z08qOJd9SPr8m6A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dspsZ-0003VK-Bc; Fri, 15 Sep 2017 12:37:55 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dspsA-0003HE-5R for hostap@lists.infradead.org; Fri, 15 Sep 2017 12:37:32 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B99B2883CE for ; Fri, 15 Sep 2017 12:37:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B99B2883CE Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=bgalvani@redhat.com Received: from tp.redhat.com (ovpn-116-92.ams2.redhat.com [10.36.116.92]) by smtp.corp.redhat.com (Postfix) with ESMTP id DE4306B6CB; Fri, 15 Sep 2017 12:37:08 +0000 (UTC) From: Beniamino Galvani To: hostap@lists.infradead.org Subject: [PATCH] common: avoid conflict with __bitwise and __force from linux/types.h Date: Fri, 15 Sep 2017 14:37:00 +0200 Message-Id: <20170915123700.15890-1-bgalvani@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Fri, 15 Sep 2017 12:37:09 +0000 (UTC) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170915_053730_264142_B78D913D X-CRM114-Status: UNSURE ( 8.91 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -6.9 (------) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-6.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [209.132.183.28 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Beniamino Galvani MIME-Version: 1.0 Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Namespace the __bitwise and __force macros so that they don't conflict with the ones from linux/types.h: In file included from ../src/l2_packet/l2_packet_linux.c:15:0: hostap/src/utils/common.h:438:0: warning: "__bitwise" redefined #define __bitwise In file included from /usr/include/linux/filter.h:9:0, from ../src/l2_packet/l2_packet_linux.c:13: /usr/include/linux/types.h:21:0: note: this is the location of the previous definition #define __bitwise __bitwise__ Signed-off-by: Beniamino Galvani --- src/utils/common.h | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/src/utils/common.h b/src/utils/common.h index 46e96a65b..bc0633484 100644 --- a/src/utils/common.h +++ b/src/utils/common.h @@ -171,18 +171,18 @@ static inline unsigned int wpa_swap_32(unsigned int v) #endif /* __BYTE_ORDER */ #if __BYTE_ORDER == __LITTLE_ENDIAN -#define le_to_host16(n) ((__force u16) (le16) (n)) -#define host_to_le16(n) ((__force le16) (u16) (n)) -#define be_to_host16(n) bswap_16((__force u16) (be16) (n)) -#define host_to_be16(n) ((__force be16) bswap_16((n))) -#define le_to_host32(n) ((__force u32) (le32) (n)) -#define host_to_le32(n) ((__force le32) (u32) (n)) -#define be_to_host32(n) bswap_32((__force u32) (be32) (n)) -#define host_to_be32(n) ((__force be32) bswap_32((n))) -#define le_to_host64(n) ((__force u64) (le64) (n)) -#define host_to_le64(n) ((__force le64) (u64) (n)) -#define be_to_host64(n) bswap_64((__force u64) (be64) (n)) -#define host_to_be64(n) ((__force be64) bswap_64((n))) +#define le_to_host16(n) ((__wpa_force u16) (le16) (n)) +#define host_to_le16(n) ((__wpa_force le16) (u16) (n)) +#define be_to_host16(n) bswap_16((__wpa_force u16) (be16) (n)) +#define host_to_be16(n) ((__wpa_force be16) bswap_16((n))) +#define le_to_host32(n) ((__wpa_force u32) (le32) (n)) +#define host_to_le32(n) ((__wpa_force le32) (u32) (n)) +#define be_to_host32(n) bswap_32((__wpa_force u32) (be32) (n)) +#define host_to_be32(n) ((__wpa_force be32) bswap_32((n))) +#define le_to_host64(n) ((__wpa_force u64) (le64) (n)) +#define host_to_le64(n) ((__wpa_force le64) (u64) (n)) +#define be_to_host64(n) bswap_64((__wpa_force u64) (be64) (n)) +#define host_to_be64(n) ((__wpa_force be64) bswap_64((n))) #elif __BYTE_ORDER == __BIG_ENDIAN #define le_to_host16(n) bswap_16(n) #define host_to_le16(n) bswap_16(n) @@ -430,20 +430,20 @@ void perror(const char *s); * (http://kernel.org/pub/linux/kernel/people/josh/sparse/) */ #ifdef __CHECKER__ -#define __force __attribute__((force)) +#define __wpa_force __attribute__((force)) #undef __bitwise -#define __bitwise __attribute__((bitwise)) +#define __wpa_bitwise __attribute__((bitwise)) #else -#define __force -#define __bitwise +#define __wpa_force +#define __wpa_bitwise #endif -typedef u16 __bitwise be16; -typedef u16 __bitwise le16; -typedef u32 __bitwise be32; -typedef u32 __bitwise le32; -typedef u64 __bitwise be64; -typedef u64 __bitwise le64; +typedef u16 __wpa_bitwise be16; +typedef u16 __wpa_bitwise le16; +typedef u32 __wpa_bitwise be32; +typedef u32 __wpa_bitwise le32; +typedef u64 __wpa_bitwise be64; +typedef u64 __wpa_bitwise le64; #ifndef __must_check #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)