]> git.baikalelectronics.ru Git - kernel.git/commitdiff
ethernet: ti: am65-cpts: Add missing inline qualifier to stub functions
authorNathan Chancellor <natechancellor@gmail.com>
Fri, 15 May 2020 22:33:18 +0000 (15:33 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 15 May 2020 23:32:27 +0000 (16:32 -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: bd79fd79ba78 ("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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/ti/am65-cpts.h

index 98c1960b20b9d09442930be8eadb5c6b82c403e6..cf9fbc28fd032c795b80e0dba2c89d04d81cbddb 100644 (file)
@@ -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