summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-06-04 16:05:32 -0400
committerLokesh Vutla <lokeshvutla@ti.com>2020-06-16 17:00:02 +0530
commiteab48865f93a19e2a196a6c4e3480f16df4027d9 (patch)
treeb7bce74a0f236d50169c9b5243dbe3326b54daba
parent2af17e2573e8f4b949658ac45cad2e825e5aedc0 (diff)
net: cpsw: Add __maybe_unused to generated inlines
We generate a number of helper inline functions to make accesses easier. However not all permutations of each function will be used and clang will warn about unused ones. Decorate all of them with __maybe_unused because of this. Cc: Lokesh Vutla <lokeshvutla@ti.com> Signed-off-by: Tom Rini <trini@konsulko.com> Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
-rw-r--r--drivers/net/ti/cpsw.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/ti/cpsw.c b/drivers/net/ti/cpsw.c
index 95761fffc0..9d4332f450 100644
--- a/drivers/net/ti/cpsw.c
+++ b/drivers/net/ti/cpsw.c
@@ -17,6 +17,7 @@
#include <cpsw.h>
#include <dm/device_compat.h>
#include <linux/bitops.h>
+#include <linux/compiler.h>
#include <linux/errno.h>
#include <asm/gpio.h>
#include <asm/io.h>
@@ -247,11 +248,11 @@ static inline void cpsw_ale_set_field(u32 *ale_entry, u32 start, u32 bits,
}
#define DEFINE_ALE_FIELD(name, start, bits) \
-static inline int cpsw_ale_get_##name(u32 *ale_entry) \
+static inline int __maybe_unused cpsw_ale_get_##name(u32 *ale_entry) \
{ \
return cpsw_ale_get_field(ale_entry, start, bits); \
} \
-static inline void cpsw_ale_set_##name(u32 *ale_entry, u32 value) \
+static inline void __maybe_unused cpsw_ale_set_##name(u32 *ale_entry, u32 value) \
{ \
cpsw_ale_set_field(ale_entry, start, bits, value); \
}