lkml.org 
[lkml]   [2018]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/3] regcache: flat: Use cache element type in sizeof
Date
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
\
 
 \ /
  Last update: 2018-01-14 23:16    [W:0.072 / U:0.588 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site