remove commented out #includes etc
authorDenis Vlasenko <vda.linux@googlemail.com>
Sun, 31 Dec 2006 18:58:32 +0000 (18:58 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Sun, 31 Dec 2006 18:58:32 +0000 (18:58 -0000)
move get_hz to the only caller

include/platform.h
networking/libiproute/iproute.c
networking/libiproute/libnetlink.h
networking/libiproute/linux/pkt_sched.h
networking/libiproute/utils.c
networking/libiproute/utils.h

index 9d8df4b7f303aac6ca71633fbe3210e786e53cdb..91d5f476d8693ece34652f71f40da1e395a971c6 100644 (file)
@@ -133,13 +133,6 @@ typedef int socklen_t;
 #endif
 
 /* ---- Compiler dependent settings ------------------------- */
-//#ifndef __GNUC__
-//#if defined __INTEL_COMPILER
-//__extension__ typedef __signed__ long long __s64;
-//__extension__ typedef unsigned long long __u64;
-//#endif /* __INTEL_COMPILER */
-//#endif /* ifndef __GNUC__ */
-
 #if (defined __digital__ && defined __unix__)
 # undef HAVE_MNTENT_H
 #else
index bf6f95f61b4faf106ec821df37d126e8cda9c652..acb5169a46e3855520d82f70bf85b3faeab56f21 100644 (file)
@@ -57,6 +57,28 @@ static int flush_update(void)
        return 0;
 }
 
+static int get_hz(void)
+{
+       static int hz_internal;
+       FILE *fp;
+
+       if (hz_internal)
+               return hz_internal;
+
+       fp = fopen("/proc/net/psched", "r");
+       if (fp) {
+               unsigned nom, denom;
+
+               if (fscanf(fp, "%*08x%*08x%08x%08x", &nom, &denom) == 2)
+                       if (nom == 1000000)
+                               hz_internal = denom;
+               fclose(fp);
+       }
+       if (!hz_internal)
+               hz_internal = sysconf(_SC_CLK_TCK);
+       return hz_internal;
+}
+
 static int print_route(struct sockaddr_nl *who ATTRIBUTE_UNUSED,
                struct nlmsghdr *n, void *arg)
 {
index bd1913618374655b91408863f98ba2ce5f58c845..6dd242d038c3c7789fa6da1a0da92f1400684d32 100644 (file)
@@ -2,7 +2,6 @@
 #ifndef __LIBNETLINK_H__
 #define __LIBNETLINK_H__ 1
 
-//#include <asm/types.h>
 #include <linux/netlink.h>
 #include <linux/rtnetlink.h>
 
index 36c0a46e3941aaf754a2e4e94d32c638673a2d43..012bb57666fa0b0f85ccc8e9ffed1528c897ac3e 100644 (file)
@@ -15,8 +15,6 @@
    filler or even bulk.
  */
 
-//#include <asm/types.h>
-
 #define TC_PRIO_BESTEFFORT             0
 #define TC_PRIO_FILLER                 1
 #define TC_PRIO_BULK                   2
index aa60ffd01036657cd93ccde064bac305ad7bb125..7e74e1c4be756400dc102958650089ef270f117e 100644 (file)
@@ -294,26 +294,6 @@ int inet_addr_match(inet_prefix * a, inet_prefix * b, int bits)
        return 0;
 }
 
-int __iproute2_hz_internal;
-
-int __get_hz(void)
-{
-       int hz = 0;
-       FILE *fp = fopen("/proc/net/psched", "r");
-
-       if (fp) {
-               unsigned nom, denom;
-
-               if (fscanf(fp, "%*08x%*08x%08x%08x", &nom, &denom) == 2)
-                       if (nom == 1000000)
-                               hz = denom;
-               fclose(fp);
-       }
-       if (hz)
-               return hz;
-       return sysconf(_SC_CLK_TCK);
-}
-
 const char *rt_addr_n2a(int af, int ATTRIBUTE_UNUSED len,
                void *addr, char *buf, int buflen)
 {
index 3ecbb3abdd6b9970c89a5775d66d2cd0b55cb08a..c8ac63197972603c9f95ddeb11e8b4531cbe185d 100644 (file)
@@ -3,8 +3,6 @@
 #define __UTILS_H__ 1
 
 #include "libbb.h"
-//#include <asm/types.h>
-//#include <resolv.h>
 
 #include "libnetlink.h"
 #include "ll_map.h"
@@ -90,14 +88,4 @@ int dnet_pton(int af, const char *src, void *addr);
 const char *ipx_ntop(int af, const void *addr, char *str, size_t len);
 int ipx_pton(int af, const char *src, void *addr);
 
-extern int __iproute2_hz_internal;
-extern int __get_hz(void);
-
-static inline int get_hz(void)
-{
-       if (__iproute2_hz_internal == 0)
-               __iproute2_hz_internal = __get_hz();
-       return __iproute2_hz_internal;
-}
-
 #endif /* __UTILS_H__ */