All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH] xtensa: setup: use CONFIG_USE_OF instead of CONFIG_OF
@ 2021-09-25  3:29 Randy Dunlap
  2021-09-26 18:55 ` Max Filippov
  0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2021-09-25  3:29 UTC (permalink / raw)
  To: linux-kernel; +Cc: Randy Dunlap, Max Filippov, Chris Zankel, linux-xtensa

CONFIG_OF can be set by a randconfig or by a user -- without setting the
early flattree option (OF_EARLY_FLATTREE).  This causes build errors.
However, if randconfig or a user sets USE_OF in the Xtensa config,
the right kconfig symbols are set to enable xtensa/kernel/setup.c to
build.

Fixes these build errors:

../arch/xtensa/kernel/setup.c: In function 'xtensa_dt_io_area':
../arch/xtensa/kernel/setup.c:201:14: error: implicit declaration of function 'of_flat_dt_is_compatible'; did you mean 'of_machine_is_compatible'? [-Werror=implicit-function-declaration]
  201 |         if (!of_flat_dt_is_compatible(node, "simple-bus"))
../arch/xtensa/kernel/setup.c:204:18: error: implicit declaration of function 'of_get_flat_dt_prop' [-Werror=implicit-function-declaration]
  204 |         ranges = of_get_flat_dt_prop(node, "ranges", &len);
../arch/xtensa/kernel/setup.c:204:16: error: assignment to 'const __be32 *' {aka 'const unsigned int *'} from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
  204 |         ranges = of_get_flat_dt_prop(node, "ranges", &len);
      |                ^
../arch/xtensa/kernel/setup.c: In function 'early_init_devtree':
../arch/xtensa/kernel/setup.c:228:9: error: implicit declaration of function 'early_init_dt_scan'; did you mean 'early_init_devtree'? [-Werror=implicit-function-declaration]
  228 |         early_init_dt_scan(params);
../arch/xtensa/kernel/setup.c:229:9: error: implicit declaration of function 'of_scan_flat_dt' [-Werror=implicit-function-declaration]
  229 |         of_scan_flat_dt(xtensa_dt_io_area, NULL);

Fixes: da844a81779e ("xtensa: add device trees support")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: Chris Zankel <chris@zankel.net>
Cc: linux-xtensa@linux-xtensa.org
---
 arch/xtensa/kernel/setup.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--- linux-next-20210917.orig/arch/xtensa/kernel/setup.c
+++ linux-next-20210917/arch/xtensa/kernel/setup.c
@@ -183,7 +183,7 @@ static int __init parse_bootparam(const
 }
 #endif
 
-#ifdef CONFIG_OF
+#ifdef CONFIG_USE_OF
 
 #if !XCHAL_HAVE_PTP_MMU || XCHAL_HAVE_SPANNING_WAY
 unsigned long xtensa_kio_paddr = XCHAL_KIO_DEFAULT_PADDR;
@@ -232,7 +232,7 @@ void __init early_init_devtree(void *par
 		strlcpy(command_line, boot_command_line, COMMAND_LINE_SIZE);
 }
 
-#endif /* CONFIG_OF */
+#endif /* CONFIG_USE_OF */
 
 /*
  * Initialize architecture. (Early stage)
@@ -253,7 +253,7 @@ void __init init_arch(bp_tag_t *bp_start
 	if (bp_start)
 		parse_bootparam(bp_start);
 
-#ifdef CONFIG_OF
+#ifdef CONFIG_USE_OF
 	early_init_devtree(dtb_start);
 #endif
 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC PATCH] xtensa: setup: use CONFIG_USE_OF instead of CONFIG_OF
  2021-09-25  3:29 [RFC PATCH] xtensa: setup: use CONFIG_USE_OF instead of CONFIG_OF Randy Dunlap
@ 2021-09-26 18:55 ` Max Filippov
  2021-09-26 21:48   ` Randy Dunlap
  0 siblings, 1 reply; 3+ messages in thread
From: Max Filippov @ 2021-09-26 18:55 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: LKML, Chris Zankel, open list:TENSILICA XTENSA PORT (xtensa)

Hi Randy,

On Fri, Sep 24, 2021 at 8:29 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>
> CONFIG_OF can be set by a randconfig or by a user -- without setting the
> early flattree option (OF_EARLY_FLATTREE).  This causes build errors.
> However, if randconfig or a user sets USE_OF in the Xtensa config,
> the right kconfig symbols are set to enable xtensa/kernel/setup.c to
> build.
>
> Fixes these build errors:
>
> ../arch/xtensa/kernel/setup.c: In function 'xtensa_dt_io_area':
> ../arch/xtensa/kernel/setup.c:201:14: error: implicit declaration of function 'of_flat_dt_is_compatible'; did you mean 'of_machine_is_compatible'? [-Werror=implicit-function-declaration]
>   201 |         if (!of_flat_dt_is_compatible(node, "simple-bus"))
> ../arch/xtensa/kernel/setup.c:204:18: error: implicit declaration of function 'of_get_flat_dt_prop' [-Werror=implicit-function-declaration]
>   204 |         ranges = of_get_flat_dt_prop(node, "ranges", &len);
> ../arch/xtensa/kernel/setup.c:204:16: error: assignment to 'const __be32 *' {aka 'const unsigned int *'} from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
>   204 |         ranges = of_get_flat_dt_prop(node, "ranges", &len);
>       |                ^
> ../arch/xtensa/kernel/setup.c: In function 'early_init_devtree':
> ../arch/xtensa/kernel/setup.c:228:9: error: implicit declaration of function 'early_init_dt_scan'; did you mean 'early_init_devtree'? [-Werror=implicit-function-declaration]
>   228 |         early_init_dt_scan(params);
> ../arch/xtensa/kernel/setup.c:229:9: error: implicit declaration of function 'of_scan_flat_dt' [-Werror=implicit-function-declaration]
>   229 |         of_scan_flat_dt(xtensa_dt_io_area, NULL);
>
> Fixes: da844a81779e ("xtensa: add device trees support")
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Max Filippov <jcmvbkbc@gmail.com>
> Cc: Chris Zankel <chris@zankel.net>
> Cc: linux-xtensa@linux-xtensa.org
> ---
>  arch/xtensa/kernel/setup.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Thanks for your RFC. I've tested it and found a couple more places
where CONFIG_USE_OF should be used instead of CONFIG_OF.
I'll post the revised version.

-- 
Thanks.
-- Max

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC PATCH] xtensa: setup: use CONFIG_USE_OF instead of CONFIG_OF
  2021-09-26 18:55 ` Max Filippov
@ 2021-09-26 21:48   ` Randy Dunlap
  0 siblings, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2021-09-26 21:48 UTC (permalink / raw)
  To: Max Filippov; +Cc: LKML, Chris Zankel, open list:TENSILICA XTENSA PORT (xtensa)

On 9/26/21 11:55 AM, Max Filippov wrote:
> Hi Randy,
> 
> On Fri, Sep 24, 2021 at 8:29 PM Randy Dunlap <rdunlap@infradead.org> wrote:
>>
>> CONFIG_OF can be set by a randconfig or by a user -- without setting the
>> early flattree option (OF_EARLY_FLATTREE).  This causes build errors.
>> However, if randconfig or a user sets USE_OF in the Xtensa config,
>> the right kconfig symbols are set to enable xtensa/kernel/setup.c to
>> build.
>>
>> Fixes these build errors:
>>
>> ../arch/xtensa/kernel/setup.c: In function 'xtensa_dt_io_area':
>> ../arch/xtensa/kernel/setup.c:201:14: error: implicit declaration of function 'of_flat_dt_is_compatible'; did you mean 'of_machine_is_compatible'? [-Werror=implicit-function-declaration]
>>    201 |         if (!of_flat_dt_is_compatible(node, "simple-bus"))
>> ../arch/xtensa/kernel/setup.c:204:18: error: implicit declaration of function 'of_get_flat_dt_prop' [-Werror=implicit-function-declaration]
>>    204 |         ranges = of_get_flat_dt_prop(node, "ranges", &len);
>> ../arch/xtensa/kernel/setup.c:204:16: error: assignment to 'const __be32 *' {aka 'const unsigned int *'} from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
>>    204 |         ranges = of_get_flat_dt_prop(node, "ranges", &len);
>>        |                ^
>> ../arch/xtensa/kernel/setup.c: In function 'early_init_devtree':
>> ../arch/xtensa/kernel/setup.c:228:9: error: implicit declaration of function 'early_init_dt_scan'; did you mean 'early_init_devtree'? [-Werror=implicit-function-declaration]
>>    228 |         early_init_dt_scan(params);
>> ../arch/xtensa/kernel/setup.c:229:9: error: implicit declaration of function 'of_scan_flat_dt' [-Werror=implicit-function-declaration]
>>    229 |         of_scan_flat_dt(xtensa_dt_io_area, NULL);
>>
>> Fixes: da844a81779e ("xtensa: add device trees support")
>> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
>> Cc: Max Filippov <jcmvbkbc@gmail.com>
>> Cc: Chris Zankel <chris@zankel.net>
>> Cc: linux-xtensa@linux-xtensa.org
>> ---
>>   arch/xtensa/kernel/setup.c |    6 +++---
>>   1 file changed, 3 insertions(+), 3 deletions(-)
> 
> Thanks for your RFC. I've tested it and found a couple more places
> where CONFIG_USE_OF should be used instead of CONFIG_OF.
> I'll post the revised version.
> 

Hi Max,
Thanks for checking and for the extra fixes.
Looks good.

-- 
~Randy

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-26 21:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-25  3:29 [RFC PATCH] xtensa: setup: use CONFIG_USE_OF instead of CONFIG_OF Randy Dunlap
2021-09-26 18:55 ` Max Filippov
2021-09-26 21:48   ` Randy Dunlap

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.