mac80211: correct legacy rates check in ieee80211_calc_rx_airtime
[platform/kernel/linux-rpi.git] / lib / dynamic_debug.c
index cb5abb4..2ca56c2 100644 (file)
@@ -207,10 +207,11 @@ static int ddebug_change(const struct ddebug_query *query,
                                continue;
 #ifdef CONFIG_JUMP_LABEL
                        if (dp->flags & _DPRINTK_FLAGS_PRINT) {
-                               if (!(modifiers->flags & _DPRINTK_FLAGS_PRINT))
+                               if (!(newflags & _DPRINTK_FLAGS_PRINT))
                                        static_branch_disable(&dp->key.dd_key_true);
-                       } else if (modifiers->flags & _DPRINTK_FLAGS_PRINT)
+                       } else if (newflags & _DPRINTK_FLAGS_PRINT) {
                                static_branch_enable(&dp->key.dd_key_true);
+                       }
 #endif
                        dp->flags = newflags;
                        v2pr_info("changed %s:%d [%s]%s =%s\n",
@@ -379,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];
@@ -423,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;
 }
@@ -548,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)
@@ -762,6 +737,18 @@ static __init int ddebug_setup_query(char *str)
 __setup("ddebug_query=", ddebug_setup_query);
 
 /*
+ * Install a noop handler to make dyndbg look like a normal kernel cli param.
+ * This avoids warnings about dyndbg being an unknown cli param when supplied
+ * by a user.
+ */
+static __init int dyndbg_setup(char *str)
+{
+       return 1;
+}
+
+__setup("dyndbg=", dyndbg_setup);
+
+/*
  * File_ops->write method for <debugfs>/dynamic_debug/control.  Gathers the
  * command text from userspace, parses and executes it.
  */