Messages in this thread Patch in this message | | | From | "Andrew F. Davis" <> | Subject | [PATCH 1/3] regcache: flat: Use cache element type in sizeof | Date | Sun, 7 Jan 2018 17:22:32 -0600 |
| |
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
| |