Re: [RFC PATCH 3/3] x86/mm: cleanup prctl_enable_tagged_addr() nr_bits error checking

From: Kirill A. Shutemov
Date: Thu Mar 07 2024 - 12:32:25 EST


On Thu, Mar 07, 2024 at 01:39:16PM +0000, Yosry Ahmed wrote:
> In prctl_enable_tagged_addr(), we check that nr_bits is in the correct
> range, but we do so in a twisted if/else block where the correct case is
> sandwiched between two error cases doing exactly the same thing.
>
> Simplify the if condition and pull the correct case outside with the
> rest of the success code path.

I'm okay either way.

I structured the code this way as I had separate patch that adds also
LAM_U48. But it is unlikely to get upstreamed.

--
Kiryl Shutsemau / Kirill A. Shutemov