[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180107232234.11064-1-afd@ti.com>
Date: Sun, 7 Jan 2018 17:22:32 -0600
From: "Andrew F. Davis" <afd@...com>
To: Mark Brown <broonie@...nel.org>
CC: <linux-kernel@...r.kernel.org>, "Andrew F . Davis" <afd@...com>
Subject: [PATCH 1/3] regcache: flat: Use cache element type in sizeof
A single cache element may not always be unsigned int, use a
cache element in sizeof over hard-coding its type.
Signed-off-by: Andrew F. Davis <afd@...com>
---
drivers/base/regmap/regcache-flat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/base/regmap/regcache-flat.c b/drivers/base/regmap/regcache-flat.c
index 4d2e50bfc726..2ea5fc84a374 100644
--- a/drivers/base/regmap/regcache-flat.c
+++ b/drivers/base/regmap/regcache-flat.c
@@ -31,7 +31,7 @@ static int regcache_flat_init(struct regmap *map)
return -EINVAL;
map->cache = kcalloc(regcache_flat_get_index(map, map->max_register)
- + 1, sizeof(unsigned int), GFP_KERNEL);
+ + 1, sizeof(*cache), GFP_KERNEL);
if (!map->cache)
return -ENOMEM;
--
2.15.1
Powered by blists - more mailing lists