mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 02:39:48 +00:00
![Nathan Chancellor](/assets/img/avatar_default.png)
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: ec008fa2a9
("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>
74 lines
1.8 KiB
C
74 lines
1.8 KiB
C
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
/* TI K3 AM65 CPTS driver interface
|
|
*
|
|
* Copyright (C) 2020 Texas Instruments Incorporated - http://www.ti.com
|
|
*/
|
|
|
|
#ifndef K3_CPTS_H_
|
|
#define K3_CPTS_H_
|
|
|
|
#include <linux/device.h>
|
|
#include <linux/of.h>
|
|
|
|
struct am65_cpts;
|
|
|
|
struct am65_cpts_estf_cfg {
|
|
u64 ns_period;
|
|
u64 ns_start;
|
|
};
|
|
|
|
#if IS_ENABLED(CONFIG_TI_K3_AM65_CPTS)
|
|
struct am65_cpts *am65_cpts_create(struct device *dev, void __iomem *regs,
|
|
struct device_node *node);
|
|
int am65_cpts_phc_index(struct am65_cpts *cpts);
|
|
void am65_cpts_tx_timestamp(struct am65_cpts *cpts, struct sk_buff *skb);
|
|
void am65_cpts_prep_tx_timestamp(struct am65_cpts *cpts, struct sk_buff *skb);
|
|
void am65_cpts_rx_enable(struct am65_cpts *cpts, bool en);
|
|
u64 am65_cpts_ns_gettime(struct am65_cpts *cpts);
|
|
int am65_cpts_estf_enable(struct am65_cpts *cpts, int idx,
|
|
struct am65_cpts_estf_cfg *cfg);
|
|
void am65_cpts_estf_disable(struct am65_cpts *cpts, int idx);
|
|
#else
|
|
static inline struct am65_cpts *am65_cpts_create(struct device *dev,
|
|
void __iomem *regs,
|
|
struct device_node *node)
|
|
{
|
|
return ERR_PTR(-EOPNOTSUPP);
|
|
}
|
|
|
|
static inline int am65_cpts_phc_index(struct am65_cpts *cpts)
|
|
{
|
|
return -1;
|
|
}
|
|
|
|
static inline void am65_cpts_tx_timestamp(struct am65_cpts *cpts,
|
|
struct sk_buff *skb)
|
|
{
|
|
}
|
|
|
|
static inline void am65_cpts_prep_tx_timestamp(struct am65_cpts *cpts,
|
|
struct sk_buff *skb)
|
|
{
|
|
}
|
|
|
|
static inline void am65_cpts_rx_enable(struct am65_cpts *cpts, bool en)
|
|
{
|
|
}
|
|
|
|
static inline s64 am65_cpts_ns_gettime(struct am65_cpts *cpts)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline int am65_cpts_estf_enable(struct am65_cpts *cpts, int idx,
|
|
struct am65_cpts_estf_cfg *cfg)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void am65_cpts_estf_disable(struct am65_cpts *cpts, int idx)
|
|
{
|
|
}
|
|
#endif
|
|
|
|
#endif /* K3_CPTS_H_ */
|