[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a02186b9-b72c-1484-2973-c59272ae0a7e@intel.com>
Date: Tue, 26 Apr 2022 08:10:58 -0700
From: Dave Hansen <dave.hansen@...el.com>
To: Martin Fernandez <martin.fernandez@...ypsium.com>,
linux-kernel@...r.kernel.org, linux-efi@...r.kernel.org,
platform-driver-x86@...r.kernel.org, linux-mm@...ck.org
Cc: tglx@...utronix.de, mingo@...hat.com, bp@...en8.de,
dave.hansen@...ux.intel.com, x86@...nel.org, hpa@...or.com,
ardb@...nel.org, dvhart@...radead.org, andy@...radead.org,
gregkh@...uxfoundation.org, rafael@...nel.org, rppt@...nel.org,
akpm@...ux-foundation.org, daniel.gutson@...ypsium.com,
hughsient@...il.com, alex.bazhaniuk@...ypsium.com,
alison.schofield@...el.com, keescook@...omium.org
Subject: Re: [PATCH v7 5/8] x86/e820: Refactor e820__range_remove
On 4/25/22 10:15, Martin Fernandez wrote:
> +/**
> + * e820__range_remove() - Remove an address range from e820_table.
> + * @start: Start of the address range.
> + * @size: Size of the address range.
> + * @old_type: Type of the entries that we want to remove.
> + * @check_type: Bool to decide if ignore @old_type or not.
> + *
> + * Remove [@start, @start + @size) from e820_table. If @check_type is
> + * true remove only entries with type @old_type.
> + *
> + * Return: The size removed.
> + */
The refactoring looks promising. But, there's a *LOT* of kerneldoc
noise, like:
> + * @table: Target e820_table.
> + * @start: Start of the range.
> + * @size: Size of the range.
and this:
> + * struct e820_type_updater_data - Helper type for
> + * __e820__range_update().
> + * @old_type: old_type parameter of __e820__range_update().
> + * @new_type: new_type parameter of __e820__range_update().
Those are just a pure waste of bytes. I suspect some more judicious
function comments would also make the diffstat look more palatable.
Also, in general, the naming is a bit verbose. You might want to trim
some of those names down, like:
> +static bool __init crypto_updater__should_update(const struct e820_entry *entry,
> + const void *data)
> +{
> + const struct e820_crypto_updater_data *crypto_updater_data =
> + (const struct e820_crypto_updater_data *)data;
Those are just some high-level comments. This also needs some really
careful review of the refactoring to make sure that it doesn't break any
of the existing e820 users.
Powered by blists - more mailing lists