rockchip: rk3399-puma: preserve leading zeros in serial#
authorJakob Unterwurzacher <jakob.unterwurzacher@theobroma-systems.com>
Thu, 7 Dec 2017 15:20:44 +0000 (16:20 +0100)
committerPhilipp Tomsich <philipp.tomsich@theobroma-systems.com>
Fri, 8 Dec 2017 10:49:39 +0000 (11:49 +0100)
Linux preserves leading zeros in /proc/cpuinfo, so we
should as well.

Otherwise we have the situation that
/sys/firmware/devicetree/base/serial-number
and /proc/cpuinfo disagree in Linux.

Signed-off-by: Jakob Unterwurzacher <jakob.unterwurzacher@theobroma-systems.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Acked-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
board/theobroma-systems/puma_rk3399/puma-rk3399.c

index 0ad267cdd07b5db5a04fe1e138be69d9484cec16..27e3823d525c01952a2904564e87de0838329447 100644 (file)
@@ -173,7 +173,7 @@ static void setup_serial(void)
 
        serialno = crc32_no_comp(0, low, 8);
        serialno |= (u64)crc32_no_comp(serialno, high, 8) << 32;
-       snprintf(serialno_str, sizeof(serialno_str), "%llx", serialno);
+       snprintf(serialno_str, sizeof(serialno_str), "%016llx", serialno);
 
        env_set("cpuid#", cpuid_str);
        env_set("serial#", serialno_str);