Merge branch 'sched/urgent'
[linux-2.6-microblaze.git] / lib / vsprintf.c
index 7c488a1..532b660 100644 (file)
@@ -2168,6 +2168,10 @@ char *fwnode_string(char *buf, char *end, struct fwnode_handle *fwnode,
  *             f full name
  *             P node name, including a possible unit address
  * - 'x' For printing the address. Equivalent to "%lx".
+ * - '[ku]s' For a BPF/tracing related format specifier, e.g. used out of
+ *           bpf_trace_printk() where [ku] prefix specifies either kernel (k)
+ *           or user (u) memory to probe, and:
+ *              s a string, equivalent to "%s" on direct vsnprintf() use
  *
  * ** When making changes please also update:
  *     Documentation/core-api/printk-formats.rst
@@ -2251,6 +2255,14 @@ char *pointer(const char *fmt, char *buf, char *end, void *ptr,
                if (!IS_ERR(ptr))
                        break;
                return err_ptr(buf, end, ptr, spec);
+       case 'u':
+       case 'k':
+               switch (fmt[1]) {
+               case 's':
+                       return string(buf, end, ptr, spec);
+               default:
+                       return error_string(buf, end, "(einval)", spec);
+               }
        }
 
        /* default is to _not_ leak addresses, hash before printing */