]> rtime.felk.cvut.cz Git - lisovros/iproute2_canprio.git/commitdiff
utils: get_jiffies always uses base=0
authorGerrit Renker <gerrit@erg.abdn.ac.uk>
Tue, 21 Dec 2010 11:54:09 +0000 (12:54 +0100)
committerStephen Hemminger <stephen.hemminger@vyatta.com>
Fri, 25 Feb 2011 20:49:42 +0000 (12:49 -0800)
get_jiffies() is in all places called in the same manner, with base=0;
simplify argument list by putting the constant value into the function.

include/utils.h
ip/iproute.c
lib/utils.c

index 595a7d6d5e54623007bd6d46c2891d792fd0a2c4..77c8e5a46f29441f3944ca4f8c8a56be57ea87fb 100644 (file)
@@ -79,7 +79,7 @@ extern int mask2bits(__u32 netmask);
 
 extern int get_integer(int *val, const char *arg, int base);
 extern int get_unsigned(unsigned *val, const char *arg, int base);
-extern int get_jiffies(unsigned *val, const char *arg, int base, int *raw);
+extern int get_jiffies(unsigned *val, const char *arg, int *raw);
 #define get_byte get_u8
 #define get_ushort get_u16
 #define get_short get_s16
index 0d69290b1db0fe3c8395a415b68fbfc8954fc83f..f3e7eb4257a2189cfe0027c5a5cd027bece535fc 100644 (file)
@@ -840,7 +840,7 @@ int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
                                mxlock |= (1<<RTAX_RTT);
                                NEXT_ARG();
                        }
-                       if (get_jiffies(&rtt, *argv, 0, &raw))
+                       if (get_jiffies(&rtt, *argv, &raw))
                                invarg("\"rtt\" value is invalid\n", *argv);
                        rta_addattr32(mxrta, sizeof(mxbuf), RTAX_RTT, 
                                (raw) ? rtt : rtt * 8);
@@ -848,7 +848,7 @@ int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
                        unsigned rto_min;
                        NEXT_ARG();
                        mxlock |= (1<<RTAX_RTO_MIN);
-                       if (get_jiffies(&rto_min, *argv, 0, &raw))
+                       if (get_jiffies(&rto_min, *argv, &raw))
                                invarg("\"rto_min\" value is invalid\n",
                                       *argv);
                        rta_addattr32(mxrta, sizeof(mxbuf), RTAX_RTO_MIN,
@@ -900,7 +900,7 @@ int iproute_modify(int cmd, unsigned flags, int argc, char **argv)
                                mxlock |= (1<<RTAX_RTTVAR);
                                NEXT_ARG();
                        }
-                       if (get_jiffies(&win, *argv, 0, &raw))
+                       if (get_jiffies(&win, *argv, &raw))
                                invarg("\"rttvar\" value is invalid\n", *argv);
                        rta_addattr32(mxrta, sizeof(mxbuf), RTAX_RTTVAR,
                                (raw) ? win : win * 4);
index a60d884e54e4b465188c94bdd75bb080085f764a..52f2b1f4491a5fb7283626682fda649edd494af5 100644 (file)
@@ -100,7 +100,7 @@ int get_unsigned(unsigned *val, const char *arg, int base)
  * a "raw" number.
  */
 
-int get_jiffies(unsigned *jiffies, const char *arg, int base, int *raw)
+int get_jiffies(unsigned *jiffies, const char *arg, int *raw)
 {
        double t;
        unsigned long res;
@@ -112,7 +112,7 @@ int get_jiffies(unsigned *jiffies, const char *arg, int base, int *raw)
                        return -1;
        }
        else {
-               res = strtoul(arg,&p,base);
+               res = strtoul(arg, &p, 0);
                if (res > UINT_MAX)
                        return -1;
                t = (double)res;