Re: + mm-functions-may-simplify-the-use-of-return-values.patch added to mm-unstable branch

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 9 May 2022 09:20:35 +0200 Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:

> 
> Please, no:
> 
> arch/x86/mm/pgtable.c: * p4d_clear_huge - clear kernel P4D mapping when it is set
> arch/x86/mm/pgtable.c:int p4d_clear_huge(p4d_t *p4d)
> arch/x86/mm/pgtable.c: * pud_clear_huge - clear kernel PUD mapping when it is set
> arch/x86/mm/pgtable.c:int pud_clear_huge(pud_t *pud)
> arch/x86/mm/pgtable.c: * pmd_clear_huge - clear kernel PMD mapping when it is set
> arch/x86/mm/pgtable.c:int pmd_clear_huge(pmd_t *pmd)
> 
> why would the p4d one need to be different from the rest?

Because the p4d one doesn't return anything, whereas the others do?

Any code which tests the p4d_clear_huge() return value is probably
buggy, so making p4d_clear_huge() return void permits us to detect such
a bug with the C type system.



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux