btrfs: fix race between quota disable and quota assign ioctls
[platform/kernel/linux-rpi.git] / lib / dynamic_debug.c
index 00e6507..2ca56c2 100644 (file)
@@ -380,10 +380,6 @@ static int ddebug_parse_query(char *words[], int nwords,
                return -EINVAL;
        }
 
-       if (modname)
-               /* support $modname.dyndbg=<multiple queries> */
-               query->module = modname;
-
        for (i = 0; i < nwords; i += 2) {
                char *keyword = words[i];
                char *arg = words[i+1];
@@ -424,6 +420,13 @@ static int ddebug_parse_query(char *words[], int nwords,
                if (rc)
                        return rc;
        }
+       if (!query->module && modname)
+               /*
+                * support $modname.dyndbg=<multiple queries>, when
+                * not given in the query itself
+                */
+               query->module = modname;
+
        vpr_info_dq(query, "parsed");
        return 0;
 }
@@ -549,35 +552,6 @@ static int ddebug_exec_queries(char *query, const char *modname)
        return nfound;
 }
 
-/**
- * dynamic_debug_exec_queries - select and change dynamic-debug prints
- * @query: query-string described in admin-guide/dynamic-debug-howto
- * @modname: string containing module name, usually &module.mod_name
- *
- * This uses the >/proc/dynamic_debug/control reader, allowing module
- * authors to modify their dynamic-debug callsites. The modname is
- * canonically struct module.mod_name, but can also be null or a
- * module-wildcard, for example: "drm*".
- */
-int dynamic_debug_exec_queries(const char *query, const char *modname)
-{
-       int rc;
-       char *qry; /* writable copy of query */
-
-       if (!query) {
-               pr_err("non-null query/command string expected\n");
-               return -EINVAL;
-       }
-       qry = kstrndup(query, PAGE_SIZE, GFP_KERNEL);
-       if (!qry)
-               return -ENOMEM;
-
-       rc = ddebug_exec_queries(qry, modname);
-       kfree(qry);
-       return rc;
-}
-EXPORT_SYMBOL_GPL(dynamic_debug_exec_queries);
-
 #define PREFIX_SIZE 64
 
 static int remaining(int wrote)