util: remove extraneous defined(__linux__) when checking for WITH_LIBNL

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 <laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Laine Stump 2020-09-28 17:29:41 -04:00
parent 3d5748e87a
commit 51ec9f6c07
5 changed files with 15 additions and 15 deletions

View File

@ -885,7 +885,7 @@ int virNetDevGetIndex(const char *ifname G_GNUC_UNUSED,
#endif /* ! SIOCGIFINDEX */
#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,
}
#endif /* defined(__linux__) && defined(WITH_LIBNL) */
#endif /* defined(WITH_LIBNL) */
#if defined(SIOCGIFVLAN) && defined(WITH_STRUCT_IFREQ) && WITH_DECL_GET_VLAN_VID_CMD
@ -1473,7 +1473,7 @@ virNetDevSysfsFile(char **pf_sysfs_device_link G_GNUC_UNUSED,
#endif /* !__linux__ */
#if defined(__linux__) && defined(WITH_LIBNL)
#if defined(WITH_LIBNL)
static virMacAddr zeroMAC = { .addr = { 0, 0, 0, 0, 0, 0 } };
@ -2266,7 +2266,7 @@ virNetDevSetNetConfig(const char *linkdev, int vf,
}
#else /* defined(__linux__) && defined(WITH_LIBNL) */
#else /* defined(WITH_LIBNL) */
int
@ -2309,7 +2309,7 @@ virNetDevSetNetConfig(const char *linkdev G_GNUC_UNUSED,
}
#endif /* defined(__linux__) && defined(WITH_LIBNL) */
#endif /* defined(WITH_LIBNL) */
VIR_ENUM_IMPL(virNetDevIfState,
VIR_NETDEV_IF_STATE_LAST,

View File

@ -441,7 +441,7 @@ virNetDevBridgeCreateWithIoctl(const char *brname,
}
#endif
#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
#if defined(__linux__) && defined(WITH_LIBNL)
#if defined(WITH_LIBNL)
int
virNetDevBridgeDelete(const char *brname)
{
@ -976,7 +976,7 @@ virNetDevBridgeSetVlanFiltering(const char *brname G_GNUC_UNUSED,
#endif
#if defined(__linux__) && defined(WITH_LIBNL)
#if defined(WITH_LIBNL)
# ifndef NTF_SELF
# define NTF_SELF 0x02

View File

@ -52,7 +52,7 @@
VIR_LOG_INIT("util.netdevip");
#if defined(__linux__) && defined(WITH_LIBNL)
#if defined(WITH_LIBNL)
static int
virNetDevGetIPAddressBinary(virSocketAddr *addr, void **data, size_t *len)
@ -373,7 +373,7 @@ virNetDevIPRouteAdd(const char *ifname,
}
#else /* defined(__linux__) && defined(WITH_LIBNL) */
#else /* defined(WITH_LIBNL) */
int
@ -494,7 +494,7 @@ virNetDevIPRouteAdd(const char *ifname,
return 0;
}
#endif /* defined(__linux__) && defined(HAVE_LIBNL) */
#endif /* defined(HAVE_LIBNL) */
#if defined(__linux__)

View File

@ -40,7 +40,7 @@ VIR_LOG_INIT("util.netlink");
#define NETLINK_ACK_TIMEOUT_S (2*1000)
#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_UNUSED,
return -EINVAL;
}
#endif /* __linux__ */
#endif /* WITH_LIBNL */

View File

@ -22,7 +22,7 @@
#include "internal.h"
#include "virmacaddr.h"
#if defined(__linux__) && defined(WITH_LIBNL)
#if defined(WITH_LIBNL)
# include <netlink/msg.h>
@ -36,7 +36,7 @@ struct sockaddr_nl;
struct nlattr;
struct nlmsghdr;
#endif /* __linux__ */
#endif /* WITH_LIBNL */
#define NETLINK_MSG_NEST_START(msg, container, attrtype) \
do { \