From: Chia-Yu Chang <chia-yu.ch...@nokia-bell-labs.com>

No functional change.

Signed-off-by: Chia-Yu Chang <chia-yu.ch...@nokia-bell-labs.com>
---
 include/utils.h |  1 +
 ip/iplink_can.c | 14 --------------
 lib/utils.c     | 14 ++++++++++++++
 3 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/include/utils.h b/include/utils.h
index 9a81494d..9a8b8026 100644
--- a/include/utils.h
+++ b/include/utils.h
@@ -146,6 +146,7 @@ int read_prop(const char *dev, char *prop, long *value);
 int get_long(long *val, const char *arg, int base);
 int get_integer(int *val, const char *arg, int base);
 int get_unsigned(unsigned *val, const char *arg, int base);
+int get_float(float *val, const char *arg);
 int get_time_rtt(unsigned *val, const char *arg, int *raw);
 #define get_byte get_u8
 #define get_ushort get_u16
diff --git a/ip/iplink_can.c b/ip/iplink_can.c
index fcffa852..9f6084e6 100644
--- a/ip/iplink_can.c
+++ b/ip/iplink_can.c
@@ -67,20 +67,6 @@ static void usage(void)
        print_usage(stderr);
 }
 
-static int get_float(float *val, const char *arg)
-{
-       float res;
-       char *ptr;
-
-       if (!arg || !*arg)
-               return -1;
-       res = strtof(arg, &ptr);
-       if (!ptr || ptr == arg || *ptr)
-               return -1;
-       *val = res;
-       return 0;
-}
-
 static void set_ctrlmode(char *name, char *arg,
                         struct can_ctrlmode *cm, __u32 flags)
 {
diff --git a/lib/utils.c b/lib/utils.c
index 706e93c3..103e4875 100644
--- a/lib/utils.c
+++ b/lib/utils.c
@@ -220,6 +220,20 @@ int get_unsigned(unsigned int *val, const char *arg, int 
base)
        return 0;
 }
 
+int get_float(float *val, const char *arg)
+{
+       float res;
+       char *ptr;
+
+       if (!arg || !*arg)
+               return -1;
+       res = strtof(arg, &ptr);
+       if (!ptr || ptr == arg || *ptr)
+               return -1;
+       *val = res;
+       return 0;
+}
+
 /*
  * get_time_rtt is "translated" from a similar routine "get_time" in
  * tc_util.c.  We don't use the exact same routine because tc passes
-- 
2.34.1


Reply via email to