From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C6BDDC433EF for ; Mon, 13 Jun 2022 17:35:45 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B26458447D; Mon, 13 Jun 2022 19:35:37 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=pschenker.ch Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=pschenker.ch header.i=@pschenker.ch header.b="x0QuZBdy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 26EED84472; Mon, 13 Jun 2022 19:35:33 +0200 (CEST) Received: from smtp-190a.mail.infomaniak.ch (smtp-190a.mail.infomaniak.ch [IPv6:2001:1600:4:17::190a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3C6FE84479 for ; Mon, 13 Jun 2022 19:35:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=pschenker.ch Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=dev@pschenker.ch Received: from smtp-2-0000.mail.infomaniak.ch (unknown [10.5.36.107]) by smtp-3-3000.mail.infomaniak.ch (Postfix) with ESMTPS id 4LMJcd6QnhzMq57H; Mon, 13 Jun 2022 19:35:29 +0200 (CEST) Received: from localhost.localdomain (unknown [37.17.235.5]) by smtp-2-0000.mail.infomaniak.ch (Postfix) with ESMTPA id 4LMJcd4zbjzlpqt7; Mon, 13 Jun 2022 19:35:29 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=pschenker.ch; s=20220412; t=1655141729; bh=jQ4+gEW6W0h3ArNRvpmsWTBbwc0xsLgmoRS8kx3KQkg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x0QuZBdyJILU0xZ/0XCziUZPduhI9vvOjlG8Vutl+umIYS8clvhVKNFj4BoRAtVND 5VTmC+TgF9QpuUHICV9JLzQw2dxn/ZIeyUxWiZB4fKT188jjfxzAdI9heX9FmOPMgy h+XmC54aObTjH/IoEsGO00VFTGNr+DTLSpsrlwME= From: Philippe Schenker To: u-boot@lists.denx.de Cc: francesco.dolcini@toradex.com, marcel.ziswiler@toradex.com, Philippe Schenker , Oleksandr Suvorov , Stefan Agner Subject: [PATCH 2/3] toradex: tdx-cfg-block: use defines for string length Date: Mon, 13 Jun 2022 19:35:22 +0200 Message-Id: <20220613173523.250697-2-dev@pschenker.ch> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613173523.250697-1-dev@pschenker.ch> References: <20220613173523.250697-1-dev@pschenker.ch> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean From: Philippe Schenker With those defines the length can be reused and is in one place extendable. Signed-off-by: Philippe Schenker --- board/toradex/common/tdx-common.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/board/toradex/common/tdx-common.c b/board/toradex/common/tdx-common.c index 2207818447..94e603c14f 100644 --- a/board/toradex/common/tdx-common.c +++ b/board/toradex/common/tdx-common.c @@ -22,13 +22,17 @@ #define TORADEX_OUI 0x00142dUL +#define SERIAL_STR_LEN 8 +#define MODULE_VER_STR_LEN 4 // V1.1 +#define MODULE_REV_STR_LEN 1 // [A-Z] + #ifdef CONFIG_TDX_CFG_BLOCK -static char tdx_serial_str[9]; -static char tdx_board_rev_str[6]; +static char tdx_serial_str[SERIAL_STR_LEN + 1]; +static char tdx_board_rev_str[MODULE_VER_STR_LEN + MODULE_REV_STR_LEN + 1]; #ifdef CONFIG_TDX_CFG_BLOCK_EXTRA -static char tdx_car_serial_str[9]; -static char tdx_car_rev_str[6]; +static char tdx_car_serial_str[SERIAL_STR_LEN + 1]; +static char tdx_car_rev_str[MODULE_VER_STR_LEN + MODULE_REV_STR_LEN + 1]; static char *tdx_carrier_board_name; #endif -- 2.36.1