[PATCH] regmap: make range check functions static

Rasmus Villemoes posted 1 patch 4 years, 2 months ago
drivers/base/regmap/regmap.c | 12 +++++-------
include/linux/regmap.h       |  7 -------
2 files changed, 5 insertions(+), 14 deletions(-)
[PATCH] regmap: make range check functions static
Posted by Rasmus Villemoes 4 years, 2 months ago
regmap_reg_in_ranges() and regmap_check_range_table() have no callers
outside regmap.c, so they have no reason to be exported nor have
external linkage.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
 drivers/base/regmap/regmap.c | 12 +++++-------
 include/linux/regmap.h       |  7 -------
 2 files changed, 5 insertions(+), 14 deletions(-)

diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c
index 5e12f7cb5147..8b3fdc966ed6 100644
--- a/drivers/base/regmap/regmap.c
+++ b/drivers/base/regmap/regmap.c
@@ -57,9 +57,9 @@ static int _regmap_bus_reg_write(void *context, unsigned int reg,
 static int _regmap_bus_raw_write(void *context, unsigned int reg,
 				 unsigned int val);
 
-bool regmap_reg_in_ranges(unsigned int reg,
-			  const struct regmap_range *ranges,
-			  unsigned int nranges)
+static bool regmap_reg_in_ranges(unsigned int reg,
+				 const struct regmap_range *ranges,
+				 unsigned int nranges)
 {
 	const struct regmap_range *r;
 	int i;
@@ -69,10 +69,9 @@ bool regmap_reg_in_ranges(unsigned int reg,
 			return true;
 	return false;
 }
-EXPORT_SYMBOL_GPL(regmap_reg_in_ranges);
 
-bool regmap_check_range_table(struct regmap *map, unsigned int reg,
-			      const struct regmap_access_table *table)
+static bool regmap_check_range_table(struct regmap *map, unsigned int reg,
+				     const struct regmap_access_table *table)
 {
 	/* Check "no ranges" first */
 	if (regmap_reg_in_ranges(reg, table->no_ranges, table->n_no_ranges))
@@ -85,7 +84,6 @@ bool regmap_check_range_table(struct regmap *map, unsigned int reg,
 	return regmap_reg_in_ranges(reg, table->yes_ranges,
 				    table->n_yes_ranges);
 }
-EXPORT_SYMBOL_GPL(regmap_check_range_table);
 
 bool regmap_writeable(struct regmap *map, unsigned int reg)
 {
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index de81a94d7b30..5008db9bf69a 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -1210,9 +1210,6 @@ void regcache_cache_only(struct regmap *map, bool enable);
 void regcache_cache_bypass(struct regmap *map, bool enable);
 void regcache_mark_dirty(struct regmap *map);
 
-bool regmap_check_range_table(struct regmap *map, unsigned int reg,
-			      const struct regmap_access_table *table);
-
 int regmap_register_patch(struct regmap *map, const struct reg_sequence *regs,
 			  int num_regs);
 int regmap_parse_val(struct regmap *map, const void *buf,
@@ -1224,10 +1221,6 @@ static inline bool regmap_reg_in_range(unsigned int reg,
 	return reg >= range->range_min && reg <= range->range_max;
 }
 
-bool regmap_reg_in_ranges(unsigned int reg,
-			  const struct regmap_range *ranges,
-			  unsigned int nranges);
-
 static inline int regmap_set_bits(struct regmap *map,
 				  unsigned int reg, unsigned int bits)
 {
-- 
2.31.1