Re: [PATCH v4 12/24] EDAC/amd64: Define function to get number of interleaved channels

From: Borislav Petkov
Date: Mon Feb 14 2022 - 07:20:51 EST


On Thu, Jan 27, 2022 at 08:41:03PM +0000, Yazen Ghannam wrote:
> Move number of interleaved channel calculation to a separate helper
> function. Drop unused cases.

... or by looking at that change, I think you want to have each separate
step in the address massaging be a separate function. Which, if so,
makes sense but you have to say it...

...

> +static void get_intlv_num_chan(struct addr_ctx *ctx)
> +{
> + /* Save the log2(# of channels). */
> + switch (ctx->intlv_mode) {
> + case NONE:
> + ctx->intlv_num_chan = 0;
> + break;
> + case NOHASH_2CH:
> + case DF2_HASH_2CH:
> + ctx->intlv_num_chan = 1;
> + break;
> + default:
> + /* Valid interleaving modes where checked earlier. */

"were"

> + break;
> + }
> +}

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette