]> git.ipfire.org Git - thirdparty/lldpd.git/commitdiff
daemon: do not explicitely inline functions
authorVincent Bernat <vincent@bernat.ch>
Tue, 2 Oct 2018 18:36:37 +0000 (20:36 +0200)
committerVincent Bernat <vincent@bernat.ch>
Tue, 2 Oct 2018 20:46:42 +0000 (22:46 +0200)
As we are using `-Winline`, if it fails, we get a warning. Let the
compiler decide if something has to be inlined. As we use only static
functions, it should be easy to inline if possible.

src/daemon/agent.c
src/daemon/interfaces-linux.c
src/daemon/interfaces.c
src/daemon/protocols/lldp.c
src/lldpd-structs.h

index cc7701cb5a0f0f3f501a2dcdbb5bbd35ef0740f9..dd36d9430fe0d21f27512aae63b53ab937dde471 100644 (file)
@@ -38,7 +38,7 @@ extern int unregister_sysORTable(oid *, size_t);
 #define scfg agent_scfg
 struct lldpd *agent_scfg;
 
-static inline uint8_t
+static uint8_t
 swap_bits(uint8_t n)
 {
   n = ((n&0xF0) >>4 ) | ( (n&0x0F) <<4);
index 32aceb0e3525624a2d6f18cea7afa0a505df65b6..18ecabfee5771245937f1333c1e75531d28d8743 100644 (file)
@@ -446,21 +446,21 @@ struct ethtool_link_usettings {
        } link_modes;
 };
 
-static inline int
+static int
 iflinux_ethtool_link_mode_test_bit(unsigned int nr, const uint32_t *mask)
 {
        if (nr >= 32 * ETHTOOL_LINK_MODE_MASK_MAX_KERNEL_NU32)
                return 0;
        return !!(mask[nr / 32] & (1 << (nr % 32)));
 }
-static inline void
+static void
 iflinux_ethtool_link_mode_unset_bit(unsigned int nr, uint32_t *mask)
 {
        if (nr >= 32 * ETHTOOL_LINK_MODE_MASK_MAX_KERNEL_NU32)
                return;
        mask[nr / 32] &= ~(1 << (nr % 32));
 }
-static inline int
+static int
 iflinux_ethtool_link_mode_is_empty(const uint32_t *mask)
 {
        for (unsigned int i = 0;
index d004c70cfbf1c149619ae98f9cf591c4d57ac5da..3c6c255da2e8cb8dacc448051e41bbd78216ca06 100644 (file)
 #include <assert.h>
 #include <arpa/inet.h>
 
+static int
+lldpd_af(int af)
+{
+       switch (af) {
+       case LLDPD_AF_IPV4: return AF_INET;
+       case LLDPD_AF_IPV6: return AF_INET6;
+       case LLDPD_AF_LAST: return AF_MAX;
+       default: return AF_UNSPEC;
+       }
+}
+
 /* Generic ethernet interface initialization */
 /**
  * Enable multicast on the given interface.
index c70794d9f10994604ec927afd32ea6e323eec76c..aae338d849ec294a5041f3421c3d2e894fc03658 100644 (file)
@@ -25,7 +25,7 @@
 #include <sys/socket.h>
 #include <sys/ioctl.h>
 
-inline static int
+static int
 lldpd_af_to_lldp_proto(int af)
 {
        switch (af) {
@@ -38,7 +38,7 @@ lldpd_af_to_lldp_proto(int af)
        }
 }
 
-inline static int
+static int
 lldpd_af_from_lldp_proto(int proto)
 {
        switch (proto) {
index 4f1a42c11e7a571b6eb207578fb3331c0f87b96b..c3ffa1088cbcd8cd6fc47b3171597d135b4a6ea6 100644 (file)
@@ -143,17 +143,6 @@ enum {
        LLDPD_AF_LAST
 };
 
-inline static int
-lldpd_af(int af)
-{
-       switch (af) {
-       case LLDPD_AF_IPV4: return AF_INET;
-       case LLDPD_AF_IPV6: return AF_INET6;
-       case LLDPD_AF_LAST: return AF_MAX;
-       default: return AF_UNSPEC;
-       }
-}
-
 #define LLDPD_MGMT_MAXADDRSIZE 16 /* sizeof(struct in6_addr) */
 union lldpd_address {
        struct in_addr          inet;