Skip to content

Commit

Permalink
random.c: use %pU to print UUIDs
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Matt Mackall <mpm@selenic.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Joe Perches authored and Linus Torvalds committed Dec 15, 2009
1 parent 03daa57 commit 3590077
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions drivers/char/random.c
Original file line number Diff line number Diff line change
Expand Up @@ -1245,12 +1245,8 @@ static int proc_do_uuid(ctl_table *table, int write,
if (uuid[8] == 0)
generate_random_uuid(uuid);

sprintf(buf, "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-"
"%02x%02x%02x%02x%02x%02x",
uuid[0], uuid[1], uuid[2], uuid[3],
uuid[4], uuid[5], uuid[6], uuid[7],
uuid[8], uuid[9], uuid[10], uuid[11],
uuid[12], uuid[13], uuid[14], uuid[15]);
sprintf(buf, "%pU", uuid);

fake_table.data = buf;
fake_table.maxlen = sizeof(buf);

Expand Down Expand Up @@ -1310,7 +1306,7 @@ ctl_table random_table[] = {

/********************************************************************
*
* Random funtions for networking
* Random functions for networking
*
********************************************************************/

Expand Down

0 comments on commit 3590077

Please sign in to comment.