From patchwork Sat Sep 19 06:08:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linhaifeng X-Patchwork-Id: 1367464 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=openvswitch.org (client-ip=140.211.166.136; helo=silver.osuosl.org; envelope-from=ovs-dev-bounces@openvswitch.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=huawei.com Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BtgJW0KpTz9sSW for ; Sat, 19 Sep 2020 16:09:08 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 514E920504; Sat, 19 Sep 2020 06:09:06 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id cSljEupiyMHs; Sat, 19 Sep 2020 06:09:04 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id 879C520482; Sat, 19 Sep 2020 06:09:04 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 56B2AC1AD4; Sat, 19 Sep 2020 06:09:04 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@lists.linuxfoundation.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists.linuxfoundation.org (Postfix) with ESMTP id C560BC0051 for ; Sat, 19 Sep 2020 06:09:02 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id B56F820499 for ; Sat, 19 Sep 2020 06:09:02 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yOz5QgeXTeUg for ; Sat, 19 Sep 2020 06:09:01 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from huawei.com (szxga08-in.huawei.com [45.249.212.255]) by silver.osuosl.org (Postfix) with ESMTPS id 656E220482 for ; Sat, 19 Sep 2020 06:09:01 +0000 (UTC) Received: from DGGEML402-HUB.china.huawei.com (unknown [172.30.72.57]) by Forcepoint Email with ESMTP id E2EC24C73E549D56DD1E; Sat, 19 Sep 2020 14:08:54 +0800 (CST) Received: from DGGEML522-MBS.china.huawei.com ([169.254.8.49]) by DGGEML402-HUB.china.huawei.com ([fe80::fca6:7568:4ee3:c776%31]) with mapi id 14.03.0487.000; Sat, 19 Sep 2020 14:08:47 +0800 From: Linhaifeng To: "dev@openvswitch.org" Thread-Topic: [PATCH] ovs-atomic: __GNUC__ == 4 is enough Thread-Index: AdaOSz2zJz3uxIFtRp6BOgCvr+nrhQ== Date: Sat, 19 Sep 2020 06:08:47 +0000 Message-ID: <4099DE2E54AFAD489356C6C9161D533397458186@dggeml522-mbs.china.huawei.com> Accept-Language: en-GB, zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.174.242.112] MIME-Version: 1.0 X-CFilter-Loop: Reflected Cc: "blp@nicira.com" , "Lilijun \(Jerry\)" Subject: [ovs-dev] [PATCH] ovs-atomic: __GNUC__ == 4 is enough X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ovs-dev-bounces@openvswitch.org Sender: "dev" 1. include config.h to avoid include different atomic head file 2. __GNUC__ == 4 is enough Fixes: 31a3fc6e3e9c ("ovs-atomic: New library for atomic operations.") Cc: blp@nicira.com Signed-off-by: Linhaifeng --- lib/ovs-atomic.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ovs-atomic.h b/lib/ovs-atomic.h index 11fa19268..2aee4c608 100644 --- a/lib/ovs-atomic.h +++ b/lib/ovs-atomic.h @@ -311,6 +311,7 @@ * memory_order_seq_cst for atomic_flag_clear()). */ +#include #include #include #include @@ -331,7 +332,7 @@ #include "ovs-atomic-c11.h" #elif __GNUC__ >= 5 && !defined(__cplusplus) #error "GCC 5+ should have " - #elif __GNUC__ >= 5 || (__GNUC__ >= 4 && __GNUC_MINOR__ >= 7) + #elif __GNUC__ >= 5 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) #include "ovs-atomic-gcc4.7+.h" #elif __GNUC__ && defined(__x86_64__) #include "ovs-atomic-x86_64.h"