[PATCH v2 0/7] of/fdt: Some bug fixes and cleanups

Yuntao Wang posted 7 patches 2 months, 3 weeks ago
There is a newer version of this series
drivers/of/fdt.c             | 93 ++++++++++++++++++++++--------------
drivers/of/of_reserved_mem.c | 37 ++++----------
include/linux/of_fdt.h       |  5 ++
3 files changed, 72 insertions(+), 63 deletions(-)
[PATCH v2 0/7] of/fdt: Some bug fixes and cleanups
Posted by Yuntao Wang 2 months, 3 weeks ago
This patch series fixes several bugs related to dt_root_addr_cells and
dt_root_size_cells, and performs some cleanup.

Changelog:

v1: Consolidate duplicate code into helper functions

Links:

v1: https://lore.kernel.org/linux-devicetree/20251112143520.233870-11-yuntao.wang@linux.dev/t/

Yuntao Wang (7):
  of/fdt: Consolidate duplicate code into helper functions
  of/fdt: Fix the len check in early_init_dt_check_for_elfcorehdr()
  of/fdt: Fix the len check in
    early_init_dt_check_for_usable_mem_range()
  of/fdt: Fix incorrect use of dt_root_addr_cells in
    early_init_dt_check_kho()
  of/fdt: Simplify the logic of early_init_dt_scan_memory()
  of/reserved_mem: Simplify the logic of __reserved_mem_reserve_reg()
  of/reserved_mem: Simplify the logic of
    fdt_scan_reserved_mem_reg_nodes()

 drivers/of/fdt.c             | 93 ++++++++++++++++++++++--------------
 drivers/of/of_reserved_mem.c | 37 ++++----------
 include/linux/of_fdt.h       |  5 ++
 3 files changed, 72 insertions(+), 63 deletions(-)

-- 
2.51.0
Re: [PATCH v2 0/7] of/fdt: Some bug fixes and cleanups
Posted by Krzysztof Kozlowski 2 months, 3 weeks ago
On Thu, Nov 13, 2025 at 11:50:57PM +0800, Yuntao Wang wrote:
> This patch series fixes several bugs related to dt_root_addr_cells and
> dt_root_size_cells, and performs some cleanup.
> 
> Changelog:
> 
> v1: Consolidate duplicate code into helper functions

Your patchset has multiple checkpatch warnings and errors. In multiple
patches.

Please run scripts/checkpatch.pl on the patches and fix reported
warnings. After that, run also 'scripts/checkpatch.pl --strict' on the
patches and (probably) fix more warnings. Some warnings can be ignored,
especially from --strict run, but the code here looks like it needs a
fix. Feel free to get in touch if the warning is not clear.

Please run standard kernel tools for static analysis, like coccinelle,
smatch and sparse, and fix reported warnings. Also please check for
warnings when building with W=1 for gcc and clang. Most of these
commands (checks or W=1 build) can build specific targets, like some
directory, to narrow the scope to only your code. The code here looks
like it needs a fix. Feel free to get in touch if the warning is not
clear.

Best regards,
Krzysztof
Re: [PATCH v2 0/7] of/fdt: Some bug fixes and cleanups
Posted by Yuntao Wang 2 months, 3 weeks ago
On Fri, 14 Nov 2025 09:04:30 +0100, Krzysztof Kozlowski <krzk@kernel.org> wrote:

> On Thu, Nov 13, 2025 at 11:50:57PM +0800, Yuntao Wang wrote:
> > This patch series fixes several bugs related to dt_root_addr_cells and
> > dt_root_size_cells, and performs some cleanup.
> >
> > Changelog:
> >
> > v1: Consolidate duplicate code into helper functions
>
> Your patchset has multiple checkpatch warnings and errors. In multiple
> patches.
>
> Please run scripts/checkpatch.pl on the patches and fix reported
> warnings. After that, run also 'scripts/checkpatch.pl --strict' on the
> patches and (probably) fix more warnings. Some warnings can be ignored,
> especially from --strict run, but the code here looks like it needs a
> fix. Feel free to get in touch if the warning is not clear.
>
> Please run standard kernel tools for static analysis, like coccinelle,
> smatch and sparse, and fix reported warnings. Also please check for
> warnings when building with W=1 for gcc and clang. Most of these
> commands (checks or W=1 build) can build specific targets, like some
> directory, to narrow the scope to only your code. The code here looks
> like it needs a fix. Feel free to get in touch if the warning is not
> clear.
>
> Best regards,
> Krzysztof

Hi Krzysztof,

Many thanks for pointing out these issues, they have been fixed in the new patch series:

https://lore.kernel.org/linux-devicetree/20251115134753.179931-1-yuntao.wang@linux.dev/

Thanks,
Yuntao
Re: [PATCH v2 0/7] of/fdt: Some bug fixes and cleanups
Posted by Krzysztof Kozlowski 2 months, 3 weeks ago
On 15/11/2025 15:07, Yuntao Wang wrote:
> On Fri, 14 Nov 2025 09:04:30 +0100, Krzysztof Kozlowski <krzk@kernel.org> wrote:
> 
>> On Thu, Nov 13, 2025 at 11:50:57PM +0800, Yuntao Wang wrote:
>>> This patch series fixes several bugs related to dt_root_addr_cells and
>>> dt_root_size_cells, and performs some cleanup.
>>>
>>> Changelog:
>>>
>>> v1: Consolidate duplicate code into helper functions
>>
>> Your patchset has multiple checkpatch warnings and errors. In multiple
>> patches.
>>
>> Please run scripts/checkpatch.pl on the patches and fix reported
>> warnings. After that, run also 'scripts/checkpatch.pl --strict' on the
>> patches and (probably) fix more warnings. Some warnings can be ignored,
>> especially from --strict run, but the code here looks like it needs a
>> fix. Feel free to get in touch if the warning is not clear.
>>
>> Please run standard kernel tools for static analysis, like coccinelle,
>> smatch and sparse, and fix reported warnings. Also please check for
>> warnings when building with W=1 for gcc and clang. Most of these
>> commands (checks or W=1 build) can build specific targets, like some
>> directory, to narrow the scope to only your code. The code here looks
>> like it needs a fix. Feel free to get in touch if the warning is not
>> clear.
>>
>> Best regards,
>> Krzysztof
> 
> Hi Krzysztof,
> 
> Many thanks for pointing out these issues, they have been fixed in the new patch series:
> 
> https://lore.kernel.org/linux-devicetree/20251115134753.179931-1-yuntao.wang@linux.dev/

Not really. I don't think you run checkpatch.

Best regards,
Krzysztof