Skip to contentSkip to conversation

Fix W=1 compilation warnings

PATCH In review Leon Romanovsky 2 participants 4 messages Feb 17, 2019 – Feb 19, 2019

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

cover Fix W=1 compilation warnings

From: Leon Romanovsky <[email protected]>

Hi Saeed,

This short series fixes two small compilation warnings which are visible while compiling with W=1.

Thanks

Leon Romanovsky (2):
net/mlx5e: Add missing static function annotation net/mlx5: Delete unused FPGA QPN variable

 drivers/net/ethernet/mellanox/mlx5/core/en/monitor_stats.c | 2 +-
 drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c        | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)
#1 lore raw

PATCH 1/2 net/mlx5e: Add missing static function annotation

From: Leon Romanovsky <[email protected]>

Compilation with W=1 produces following warning:

drivers/net/ethernet/mellanox/mlx5/core/en/monitor_stats.c:69:6:
warning: no previous prototype for _mlx5e_monitor_counter_start_ [-Wmissing-prototypes]
void mlx5e_monitor_counter_start(struct mlx5e_priv *priv)

      ^~~~~~~~~~~~~~~~~~~~~~~~~~~

Avoid it by declaring mlx5e_monitor_counter_start() as a static function.

Fixes 5c7e8bbb0257 ("net/mlx5e: Use monitor counters for update stats")
---
 drivers/net/ethernet/mellanox/mlx5/core/en/monitor_stats.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en/monitor_stats.c +1 -1
index 2ce420851e77..7cd5b02e0f10 100644
@@ -66,7 +66,7 @@ static int mlx5e_monitor_event_handler(struct notifier_block *nb,
 	return NOTIFY_OK;
 }
 
-void mlx5e_monitor_counter_start(struct mlx5e_priv *priv)
+static void mlx5e_monitor_counter_start(struct mlx5e_priv *priv)
 {
 	MLX5_NB_INIT(&priv->monitor_counters_nb, mlx5e_monitor_event_handler,
 		     MONITOR_COUNTER);
#2 lore raw

PATCH 2/2 net/mlx5: Delete unused FPGA QPN variable

In reply to Leon Romanovsky

From: Leon Romanovsky <[email protected]>

fpga_qpn was assigned but never used and compilation with W=1 produced the following warning:

drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c: In function _mlx5_fpga_event_:
drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c:320:6: warning:
variable _fpga_qpn_ set but not used [-Wunused-but-set-variable]

  u32 fpga_qpn;
      ^~~~~~~~
Fixes 98db16bab59f ("net/mlx5: FPGA, Handle QP error event")
---
 drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c | 2 --
 1 file changed, 2 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c +0 -2
index 27c5f6c7d36a..d046d1ec2a86 100644
@@ -317,7 +317,6 @@ static int mlx5_fpga_event(struct mlx5_fpga_device *fdev,
 	const char *event_name;
 	bool teardown = false;
 	unsigned long flags;
-	u32 fpga_qpn;
 	u8 syndrome;
 
 	switch (event) {
@@ -328,7 +327,6 @@ static int mlx5_fpga_event(struct mlx5_fpga_device *fdev,
 	case MLX5_EVENT_TYPE_FPGA_QP_ERROR:
 		syndrome = MLX5_GET(fpga_qp_error_event, data, syndrome);
 		event_name = mlx5_fpga_qp_syndrome_to_string(syndrome);
-		fpga_qpn = MLX5_GET(fpga_qp_error_event, data, fpga_qpn);
 		break;
 	default:
 		return NOTIFY_DONE;
#3 lore raw
In reply to Leon Romanovsky
Quoted 14 lines · Leon Romanovsky

From: Leon Romanovsky <[email protected]>

Hi Saeed,

This short series fixes two small compilation warnings which are visible
while compiling with W=1.

Thanks

Leon Romanovsky (2):
net/mlx5e: Add missing static function annotation net/mlx5: Delete unused FPGA QPN variable

Quoted 7 lines
 drivers/net/ethernet/mellanox/mlx5/core/en/monitor_stats.c | 2 +-
 drivers/net/ethernet/mellanox/mlx5/core/fpga/core.c        | 2 --
 2 files changed, 1 insertion(+), 3 deletions(-)

--
2.19.1

Series applied to net-next-mlx5
Thanks Leon!