From: Anshuman Khandual <anshuman.khandual@arm.com>
To: linux-arm-kernel@lists.infradead.org
Cc: Russell King <linux@armlinux.org.uk>,
Andrew Morton <akpm@linux-foundation.org>,
linux-kernel@vger.kernel.org,
Linus Walleij <linus.walleij@linaro.org>
Subject: Re: [PATCH] arm/mm: Convert PUD level pgtable helper macros into functions
Date: Fri, 20 Nov 2020 08:09:16 +0530 [thread overview]
Message-ID: <44b9c9d4-4c45-4efa-9c1a-289d917d2a9e@arm.com> (raw)
In-Reply-To: <1604979410-23997-1-git-send-email-anshuman.khandual@arm.com>
On 11/10/20 9:06 AM, Anshuman Khandual wrote:
> Macros used as functions can be problematic from the compiler perspective.
> There was a build failure report caused primarily because of non reference
> of an argument variable. Hence convert PUD level pgtable helper macros into
> functions in order to avoid such problems in the future. In the process, it
> fixes the argument variables sequence in set_pud() which probably remained
> hidden for being a macro.
>
> https://lore.kernel.org/linux-mm/202011020749.5XQ3Hfzc-lkp@intel.com/
> https://lore.kernel.org/linux-mm/5fa49698.Vu2O3r+dU20UoEJ+%25lkp@intel.com/
>
> Cc: Russell King <linux@armlinux.org.uk>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Anshuman Khandual <anshuman.khandual@arm.com>
> ---
> Only build tested.
Hello Russel,
Any updates on this ? These changes come from an earlier discussion
on the mm list. Wondering if this too can also be submitted in the
arm patch tracking system. Thank you.
- Anshuman
+ Linus Walleij <linus.walleij@linaro.org>
>
> arch/arm/include/asm/pgtable-2level.h | 27 ++++++++++++++++++++++-----
> 1 file changed, 22 insertions(+), 5 deletions(-)
>
> diff --git a/arch/arm/include/asm/pgtable-2level.h b/arch/arm/include/asm/pgtable-2level.h
> index 3502c2f..9d4f5ee 100644
> --- a/arch/arm/include/asm/pgtable-2level.h
> +++ b/arch/arm/include/asm/pgtable-2level.h
> @@ -177,11 +177,28 @@
> * the pud: the pud entry is never bad, always exists, and can't be set or
> * cleared.
> */
> -#define pud_none(pud) (0)
> -#define pud_bad(pud) (0)
> -#define pud_present(pud) (1)
> -#define pud_clear(pudp) do { } while (0)
> -#define set_pud(pud,pudp) do { } while (0)
> +static inline int pud_none(pud_t pud)
> +{
> + return 0;
> +}
> +
> +static inline int pud_bad(pud_t pud)
> +{
> + return 0;
> +}
> +
> +static inline int pud_present(pud_t pud)
> +{
> + return 1;
> +}
> +
> +static inline void pud_clear(pud_t *pudp)
> +{
> +}
> +
> +static inline void set_pud(pud_t *pudp, pud_t pud)
> +{
> +}
>
> static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr)
> {
>
prev parent reply other threads:[~2020-11-20 2:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-10 3:36 Anshuman Khandual
2020-11-20 2:39 ` Anshuman Khandual [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=44b9c9d4-4c45-4efa-9c1a-289d917d2a9e@arm.com \
--to=anshuman.khandual@arm.com \
--cc=akpm@linux-foundation.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®