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] [day] [month] [year] [list]
Message-ID: <67c7f7df-9954-429c-b625-f894dfe8a8ac@intel.com>
Date: Fri, 13 Dec 2024 09:55:40 -0800
From: Dave Hansen <dave.hansen@...el.com>
To: Chao Gao <chao.gao@...el.com>, Dave Hansen <dave.hansen@...ux.intel.com>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org, tglx@...utronix.de,
 bp@...en8.de, kan.liang@...ux.intel.com, mingo@...nel.org,
 peterz@...radead.org, tony.luck@...el.com, pawan.kumar.gupta@...ux.intel.com
Subject: Re: [PATCH 1/5] x86/cpu: Introduce new microcode matching helper

On 12/9/24 21:46, Chao Gao wrote:
>> +bool x86_match_min_microcode_rev(const struct x86_cpu_id *table)
>> +{
>> +	const struct x86_cpu_id *res = x86_match_cpu(table);
>> +
>> +	if (!res || res->driver_data > boot_cpu_data.microcode)
>> +		return false;
>> +
>> +	return true;
> Maybe we can simplify the logic to:
> 
> 	return res && res->driver_data <= boot_cpu_data.microcode;

So, yeah, it can be made shorter.

But it's 100% a style thing and I'm not at all in the camp of fewer
lines meaning better code. It's all short enough to see without even
really moving your eyeballs so it's short _enough_ for sure.  There's
only one line of real logic either way.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ