]> git.karo-electronics.de Git - linux-beck.git/blobdiff - drivers/char/random.c
random.c: use %pU to print UUIDs
[linux-beck.git] / drivers / char / random.c
index bcf680f9ff589993c499bf2e7357863fee5c2a3e..8258982b49ec3ab1551416ccd8e558d2f1c5e6df 100644 (file)
@@ -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);
 
@@ -1264,13 +1260,13 @@ ctl_table random_table[] = {
                .data           = &sysctl_poolsize,
                .maxlen         = sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
        },
        {
                .procname       = "entropy_avail",
                .maxlen         = sizeof(int),
                .mode           = 0444,
-               .proc_handler   = &proc_dointvec,
+               .proc_handler   = proc_dointvec,
                .data           = &input_pool.entropy_count,
        },
        {
@@ -1278,7 +1274,7 @@ ctl_table random_table[] = {
                .data           = &random_read_wakeup_thresh,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &min_read_thresh,
                .extra2         = &max_read_thresh,
        },
@@ -1287,7 +1283,7 @@ ctl_table random_table[] = {
                .data           = &random_write_wakeup_thresh,
                .maxlen         = sizeof(int),
                .mode           = 0644,
-               .proc_handler   = &proc_dointvec_minmax,
+               .proc_handler   = proc_dointvec_minmax,
                .extra1         = &min_write_thresh,
                .extra2         = &max_write_thresh,
        },
@@ -1296,13 +1292,13 @@ ctl_table random_table[] = {
                .data           = &sysctl_bootid,
                .maxlen         = 16,
                .mode           = 0444,
-               .proc_handler   = &proc_do_uuid,
+               .proc_handler   = proc_do_uuid,
        },
        {
                .procname       = "uuid",
                .maxlen         = 16,
                .mode           = 0444,
-               .proc_handler   = &proc_do_uuid,
+               .proc_handler   = proc_do_uuid,
        },
        { }
 };
@@ -1310,7 +1306,7 @@ ctl_table random_table[] = {
 
 /********************************************************************
  *
- * Random funtions for networking
+ * Random functions for networking
  *
  ********************************************************************/