Commit 463942d
of/fdt: Fix the len check in early_init_dt_check_for_usable_mem_range()
The len value is in bytes, while `dt_root_addr_cells + dt_root_size_cells`
is in cells (4 bytes per cell). Modulo calculation between them is
incorrect, the units must be converted first.
Use helper functions to simplify the code and fix this issue.
Fixes: fb319e7 ("of: fdt: Add memory for devices by DT property "linux,usable-memory-range"")
Fixes: 2af2b50 ("of: fdt: Add generic support for handling usable memory range property")
Fixes: 8f579b1 ("arm64: limit memory regions based on DT property, usable-memory-range")
Signed-off-by: Yuntao Wang <yuntao.wang@linux.dev>
Link: https://patch.msgid.link/20251115134753.179931-4-yuntao.wang@linux.dev
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>1 parent bec5f60 commit 463942d
1 file changed
Lines changed: 11 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
884 | 884 | | |
885 | 885 | | |
886 | 886 | | |
887 | | - | |
| 887 | + | |
888 | 888 | | |
| 889 | + | |
889 | 890 | | |
890 | 891 | | |
891 | 892 | | |
892 | 893 | | |
893 | 894 | | |
894 | 895 | | |
895 | 896 | | |
896 | | - | |
897 | | - | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
898 | 900 | | |
899 | 901 | | |
900 | | - | |
901 | | - | |
902 | | - | |
903 | | - | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
904 | 908 | | |
905 | 909 | | |
906 | 910 | | |
| |||
0 commit comments