From patchwork Thu Dec 7 15:20:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jakob Unterwurzacher X-Patchwork-Id: 845635 X-Patchwork-Delegate: philipp.tomsich@theobroma-systems.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3yszhf3wlbz9t3B for ; Fri, 8 Dec 2017 02:21:05 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 623ADC21F83; Thu, 7 Dec 2017 15:20:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 281C5C21ED9; Thu, 7 Dec 2017 15:20:52 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6ACE9C21E14; Thu, 7 Dec 2017 15:20:50 +0000 (UTC) Received: from mail.theobroma-systems.com (vegas.theobroma-systems.com [144.76.126.164]) by lists.denx.de (Postfix) with ESMTPS id 0D8C1C21E14 for ; Thu, 7 Dec 2017 15:20:50 +0000 (UTC) Received: from [86.59.122.178] (port=53308 helo=blau.lan) by mail.theobroma-systems.com with esmtps (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1eMxyg-0001YQ-VB; Thu, 07 Dec 2017 16:20:47 +0100 Received: from junterwurzacher by blau.lan with local (Exim 4.89) (envelope-from ) id 1eMxyg-0003np-HW; Thu, 07 Dec 2017 16:20:46 +0100 From: Jakob Unterwurzacher To: u-boot@lists.denx.de Date: Thu, 7 Dec 2017 16:20:44 +0100 Message-Id: <20171207152044.14572-1-jakob.unterwurzacher@theobroma-systems.com> X-Mailer: git-send-email 2.11.0 Cc: Klaus Goger , Jakob Unterwurzacher Subject: [U-Boot] [PATCH] rockchip: rk3399-puma: preserve leading zeros in serial# X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" 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 Reviewed-by: Philipp Tomsich Acked-by: Philipp Tomsich --- board/theobroma-systems/puma_rk3399/puma-rk3399.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/theobroma-systems/puma_rk3399/puma-rk3399.c b/board/theobroma-systems/puma_rk3399/puma-rk3399.c index 26c4535f1b..737206ae0f 100644 --- a/board/theobroma-systems/puma_rk3399/puma-rk3399.c +++ b/board/theobroma-systems/puma_rk3399/puma-rk3399.c @@ -138,7 +138,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);