lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YgpQLnTd4TyiehS/@zn.tnic>
Date:   Mon, 14 Feb 2022 13:50:54 +0100
From:   Borislav Petkov <bp@...en8.de>
To:     Yazen Ghannam <yazen.ghannam@....com>
Cc:     linux-edac@...r.kernel.org, linux-kernel@...r.kernel.org,
        mchehab@...nel.org, tony.luck@...el.com, james.morse@....com,
        rric@...nel.org, Smita.KoralahalliChannabasappa@....com
Subject: Re: [PATCH v4 16/24] EDAC/amd64: Define function to make space for
 CS ID

On Thu, Jan 27, 2022 at 08:41:07PM +0000, Yazen Ghannam wrote:
> +static void expand_bits(u8 start_bit, u8 num_bits, u64 *value)
> +{
> +	u64 temp1, temp2;
> +
> +	if (start_bit == 0) {

As always

	if (!<variable, etc>)

for 0/NULL tests.

> +		*value <<= num_bits;
> +		return;
> +	}
> +
> +	temp1 = *value & GENMASK_ULL(start_bit - 1, 0);
> +	temp2 = (*value & GENMASK_ULL(63, start_bit)) << num_bits;
> +	*value = temp1 | temp2;
> +}
> +
> +static void make_space_for_cs_id_simple(struct addr_ctx *ctx)
> +{
> +	u8 num_intlv_bits = ctx->intlv_num_chan;
> +
> +	num_intlv_bits += ctx->intlv_num_dies;
> +	num_intlv_bits += ctx->intlv_num_sockets;
> +	expand_bits(ctx->intlv_addr_bit, num_intlv_bits, &ctx->ret_addr);
> +}

void functions but they return values through their pointer arguments?
I'm sure you can design those better.

-- 
Regards/Gruss,
    Boris.

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ