mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 1/3] regcache: flat: Use cache element type in sizeof
@ 2018-01-07 23:22 Andrew F. Davis
  2018-01-07 23:22 ` [PATCH 2/3] regcache: flat: Un-inline index lookup from cache access Andrew F. Davis
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Andrew F. Davis @ 2018-01-07 23:22 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel, Andrew F . Davis

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@ti.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

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-01-10 12:02 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-07 23:22 [PATCH 1/3] regcache: flat: Use cache element type in sizeof Andrew F. Davis
2018-01-07 23:22 ` [PATCH 2/3] regcache: flat: Un-inline index lookup from cache access Andrew F. Davis
2018-01-07 23:22 ` [PATCH 3/3] regcache: flat: Add valid bit to this cache type Andrew F. Davis
2018-01-08 12:08   ` Mark Brown
2018-01-08 16:25     ` Andrew F. Davis
2018-01-08 16:36       ` Mark Brown
2018-01-08 16:46         ` Andrew F. Davis
2018-01-09 16:24           ` Mark Brown
2018-01-09 17:47             ` Andrew F. Davis
2018-01-10 12:02               ` Mark Brown
2018-01-08 11:59 ` [PATCH 1/3] regcache: flat: Use cache element type in sizeof Mark Brown
2018-01-08 16:25   ` Andrew F. Davis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome