arm64: rockchip_defconfig: add alps trackpad support
[firefly-linux-kernel-4.4.55.git] / lib / vsprintf.c
index e35724c2b2a89b0ca0715b24114f314ac5ebf5e8..f9cee8e1233c0fe0f626fe2680ca4b9ff9d3153e 100644 (file)
@@ -1448,7 +1448,6 @@ int kptr_restrict __read_mostly;
  * - 'Cn' For a clock, it prints the name (Common Clock Framework) or address
  *        (legacy clock framework) of the clock
  * - 'Cr' For a clock, it prints the current rate of the clock
- * - 'n' For ignored argument
  *
  * ** Please update also Documentation/printk-formats.txt when making changes **
  *
@@ -1460,7 +1459,7 @@ static noinline_for_stack
 char *pointer(const char *fmt, char *buf, char *end, void *ptr,
              struct printf_spec spec)
 {
-       int default_width = 2 * sizeof(void *) + (spec.flags & SPECIAL ? 2 : 0);
+       const int default_width = 2 * sizeof(void *);
 
        if (!ptr && *fmt != 'K') {
                /*
@@ -1814,8 +1813,10 @@ qualifier:
  * @fmt: The format string to use
  * @args: Arguments for the format string
  *
- * This function follows C99 vsnprintf, but has some extensions:
- * %n is ignored
+ * This function generally follows C99 vsnprintf, but has some
+ * extensions and a few limitations:
+ *
+ * %n is unsupported
  * %p* is handled by pointer()
  *
  * See pointer() or Documentation/printk-formats.txt for more
@@ -2270,7 +2271,7 @@ int bstr_printf(char *buf, size_t size, const char *fmt, const u32 *bin_buf)
        char *str, *end;
        const char *args = (const char *)bin_buf;
 
-       if (WARN_ON_ONCE((int) size < 0))
+       if (WARN_ON_ONCE(size > INT_MAX))
                return 0;
 
        str = buf;