public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Philippe Schenker <dev@pschenker.ch>
To: u-boot@lists.denx.de
Cc: francesco.dolcini@toradex.com, marcel.ziswiler@toradex.com,
	Philippe Schenker <philippe.schenker@toradex.com>,
	Oleksandr Suvorov <oleksandr.suvorov@toradex.com>,
	Stefan Agner <stefan.agner@toradex.com>
Subject: [PATCH 2/3] toradex: tdx-cfg-block: use defines for string length
Date: Mon, 13 Jun 2022 19:35:22 +0200	[thread overview]
Message-ID: <20220613173523.250697-2-dev@pschenker.ch> (raw)
In-Reply-To: <20220613173523.250697-1-dev@pschenker.ch>

From: Philippe Schenker <philippe.schenker@toradex.com>

With those defines the length can be reused and is in one place
extendable.

Signed-off-by: Philippe Schenker <philippe.schenker@toradex.com>
---

 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


  reply	other threads:[~2022-06-13 17:35 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-13 17:35 [PATCH 1/3] toradex: tdx-cfg-block: use only snprintf Philippe Schenker
2022-06-13 17:35 ` Philippe Schenker [this message]
2022-06-15 11:59   ` [PATCH 2/3] toradex: tdx-cfg-block: use defines for string length Francesco Dolcini
2022-06-30 11:57   ` Marcel Ziswiler
2022-07-07  1:55   ` Tom Rini
2022-06-13 17:35 ` [PATCH 3/3] toradex: tdx-cfg-block: extend assembly version Philippe Schenker
2022-06-15 11:59   ` Francesco Dolcini
2022-06-30 12:31   ` Marcel Ziswiler
2022-07-07  1:55   ` Tom Rini
2022-06-15 11:59 ` [PATCH 1/3] toradex: tdx-cfg-block: use only snprintf Francesco Dolcini
2022-06-30 11:55 ` Marcel Ziswiler
2022-07-07  1:55 ` Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220613173523.250697-2-dev@pschenker.ch \
    --to=dev@pschenker.ch \
    --cc=francesco.dolcini@toradex.com \
    --cc=marcel.ziswiler@toradex.com \
    --cc=oleksandr.suvorov@toradex.com \
    --cc=philippe.schenker@toradex.com \
    --cc=stefan.agner@toradex.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox