diff mbox series

xilinx: fru: Replace spaces with \0 in detected revision

Message ID e069e5134e57899e859786ad8ba48721df6df752.1653911444.git.michal.simek@amd.com
State Accepted
Commit 93216276f532c9eed2126860a678a6b4d77dc358
Delegated to: Michal Simek
Headers show
Series xilinx: fru: Replace spaces with \0 in detected revision | expand

Commit Message

Michal Simek May 30, 2022, 11:50 a.m. UTC
Also fix board revision field where spaces are used instead of \0.
The same change was done for board name by commit 530560b6f8eb ("xilinx:
fru: Replace spaces with \0 in detected name").

Signed-off-by: Michal Simek <michal.simek@amd.com>
---

 board/xilinx/common/board.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Michal Simek June 6, 2022, 7:31 a.m. UTC | #1
po 30. 5. 2022 v 13:50 odesílatel Michal Simek <monstr@monstr.eu> napsal:
>
> Also fix board revision field where spaces are used instead of \0.
> The same change was done for board name by commit 530560b6f8eb ("xilinx:
> fru: Replace spaces with \0 in detected name").
>
> Signed-off-by: Michal Simek <michal.simek@amd.com>
> ---
>
>  board/xilinx/common/board.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c
> index 5be3090c3186..629a6ee036ff 100644
> --- a/board/xilinx/common/board.c
> +++ b/board/xilinx/common/board.c
> @@ -245,6 +245,10 @@ static int xilinx_read_eeprom_fru(struct udevice *dev, char *name,
>         }
>         strncpy(desc->revision, (char *)fru_data.brd.rev,
>                 sizeof(desc->revision));
> +       for (i = 0; i < sizeof(desc->revision); i++) {
> +               if (desc->revision[i] == ' ')
> +                       desc->revision[i] = '\0';
> +       }
>         strncpy(desc->serial, (char *)fru_data.brd.serial_number,
>                 sizeof(desc->serial));
>
> --
> 2.36.0
>

Applied.
M
diff mbox series

Patch

diff --git a/board/xilinx/common/board.c b/board/xilinx/common/board.c
index 5be3090c3186..629a6ee036ff 100644
--- a/board/xilinx/common/board.c
+++ b/board/xilinx/common/board.c
@@ -245,6 +245,10 @@  static int xilinx_read_eeprom_fru(struct udevice *dev, char *name,
 	}
 	strncpy(desc->revision, (char *)fru_data.brd.rev,
 		sizeof(desc->revision));
+	for (i = 0; i < sizeof(desc->revision); i++) {
+		if (desc->revision[i] == ' ')
+			desc->revision[i] = '\0';
+	}
 	strncpy(desc->serial, (char *)fru_data.brd.serial_number,
 		sizeof(desc->serial));