Re: [RFC V2 1/3] lib/vsprintf: Add support for pgtable entries

From: Anshuman Khandual

Date: Thu Jun 11 2026 - 05:55:50 EST




On 11/06/26 12:47 PM, Andy Shevchenko wrote:
> On Thu, Jun 11, 2026 at 10:45:01AM +0530, Anshuman Khandual wrote:
>> On 10/06/26 4:43 PM, Usama Arif wrote:
>>> On Wed, 10 Jun 2026 05:35:43 +0100 Anshuman Khandual <anshuman.khandual@xxxxxxx> wrote:
>
> ...
>
>>>> + static_assert(sizeof(pte_t) == 4 ||
>>>> + sizeof(pte_t) == 8,
>>>> + "pte_t size must be 4 or 8 bytes");
>
> Besides occupying too many lines, why are these static asserts hidden here and
> not declared in the global space? More wide Q is why they are needed at all?

Sure, will move these static_assert just above pxd_pointer()
These asserts ensure

- Platforms have either 32 bit or 64 bit pgtable descriptors
- special_hex_number() can be used to print such descriptors