[PATCH -next] net/mlx5: Add missing inline to stub esw_add_restore_rule

4 views
Skip to first unread message

Nathan Chancellor

unread,
Mar 13, 2020, 11:41:07 PM3/13/20
to pa...@mellanox.com, da...@davemloft.net, jakub.k...@netronome.com, ji...@mellanox.com, net...@vger.kernel.org, oz...@mellanox.com, ro...@mellanox.com, sae...@mellanox.com, vla...@mellanox.com, clang-bu...@googlegroups.com, Nathan Chancellor
When CONFIG_MLX5_ESWITCH is unset, clang warns:

In file included from drivers/net/ethernet/mellanox/mlx5/core/main.c:58:
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h:670:1: warning: unused
function 'esw_add_restore_rule' [-Wunused-function]
esw_add_restore_rule(struct mlx5_eswitch *esw, u32 tag)
^
1 warning generated.

This stub function is missing inline; add it to suppress the warning.

Fixes: 11b717d61526 ("net/mlx5: E-Switch, Get reg_c0 value on CQE")
Signed-off-by: Nathan Chancellor <natecha...@gmail.com>
---
drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
index 2e0417dd8ce3..470a16e63242 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
+++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
@@ -666,7 +666,7 @@ static inline const u32 *mlx5_esw_query_functions(struct mlx5_core_dev *dev)

static inline void mlx5_eswitch_update_num_of_vfs(struct mlx5_eswitch *esw, const int num_vfs) {}

-static struct mlx5_flow_handle *
+static inline struct mlx5_flow_handle *
esw_add_restore_rule(struct mlx5_eswitch *esw, u32 tag)
{
return ERR_PTR(-EOPNOTSUPP);
--
2.26.0.rc1

Nick Desaulniers

unread,
Mar 16, 2020, 2:42:14 PM3/16/20
to Nathan Chancellor, pa...@mellanox.com, David S. Miller, Jakub Kicinski, ji...@mellanox.com, Network Development, oz...@mellanox.com, ro...@mellanox.com, Saeed Mahameed, vla...@mellanox.com, clang-built-linux
On Fri, Mar 13, 2020 at 8:41 PM Nathan Chancellor
<natecha...@gmail.com> wrote:
>
> When CONFIG_MLX5_ESWITCH is unset, clang warns:
>
> In file included from drivers/net/ethernet/mellanox/mlx5/core/main.c:58:
> drivers/net/ethernet/mellanox/mlx5/core/eswitch.h:670:1: warning: unused
> function 'esw_add_restore_rule' [-Wunused-function]
> esw_add_restore_rule(struct mlx5_eswitch *esw, u32 tag)
> ^
> 1 warning generated.
>
> This stub function is missing inline; add it to suppress the warning.
>
> Fixes: 11b717d61526 ("net/mlx5: E-Switch, Get reg_c0 value on CQE")
> Signed-off-by: Nathan Chancellor <natecha...@gmail.com>

Yep, thanks for the patch!
Reviewed-by: Nick Desaulniers <ndesau...@google.com>

> ---
> drivers/net/ethernet/mellanox/mlx5/core/eswitch.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> index 2e0417dd8ce3..470a16e63242 100644
> --- a/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> +++ b/drivers/net/ethernet/mellanox/mlx5/core/eswitch.h
> @@ -666,7 +666,7 @@ static inline const u32 *mlx5_esw_query_functions(struct mlx5_core_dev *dev)
>
> static inline void mlx5_eswitch_update_num_of_vfs(struct mlx5_eswitch *esw, const int num_vfs) {}
>
> -static struct mlx5_flow_handle *
> +static inline struct mlx5_flow_handle *
> esw_add_restore_rule(struct mlx5_eswitch *esw, u32 tag)
> {
> return ERR_PTR(-EOPNOTSUPP);
> --
> 2.26.0.rc1
>
> --
> You received this message because you are subscribed to the Google Groups "Clang Built Linux" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to clang-built-li...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/clang-built-linux/20200314034019.3374-1-natechancellor%40gmail.com.



--
Thanks,
~Nick Desaulniers

Saeed Mahameed

unread,
Mar 16, 2020, 5:17:04 PM3/16/20
to natecha...@gmail.com, Paul Blakey, Oz Shlomo, da...@davemloft.net, Vlad Buslov, clang-bu...@googlegroups.com, Jiri Pirko, net...@vger.kernel.org, jakub.k...@netronome.com, Roi Dayan
Applied to net-next-mlx5

Thanks,
Saeed.
Reply all
Reply to author
Forward
0 new messages