Adding this variable better explains the computation of L3 way
size in the function.
V2: Use const variable for way_size_per_bank.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
static unsigned
get_l3_way_size(const struct gen_device_info *devinfo)
{
- assert(devinfo->l3_banks);
-
- if (devinfo->is_broxton)
- return 4;
+ const unsigned way_size_per_bank =
+ devinfo->gen >= 9 && devinfo->l3_banks == 1 ? 4 : 2;
- return 2 * devinfo->l3_banks;
+ assert(devinfo->l3_banks);
+ return way_size_per_bank * devinfo->l3_banks;
}
/**