]> Pileus Git - ~andy/linux/blobdiff - lib/dynamic_debug.c
net: davinci_emac: Replace devm_request_irq with request_irq
[~andy/linux] / lib / dynamic_debug.c
index 600ac57e27777f429b77279d93cb9a483f1fbd15..7288e38e17575952664af1df3a69ba488812c8e3 100644 (file)
@@ -268,14 +268,12 @@ static int ddebug_tokenize(char *buf, char *words[], int maxwords)
  */
 static inline int parse_lineno(const char *str, unsigned int *val)
 {
-       char *end = NULL;
        BUG_ON(str == NULL);
        if (*str == '\0') {
                *val = 0;
                return 0;
        }
-       *val = simple_strtoul(str, &end, 10);
-       if (end == NULL || end == str || *end != '\0') {
+       if (kstrtouint(str, 10, val) < 0) {
                pr_err("bad line-number: %s\n", str);
                return -EINVAL;
        }
@@ -348,14 +346,14 @@ static int ddebug_parse_query(char *words[], int nwords,
                        }
                        if (last)
                                *last++ = '\0';
-                       if (parse_lineno(first, &query->first_lineno) < 0) {
-                               pr_err("line-number is <0\n");
+                       if (parse_lineno(first, &query->first_lineno) < 0)
                                return -EINVAL;
-                       }
                        if (last) {
                                /* range <first>-<last> */
-                               if (parse_lineno(last, &query->last_lineno)
-                                   < query->first_lineno) {
+                               if (parse_lineno(last, &query->last_lineno) < 0)
+                                       return -EINVAL;
+
+                               if (query->last_lineno < query->first_lineno) {
                                        pr_err("last-line:%d < 1st-line:%d\n",
                                                query->last_lineno,
                                                query->first_lineno);