summaryrefslogtreecommitdiffstats
path: root/drivers/staging/slicoss/slic.h
diff options
context:
space:
mode:
authorSergio Paracuellos2016-11-21 17:48:24 +0100
committerGreg Kroah-Hartman2016-11-23 08:52:09 +0100
commitc208faefdf134e8050a6f29ce35cc36afa3a530f (patch)
tree11a8b4d7e9f10396ed9a59421f8b2d350c508061 /drivers/staging/slicoss/slic.h
parentStaging: rtl8712: rtl871x_*: Removed unnecessary else statements after a brea... (diff)
downloadkernel-qcow2-linux-c208faefdf134e8050a6f29ce35cc36afa3a530f.tar.gz
kernel-qcow2-linux-c208faefdf134e8050a6f29ce35cc36afa3a530f.tar.xz
kernel-qcow2-linux-c208faefdf134e8050a6f29ce35cc36afa3a530f.zip
staging: slicoss: change some macros into inline functions
This patch changes macros into inline functions to avoid this checkpatch check: Macro argument 'x' may be better as '(x)' to avoid precedence issues It also removes two macros because they aren't being used. Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/slicoss/slic.h')
-rw-r--r--drivers/staging/slicoss/slic.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h
index f04d3046be40..1f6562c691fc 100644
--- a/drivers/staging/slicoss/slic.h
+++ b/drivers/staging/slicoss/slic.h
@@ -215,12 +215,20 @@ struct mcast_address {
#define MAC_LOOPBACK 0x00000010
#define MAC_ALLMCAST 0x00000020
-#define SLIC_DUPLEX(x) ((x == LINK_FULLD) ? "FDX" : "HDX")
-#define SLIC_SPEED(x) ((x == LINK_100MB) ? "100Mb" : ((x == LINK_1000MB) ?\
- "1000Mb" : " 10Mb"))
-#define SLIC_LINKSTATE(x) ((x == LINK_DOWN) ? "Down" : "Up ")
-#define SLIC_ADAPTER_STATE(x) ((x == ADAPT_UP) ? "UP" : "Down")
-#define SLIC_CARD_STATE(x) ((x == CARD_UP) ? "UP" : "Down")
+static inline const char *slic_linkstate(unsigned char x)
+{
+ return ((x == LINK_DOWN) ? "Down" : "Up ");
+}
+
+static inline const char *slic_adapter_state(unsigned char x)
+{
+ return ((x == ADAPT_UP) ? "UP" : "Down");
+}
+
+static inline const char *slic_card_state(uint x)
+{
+ return ((x == CARD_UP) ? "UP" : "Down");
+}
struct slic_iface_stats {
/*