From nobody Mon Nov 25 14:38:37 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) client-ip=63.128.21.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1601507756; cv=none; d=zohomail.com; s=zohoarc; b=eDeORrO1Nd3De/dGt08LhaqWW7qnJaisTigg6enzK9xpLSw5PbYtKVoDpGJOr3D/CbclVvI04aVdFu2bbfWEv44Ssq1375NYZ8XUaWgriv7htYjrENDy4FBVVTSbwUx9M93iVSCLSZi0xICX4qqzzXf4/k1TToag0bKWMvZKDWU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1601507756; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=ds+NqgpX6X6Ab0bAmgYBuYBEm4EHqXuuIeqV2peoAIk=; b=Pi/YwChQZy4ZnDns0zo+hI2PuwPgrir1OrDV4lmrRlUujgM+tPnTPGjGA+yAzTx8ySWEn9qOu0eE3f0vN9MslDjAMB9iEkKIRxr69CDR0svuQPFK1chRJkvkI6pb2N6Co0E1c8G6vx8iqCby50EoXspfTaXYujE2DoKI7xg026k= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 63.128.21.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mx.zohomail.com with SMTPS id 1601507756311604.1305761052764; Wed, 30 Sep 2020 16:15:56 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-56-p3vQtdVmO7-P0pRFHC94Ew-1; Wed, 30 Sep 2020 19:15:51 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id F1341107465B; Wed, 30 Sep 2020 23:15:44 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id D0F8A5C1D7; Wed, 30 Sep 2020 23:15:44 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 9A50B44A5D; Wed, 30 Sep 2020 23:15:44 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 08UNEpnO027994 for ; Wed, 30 Sep 2020 19:14:51 -0400 Received: by smtp.corp.redhat.com (Postfix) id BC86D55762; Wed, 30 Sep 2020 23:14:51 +0000 (UTC) Received: from vhost2.laine.org (ovpn-112-224.phx2.redhat.com [10.3.112.224]) by smtp.corp.redhat.com (Postfix) with ESMTP id 740633782 for ; Wed, 30 Sep 2020 23:14:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1601507755; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=ds+NqgpX6X6Ab0bAmgYBuYBEm4EHqXuuIeqV2peoAIk=; b=BdwBuiEEehYkOnLYDWgUFXDjXqEKHkIQZk8raJXQpLmf2UuSHTf1NARVDjzVkx1PPLezuR 0mfZrcSqM+Bj5TTchlYEc33tT+1D2MBaLwElMpk/mt4ImRuQFlaIeEtQxSdmuPW1v23hYM r1wlqAAYZUuu/sx8xFg1xBXiWFqBK60= X-MC-Unique: p3vQtdVmO7-P0pRFHC94Ew-1 From: Laine Stump To: libvir-list@redhat.com Subject: [PATCH 2/9] util: remove extraneous defined(__linux__) when checking for WITH_LIBNL Date: Wed, 30 Sep 2020 19:14:37 -0400 Message-Id: <20200930231444.409215-3-laine@redhat.com> In-Reply-To: <20200930231444.409215-1-laine@redhat.com> References: <20200930231444.409215-1-laine@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" WITH_LIBNL will only be defined on Linux platforms (because libnl is a library written to encapsulate parts of netlink, which is a Linux-only API), so it's redundant to write: #if defined(__linux__) && defined(WITH_LIBNL) We can just check for WITH_LIBNL. Signed-off-by: Laine Stump --- src/util/virnetdev.c | 10 +++++----- src/util/virnetdevbridge.c | 6 +++--- src/util/virnetdevip.c | 6 +++--- src/util/virnetlink.c | 4 ++-- src/util/virnetlink.h | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index 07208a1876..737081a12b 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -885,7 +885,7 @@ int virNetDevGetIndex(const char *ifname G_GNUC_UNUSED, #endif /* ! SIOCGIFINDEX */ =20 =20 -#if defined(__linux__) && defined(WITH_LIBNL) +#if defined(WITH_LIBNL) /** * virNetDevGetMaster: * @ifname: name of interface we're interested in @@ -929,7 +929,7 @@ virNetDevGetMaster(const char *ifname G_GNUC_UNUSED, } =20 =20 -#endif /* defined(__linux__) && defined(WITH_LIBNL) */ +#endif /* defined(WITH_LIBNL) */ =20 =20 #if defined(SIOCGIFVLAN) && defined(WITH_STRUCT_IFREQ) && WITH_DECL_GET_VL= AN_VID_CMD @@ -1473,7 +1473,7 @@ virNetDevSysfsFile(char **pf_sysfs_device_link G_GNUC= _UNUSED, =20 =20 #endif /* !__linux__ */ -#if defined(__linux__) && defined(WITH_LIBNL) +#if defined(WITH_LIBNL) =20 =20 static virMacAddr zeroMAC =3D { .addr =3D { 0, 0, 0, 0, 0, 0 } }; @@ -2266,7 +2266,7 @@ virNetDevSetNetConfig(const char *linkdev, int vf, } =20 =20 -#else /* defined(__linux__) && defined(WITH_LIBNL) */ +#else /* defined(WITH_LIBNL) */ =20 =20 int @@ -2309,7 +2309,7 @@ virNetDevSetNetConfig(const char *linkdev G_GNUC_UNUS= ED, } =20 =20 -#endif /* defined(__linux__) && defined(WITH_LIBNL) */ +#endif /* defined(WITH_LIBNL) */ =20 VIR_ENUM_IMPL(virNetDevIfState, VIR_NETDEV_IF_STATE_LAST, diff --git a/src/util/virnetdevbridge.c b/src/util/virnetdevbridge.c index 9fec770fb6..d475e4c43d 100644 --- a/src/util/virnetdevbridge.c +++ b/src/util/virnetdevbridge.c @@ -441,7 +441,7 @@ virNetDevBridgeCreateWithIoctl(const char *brname, } #endif =20 -#if defined(__linux__) && defined(WITH_LIBNL) +#if defined(WITH_LIBNL) int virNetDevBridgeCreate(const char *brname, const virMacAddr *mac) @@ -552,7 +552,7 @@ virNetDevBridgeDeleteWithIoctl(const char *brname) #endif =20 =20 -#if defined(__linux__) && defined(WITH_LIBNL) +#if defined(WITH_LIBNL) int virNetDevBridgeDelete(const char *brname) { @@ -976,7 +976,7 @@ virNetDevBridgeSetVlanFiltering(const char *brname G_GN= UC_UNUSED, #endif =20 =20 -#if defined(__linux__) && defined(WITH_LIBNL) +#if defined(WITH_LIBNL) =20 # ifndef NTF_SELF # define NTF_SELF 0x02 diff --git a/src/util/virnetdevip.c b/src/util/virnetdevip.c index 4887ccfcf1..a69567da6f 100644 --- a/src/util/virnetdevip.c +++ b/src/util/virnetdevip.c @@ -52,7 +52,7 @@ =20 VIR_LOG_INIT("util.netdevip"); =20 -#if defined(__linux__) && defined(WITH_LIBNL) +#if defined(WITH_LIBNL) =20 static int virNetDevGetIPAddressBinary(virSocketAddr *addr, void **data, size_t *len) @@ -373,7 +373,7 @@ virNetDevIPRouteAdd(const char *ifname, } =20 =20 -#else /* defined(__linux__) && defined(WITH_LIBNL) */ +#else /* defined(WITH_LIBNL) */ =20 =20 int @@ -494,7 +494,7 @@ virNetDevIPRouteAdd(const char *ifname, return 0; } =20 -#endif /* defined(__linux__) && defined(HAVE_LIBNL) */ +#endif /* defined(HAVE_LIBNL) */ =20 =20 #if defined(__linux__) diff --git a/src/util/virnetlink.c b/src/util/virnetlink.c index be444baa56..ea06db51ee 100644 --- a/src/util/virnetlink.c +++ b/src/util/virnetlink.c @@ -40,7 +40,7 @@ VIR_LOG_INIT("util.netlink"); =20 #define NETLINK_ACK_TIMEOUT_S (2*1000) =20 -#if defined(__linux__) && defined(WITH_LIBNL) +#if defined(WITH_LIBNL) /* State for a single netlink event handle */ struct virNetlinkEventHandle { int watch; @@ -1387,4 +1387,4 @@ virNetlinkGetErrorCode(struct nlmsghdr *resp G_GNUC_U= NUSED, return -EINVAL; } =20 -#endif /* __linux__ */ +#endif /* WITH_LIBNL */ diff --git a/src/util/virnetlink.h b/src/util/virnetlink.h index 40f27524f6..7121eac43e 100644 --- a/src/util/virnetlink.h +++ b/src/util/virnetlink.h @@ -22,7 +22,7 @@ #include "internal.h" #include "virmacaddr.h" =20 -#if defined(__linux__) && defined(WITH_LIBNL) +#if defined(WITH_LIBNL) =20 # include =20 @@ -36,7 +36,7 @@ struct sockaddr_nl; struct nlattr; struct nlmsghdr; =20 -#endif /* __linux__ */ +#endif /* WITH_LIBNL */ =20 #define NETLINK_MSG_NEST_START(msg, container, attrtype) \ do { \ --=20 2.26.2