Skip to content

Commit

Permalink
libertas: avoid -Wempty-body warning
Browse files Browse the repository at this point in the history
Building without mesh supports shows a couple of warnings with
'make W=1':

drivers/net/wireless/marvell/libertas/main.c: In function 'lbs_start_card':
drivers/net/wireless/marvell/libertas/main.c:1068:37: error: suggest braces around empty body in an 'if' statement [-Werror=empty-body]
 1068 |                 lbs_start_mesh(priv);

Change the macros to use the usual "do { } while (0)" instead to shut up
the warnings and make the code a litte more robust.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210322104343.948660-4-arnd@kernel.org
  • Loading branch information
Arnd Bergmann authored and Kalle Valo committed Apr 17, 2021
1 parent 431eb49 commit 01414f8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/net/wireless/marvell/libertas/mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ void lbs_mesh_ethtool_get_strings(struct net_device *dev,

#else

#define lbs_init_mesh(priv)
#define lbs_deinit_mesh(priv)
#define lbs_start_mesh(priv)
#define lbs_add_mesh(priv)
#define lbs_remove_mesh(priv)
#define lbs_init_mesh(priv) do { } while (0)
#define lbs_deinit_mesh(priv) do { } while (0)
#define lbs_start_mesh(priv) do { } while (0)
#define lbs_add_mesh(priv) do { } while (0)
#define lbs_remove_mesh(priv) do { } while (0)
#define lbs_mesh_set_dev(priv, dev, rxpd) (dev)
#define lbs_mesh_set_txpd(priv, dev, txpd)
#define lbs_mesh_set_txpd(priv, dev, txpd) do { } while (0)
#define lbs_mesh_set_channel(priv, channel) (0)
#define lbs_mesh_activated(priv) (false)

Expand Down

0 comments on commit 01414f8

Please sign in to comment.