All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: mm-commits@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com,
	luto@kernel.org, hpa@zytor.com, dave.hansen@linux.intel.com,
	bp@alien8.de, kunyu@nfschina.com
Subject: Re: + mm-functions-may-simplify-the-use-of-return-values.patch added to mm-unstable branch
Date: Mon, 9 May 2022 10:07:03 -0700	[thread overview]
Message-ID: <20220509100703.1ae1c1b6a9189fdec46ecd41@linux-foundation.org> (raw)
In-Reply-To: <20220509072035.GG76023@worktop.programming.kicks-ass.net>

On Mon, 9 May 2022 09:20:35 +0200 Peter Zijlstra <peterz@infradead.org> 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.

      reply	other threads:[~2022-05-09 17:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-07 17:50 + mm-functions-may-simplify-the-use-of-return-values.patch added to mm-unstable branch Andrew Morton
2022-05-09  7:20 ` Peter Zijlstra
2022-05-09 17:07   ` Andrew Morton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220509100703.1ae1c1b6a9189fdec46ecd41@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=kunyu@nfschina.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=mm-commits@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.