soc.lore.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] optee: smc_abi.c: add missing #include <linux/mm.h>
@ 2021-10-21 12:55 Jens Wiklander
  2021-10-21 20:20 ` patchwork-bot+linux-soc
  0 siblings, 1 reply; 2+ messages in thread
From: Jens Wiklander @ 2021-10-21 12:55 UTC (permalink / raw)
  To: SoC Team
  Cc: arm-soc, OP-TEE TrustedFirmware, Linux Kernel Mailing List,
	Arnd Bergmann, Jens Wiklander

Adds missing #include <linux/mm.h> drivers/tee/optee/smc_abi.c to fix
compile errors like:
drivers/tee/optee/smc_abi.c:405:15: error: implicit
declaration of function 'page_to_section'
[-Werror,-Wimplicit-function-declaration]
        optee_page = page_to_phys(*pages) +
                     ^
arch/arm/include/asm/memory.h:148:43: note: expanded from
macro 'page_to_phys'
                                               ^
include/asm-generic/memory_model.h:52:21: note: expanded
from macro 'page_to_pfn'
                    ^
include/asm-generic/memory_model.h:35:14: note: expanded
from macro '__page_to_pfn'
        int __sec = page_to_section(__pg);                      \
                    ^
drivers/tee/optee/smc_abi.c:405:15: note: did you mean
'__nr_to_section'?
arch/arm/include/asm/memory.h:148:43: note: expanded from
macro 'page_to_phys'
                                               ^
include/asm-generic/memory_model.h:52:21: note: expanded
from macro 'page_to_pfn'
                    ^
include/asm-generic/memory_model.h:35:14: note: expanded
from macro '__page_to_pfn'
        int __sec = page_to_section(__pg);                      \
                    ^
include/linux/mmzone.h:1365:35: note: '__nr_to_section'
declared here
static inline struct mem_section *__nr_to_section(unsigned long nr)

Fixes: c51a564a5b48 ("optee: isolate smc abi")
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
---

I wasn't able to reproduce the error above. It obviously involves
CONFIG_SPARSEMEM=y, but something more seems to be needed to trigger the
error. Nonetheless, including <linux/mm.h> should fix the error.

Thanks,
Jens


 drivers/tee/optee/smc_abi.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/tee/optee/smc_abi.c b/drivers/tee/optee/smc_abi.c
index 9a787fb4f5e5..6196d7c3888f 100644
--- a/drivers/tee/optee/smc_abi.c
+++ b/drivers/tee/optee/smc_abi.c
@@ -10,6 +10,7 @@
 #include <linux/errno.h>
 #include <linux/io.h>
 #include <linux/sched.h>
+#include <linux/mm.h>
 #include <linux/module.h>
 #include <linux/of.h>
 #include <linux/of_platform.h>
-- 
2.31.1


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

* Re: [PATCH] optee: smc_abi.c: add missing #include <linux/mm.h>
  2021-10-21 12:55 [PATCH] optee: smc_abi.c: add missing #include <linux/mm.h> Jens Wiklander
@ 2021-10-21 20:20 ` patchwork-bot+linux-soc
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+linux-soc @ 2021-10-21 20:20 UTC (permalink / raw)
  To: Jens Wiklander; +Cc: soc

Hello:

This patch was applied to soc/soc.git (for-next)
by Arnd Bergmann <arnd@arndb.de>:

On Thu, 21 Oct 2021 14:55:39 +0200 you wrote:
> Adds missing #include <linux/mm.h> drivers/tee/optee/smc_abi.c to fix
> compile errors like:
> drivers/tee/optee/smc_abi.c:405:15: error: implicit
> declaration of function 'page_to_section'
> [-Werror,-Wimplicit-function-declaration]
>         optee_page = page_to_phys(*pages) +
>                      ^
> arch/arm/include/asm/memory.h:148:43: note: expanded from
> macro 'page_to_phys'
>                                                ^
> include/asm-generic/memory_model.h:52:21: note: expanded
> from macro 'page_to_pfn'
>                     ^
> include/asm-generic/memory_model.h:35:14: note: expanded
> from macro '__page_to_pfn'
>         int __sec = page_to_section(__pg);                      \
>                     ^
> drivers/tee/optee/smc_abi.c:405:15: note: did you mean
> '__nr_to_section'?
> arch/arm/include/asm/memory.h:148:43: note: expanded from
> macro 'page_to_phys'
>                                                ^
> include/asm-generic/memory_model.h:52:21: note: expanded
> from macro 'page_to_pfn'
>                     ^
> include/asm-generic/memory_model.h:35:14: note: expanded
> from macro '__page_to_pfn'
>         int __sec = page_to_section(__pg);                      \
>                     ^
> include/linux/mmzone.h:1365:35: note: '__nr_to_section'
> declared here
> static inline struct mem_section *__nr_to_section(unsigned long nr)
> 
> [...]

Here is the summary with links:
  - optee: smc_abi.c: add missing #include <linux/mm.h>
    https://git.kernel.org/soc/soc/c/34f3c67b8178

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2021-10-21 20:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-21 12:55 [PATCH] optee: smc_abi.c: add missing #include <linux/mm.h> Jens Wiklander
2021-10-21 20:20 ` patchwork-bot+linux-soc

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).