VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   33 Branches   55 Tags
author: Shunyong Yang <shunyong.yang@hxt-semitech.com> 2018-02-16 23:07:09 +0200 committer: Petr Mladek <pmladek@suse.com> 2018-04-11 11:18:43 +0200 commit: 91efafb1dd8f471177a3dddb4841d75d3df1cc46 parent: 496a9a5f3806d58b14ae06b390d5b1ffa26e9f9a
Commit Summary:
lib/vsprintf: Replace space with '_' before crng is ready
Diffstat:
1 file changed, 2 insertions, 1 deletion
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index 9004bbb3d84d..97be2d07297a 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -1681,12 +1681,13 @@ early_initcall(initialize_ptr_random);
 /* Maps a pointer to a 32 bit unique identifier. */
 static char *ptr_to_id(char *buf, char *end, void *ptr, struct printf_spec spec)
 {
+	const char *str = sizeof(ptr) == 8 ? "(____ptrval____)" : "(ptrval)";
 	unsigned long hashval;
 
 	if (unlikely(!have_filled_random_ptr_key)) {
 		spec.field_width = 2 * sizeof(ptr);
 		/* string length must be less than default_width */
-		return string(buf, end, "(ptrval)", spec);
+		return string(buf, end, str, spec);
 	}
 
 #ifdef CONFIG_64BIT