lkml.org 
[lkml]   [2025]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v3] of: property: Increase NR_FWNODE_REFERENCE_ARGS
On Mon, Feb 10, 2025 at 11:00:32PM +0800, Zijun Hu wrote:
> From: Zijun Hu <quic_zijuhu@quicinc.com>
>
> Currently, the following two macros have different values:
>
> // The maximal argument count for firmware node reference
> #define NR_FWNODE_REFERENCE_ARGS 8
> // The maximal argument count for DT node reference
> #define MAX_PHANDLE_ARGS 16
>
> It may cause firmware node reference's argument count out of range if
> directly assign DT node reference's argument count to firmware's.
>
> drivers/of/property.c:of_fwnode_get_reference_args() is doing the direct
> assignment, so may cause firmware's argument count @args->nargs got out
> of range, namely, in [9, 16].
>
> Fix by increasing NR_FWNODE_REFERENCE_ARGS to 16 to meet DT requirement.

...

> -#define NR_FWNODE_REFERENCE_ARGS 8
> +#define NR_FWNODE_REFERENCE_ARGS 16

Thinking of the case, perhaps you also want

static_assert(NR_FWNODE_REFERENCE_ARGS == MAX_PHANDLE_ARGS);

to be put somewhere, but I don't think we can do it in this header file.

--
With Best Regards,
Andy Shevchenko



\
 
 \ /
  Last update: 2025-02-10 16:35    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog