diff options
author | Oleksandr Tymoshenko <ovt@google.com> | 2025-01-06 04:41:16 +0000 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2025-01-09 11:35:00 +0000 |
commit | 9bb11cad9db17dd790f82b1b0fdba0847086e3e1 (patch) | |
tree | 3d376c698f408f5999ad06d35fac77c1353f6d01 /EmbeddedPkg | |
parent | 107981f3f0312175f597543ce249d730432969f2 (diff) | |
download | edk2-9bb11cad9db17dd790f82b1b0fdba0847086e3e1.tar.gz |
EmbeddedPkg: Remove misleading error message in FindNextMemoryNodeReg
FindNextMemoryNodeReg prints "ignoring disabled memory node" for all
top-level disabled nodes in the tree, not just the ones with the
"device_type" property set to "memory". Rework the loop to only print
the message for the relevant nodes.
Signed-off-by: Oleksandr Tymoshenko <ovt@google.com>
Diffstat (limited to 'EmbeddedPkg')
-rw-r--r-- | EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.c | 62 |
1 files changed, 32 insertions, 30 deletions
diff --git a/EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.c b/EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.c index 7da505a313..42d9281b29 100644 --- a/EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.c +++ b/EmbeddedPkg/Drivers/FdtClientDxe/FdtClientDxe.c @@ -262,43 +262,45 @@ FindNextMemoryNodeReg ( break;
}
+ DeviceType = fdt_getprop (mDeviceTreeBase, Next, "device_type", &Len);
+ if ((DeviceType == NULL) || (AsciiStrCmp (DeviceType, "memory") != 0)) {
+ continue;
+ }
+
if (!IsNodeEnabled (Next)) {
DEBUG ((DEBUG_WARN, "%a: ignoring disabled memory node\n", __func__));
continue;
}
- DeviceType = fdt_getprop (mDeviceTreeBase, Next, "device_type", &Len);
- if ((DeviceType != NULL) && (AsciiStrCmp (DeviceType, "memory") == 0)) {
- //
- // Get the 'reg' property of this memory node. For now, we will assume
- // 8 byte quantities for base and size, respectively.
- // TODO use #cells root properties instead
- //
- Status = GetNodeProperty (This, Next, "reg", Reg, RegSize);
- if (EFI_ERROR (Status)) {
- DEBUG ((
- DEBUG_WARN,
- "%a: ignoring memory node with no 'reg' property\n",
- __func__
- ));
- continue;
- }
-
- if ((*RegSize % 16) != 0) {
- DEBUG ((
- DEBUG_WARN,
- "%a: ignoring memory node with invalid 'reg' property (size == 0x%x)\n",
- __func__,
- *RegSize
- ));
- continue;
- }
+ //
+ // Get the 'reg' property of this memory node. For now, we will assume
+ // 8 byte quantities for base and size, respectively.
+ // TODO use #cells root properties instead
+ //
+ Status = GetNodeProperty (This, Next, "reg", Reg, RegSize);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((
+ DEBUG_WARN,
+ "%a: ignoring memory node with no 'reg' property\n",
+ __func__
+ ));
+ continue;
+ }
- *Node = Next;
- *AddressCells = 2;
- *SizeCells = 2;
- return EFI_SUCCESS;
+ if ((*RegSize % 16) != 0) {
+ DEBUG ((
+ DEBUG_WARN,
+ "%a: ignoring memory node with invalid 'reg' property (size == 0x%x)\n",
+ __func__,
+ *RegSize
+ ));
+ continue;
}
+
+ *Node = Next;
+ *AddressCells = 2;
+ *SizeCells = 2;
+ return EFI_SUCCESS;
}
return EFI_NOT_FOUND;
|