From: Conor Dooley <conor@kernel.org>
To: u-boot@lists.denx.de
Cc: conor@kernel.org, Conor Dooley <conor.dooley@microchip.com>,
Padmarao Begari <padmarao.begari@microchip.com>,
Cyril Jean <cyril.jean@microchip.com>,
Tom Rini <trini@konsulko.com>
Subject: [PATCH v1 1/2] board: microchip: icicle: correct type for node offset
Date: Wed, 15 May 2024 16:04:30 +0100 [thread overview]
Message-ID: <20240515150434.406916-2-conor@kernel.org> (raw)
In-Reply-To: <20240515150434.406916-1-conor@kernel.org>
From: Conor Dooley <conor.dooley@microchip.com>
Node offsets returned by libfdt can contain negative error numbers, so
the variable type should be "int". As things stand, if the ethernet
nodes are not found in the early init callback, the if (node < 0) tests
pass and the code errors out while trying to set the local-mac-address
for a non-existent node.
Fixes: 64413e1b7c ("riscv: Add Microchip MPFS Icicle Kit support")
Signed-off-by: Conor Dooley <conor.dooley@microchip.com>
---
board/microchip/mpfs_icicle/mpfs_icicle.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/board/microchip/mpfs_icicle/mpfs_icicle.c b/board/microchip/mpfs_icicle/mpfs_icicle.c
index 7beac33cfb..5fd0ec66a9 100644
--- a/board/microchip/mpfs_icicle/mpfs_icicle.c
+++ b/board/microchip/mpfs_icicle/mpfs_icicle.c
@@ -72,7 +72,7 @@ int board_early_init_f(void)
int board_late_init(void)
{
u32 ret;
- u32 node;
+ int node;
u8 idx;
u8 device_serial_number[16] = { 0 };
unsigned char mac_addr[6];
--
2.43.0
next prev parent reply other threads:[~2024-05-15 15:05 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-15 15:04 [PATCH v1 0/2] Two mpfs icicle init fixes Conor Dooley
2024-05-15 15:04 ` Conor Dooley [this message]
2024-05-30 3:11 ` [PATCH v1 1/2] board: microchip: icicle: correct type for node offset Leo Liang
2024-05-15 15:04 ` [PATCH v1 2/2] board: microchip: icicle: make both ethernets optional Conor Dooley
2024-05-30 3:13 ` Leo Liang
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=20240515150434.406916-2-conor@kernel.org \
--to=conor@kernel.org \
--cc=conor.dooley@microchip.com \
--cc=cyril.jean@microchip.com \
--cc=padmarao.begari@microchip.com \
--cc=trini@konsulko.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.