From: Andy Shevchenko Date: Thu, 21 Nov 2024 10:57:21 +0000 (+0200) Subject: regmap: cache: Use BITS_TO_BYTES() X-Git-Tag: v6.14-rc1~159^2~3^2~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4a3aafe01f6c628932a402c21e58101173c8dab3;p=thirdparty%2Flinux.git regmap: cache: Use BITS_TO_BYTES() BITS_TO_BYTES() is the existing macro which takes care about full bytes that may fully hold the given amount of bits. Use it. Signed-off-by: Andy Shevchenko Link: https://patch.msgid.link/20241121105838.4073659-2-andriy.shevchenko@linux.intel.com Signed-off-by: Mark Brown --- diff --git a/drivers/base/regmap/regcache.c b/drivers/base/regmap/regcache.c index d3659ba3cc112..b1f8508c3966d 100644 --- a/drivers/base/regmap/regcache.c +++ b/drivers/base/regmap/regcache.c @@ -154,7 +154,7 @@ int regcache_init(struct regmap *map, const struct regmap_config *config) map->num_reg_defaults = config->num_reg_defaults; map->num_reg_defaults_raw = config->num_reg_defaults_raw; map->reg_defaults_raw = config->reg_defaults_raw; - map->cache_word_size = DIV_ROUND_UP(config->val_bits, 8); + map->cache_word_size = BITS_TO_BYTES(config->val_bits); map->cache_size_raw = map->cache_word_size * config->num_reg_defaults_raw; map->cache = NULL;