* [PATCH] ethernet: ti: am65-cpts: Add missing inline qualifier to stub functions
@ 2020-05-15 22:33 Nathan Chancellor
2020-05-15 23:33 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Nathan Chancellor @ 2020-05-15 22:33 UTC (permalink / raw)
To: David S. Miller, Jakub Kicinski
Cc: netdev, linux-kernel, clang-built-linux, Nathan Chancellor
When building with Clang:
In file included from drivers/net/ethernet/ti/am65-cpsw-ethtool.c:15:
drivers/net/ethernet/ti/am65-cpts.h:58:12: warning: unused function
'am65_cpts_ns_gettime' [-Wunused-function]
static s64 am65_cpts_ns_gettime(struct am65_cpts *cpts)
^
drivers/net/ethernet/ti/am65-cpts.h:63:12: warning: unused function
'am65_cpts_estf_enable' [-Wunused-function]
static int am65_cpts_estf_enable(struct am65_cpts *cpts,
^
drivers/net/ethernet/ti/am65-cpts.h:69:13: warning: unused function
'am65_cpts_estf_disable' [-Wunused-function]
static void am65_cpts_estf_disable(struct am65_cpts *cpts, int idx)
^
3 warnings generated.
These functions need to be marked as inline, which adds __maybe_unused,
to avoid these warnings, which is the pattern for stub functions.
Fixes: ec008fa2a9e5 ("ethernet: ti: am65-cpts: add routines to support taprio offload")
Link: https://github.com/ClangBuiltLinux/linux/issues/1026
Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
---
drivers/net/ethernet/ti/am65-cpts.h | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/ti/am65-cpts.h b/drivers/net/ethernet/ti/am65-cpts.h
index 98c1960b20b9..cf9fbc28fd03 100644
--- a/drivers/net/ethernet/ti/am65-cpts.h
+++ b/drivers/net/ethernet/ti/am65-cpts.h
@@ -55,18 +55,18 @@ static inline void am65_cpts_rx_enable(struct am65_cpts *cpts, bool en)
{
}
-static s64 am65_cpts_ns_gettime(struct am65_cpts *cpts)
+static inline s64 am65_cpts_ns_gettime(struct am65_cpts *cpts)
{
return 0;
}
-static int am65_cpts_estf_enable(struct am65_cpts *cpts,
- int idx, struct am65_cpts_estf_cfg *cfg)
+static inline int am65_cpts_estf_enable(struct am65_cpts *cpts, int idx,
+ struct am65_cpts_estf_cfg *cfg)
{
return 0;
}
-static void am65_cpts_estf_disable(struct am65_cpts *cpts, int idx)
+static inline void am65_cpts_estf_disable(struct am65_cpts *cpts, int idx)
{
}
#endif
base-commit: bdecf38f228bcca73b31ada98b5b7ba1215eb9c9
--
2.26.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ethernet: ti: am65-cpts: Add missing inline qualifier to stub functions
2020-05-15 22:33 [PATCH] ethernet: ti: am65-cpts: Add missing inline qualifier to stub functions Nathan Chancellor
@ 2020-05-15 23:33 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-05-15 23:33 UTC (permalink / raw)
To: natechancellor; +Cc: kuba, netdev, linux-kernel, clang-built-linux
From: Nathan Chancellor <natechancellor@gmail.com>
Date: Fri, 15 May 2020 15:33:18 -0700
> When building with Clang:
>
> In file included from drivers/net/ethernet/ti/am65-cpsw-ethtool.c:15:
> drivers/net/ethernet/ti/am65-cpts.h:58:12: warning: unused function
> 'am65_cpts_ns_gettime' [-Wunused-function]
> static s64 am65_cpts_ns_gettime(struct am65_cpts *cpts)
> ^
> drivers/net/ethernet/ti/am65-cpts.h:63:12: warning: unused function
> 'am65_cpts_estf_enable' [-Wunused-function]
> static int am65_cpts_estf_enable(struct am65_cpts *cpts,
> ^
> drivers/net/ethernet/ti/am65-cpts.h:69:13: warning: unused function
> 'am65_cpts_estf_disable' [-Wunused-function]
> static void am65_cpts_estf_disable(struct am65_cpts *cpts, int idx)
> ^
> 3 warnings generated.
>
> These functions need to be marked as inline, which adds __maybe_unused,
> to avoid these warnings, which is the pattern for stub functions.
>
> Fixes: ec008fa2a9e5 ("ethernet: ti: am65-cpts: add routines to support taprio offload")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1026
> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-05-15 23:33 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-15 22:33 [PATCH] ethernet: ti: am65-cpts: Add missing inline qualifier to stub functions Nathan Chancellor
2020-05-15 23:33 ` David Miller
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).