diff mbox series

[net-next,1/2] net: add EXPORT_INDIRECT_CALLABLE wrapper

Message ID 20210204181839.558951-1-brianvv@google.com (mailing list archive)
State Accepted
Commit 0053859496baa17c7675526936677c9213bf5a0d
Delegated to: Netdev Maintainers
Headers show
Series [net-next,1/2] net: add EXPORT_INDIRECT_CALLABLE wrapper | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers warning 1 maintainers not CCed: pabeni@redhat.com
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 4463 this patch: 4463
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 4844 this patch: 4844
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

Brian Vazquez Feb. 4, 2021, 6:18 p.m. UTC
When a static function is annotated with INDIRECT_CALLABLE_SCOPE and
CONFIG_RETPOLINE is set, the static keyword is removed. Sometimes the
function needs to be exported but EXPORT_SYMBOL can't be used because if
CONFIG_RETPOLINE is not set, we will attempt to export a static symbol.

This patch introduces a new indirect call wrapper:
EXPORT_INDIRECT_CALLABLE. This basically does EXPORT_SYMBOL when
CONFIG_RETPOLINE is set, but does nothing when it's not.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Brian Vazquez <brianvv@google.com>
---
 include/linux/indirect_call_wrapper.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

patchwork-bot+netdevbpf@kernel.org Feb. 5, 2021, 2:30 a.m. UTC | #1
Hello:

This series was applied to netdev/net-next.git (refs/heads/master):

On Thu,  4 Feb 2021 18:18:38 +0000 you wrote:
> When a static function is annotated with INDIRECT_CALLABLE_SCOPE and
> CONFIG_RETPOLINE is set, the static keyword is removed. Sometimes the
> function needs to be exported but EXPORT_SYMBOL can't be used because if
> CONFIG_RETPOLINE is not set, we will attempt to export a static symbol.
> 
> This patch introduces a new indirect call wrapper:
> EXPORT_INDIRECT_CALLABLE. This basically does EXPORT_SYMBOL when
> CONFIG_RETPOLINE is set, but does nothing when it's not.
> 
> [...]

Here is the summary with links:
  - [net-next,1/2] net: add EXPORT_INDIRECT_CALLABLE wrapper
    https://git.kernel.org/netdev/net-next/c/0053859496ba
  - [net-next,2/2] net: fix building errors on powerpc when CONFIG_RETPOLINE is not set
    https://git.kernel.org/netdev/net-next/c/9c97921a51a0

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

Patch

diff --git a/include/linux/indirect_call_wrapper.h b/include/linux/indirect_call_wrapper.h
index 54c02c84906a..a8345c8a613d 100644
--- a/include/linux/indirect_call_wrapper.h
+++ b/include/linux/indirect_call_wrapper.h
@@ -36,6 +36,7 @@ 
 
 #define INDIRECT_CALLABLE_DECLARE(f)	f
 #define INDIRECT_CALLABLE_SCOPE
+#define EXPORT_INDIRECT_CALLABLE(f)	EXPORT_SYMBOL(f)
 
 #else
 #define INDIRECT_CALL_1(f, f1, ...) f(__VA_ARGS__)
@@ -44,6 +45,7 @@ 
 #define INDIRECT_CALL_4(f, f4, f3, f2, f1, ...) f(__VA_ARGS__)
 #define INDIRECT_CALLABLE_DECLARE(f)
 #define INDIRECT_CALLABLE_SCOPE		static
+#define EXPORT_INDIRECT_CALLABLE(f)
 #endif
 
 /*