From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:46290 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755679AbcILRd2 (ORCPT ); Mon, 12 Sep 2016 13:33:28 -0400 Date: Mon, 12 Sep 2016 19:08:45 +0200 From: "gregkh @ linuxfoundation . org" To: Vineet Gupta Cc: "stable @ vger . kernel . org" Subject: Re: [PATCH] ARC: mm: fix build breakage with STRICT_MM_TYPECHECKS Message-ID: <20160912170845.GA27012@kroah.com> References: <20160910155023.GC12187@kroah.com> <1473697975-29097-1-git-send-email-vgupta@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1473697975-29097-1-git-send-email-vgupta@synopsys.com> Sender: stable-owner@vger.kernel.org List-ID: On Mon, Sep 12, 2016 at 09:32:55AM -0700, Vineet Gupta wrote: > | CC mm/memory.o > | In file included from ../mm/memory.c:53:0: > | ../include/linux/pfn_t.h: In function ‘pfn_t_pte’: > | ../include/linux/pfn_t.h:78:2: error: conversion to non-scalar type requested > | return pfn_pte(pfn_t_to_pfn(pfn), pgprot); > > With STRICT_MM_TYPECHECKS pte_t is a struct and the offending code > forces a cast which ends up shifting a struct and hence the gcc warning. > > Note that in recent past some of the arches (aarch64, s390) made > STRICT_MM_TYPECHECKS default, but we don't for ARC as this leads to slightly > worse generated code, given ARC ABI definition of returning structs > (which pte_t would become) > > Quoting from ARC ABI... > > "Results of type struct are returned in a caller-supplied temporary > variable whose address is passed in r0. > For such functions, the arguments are shifted so that they are > passed in r1 and up." > > So > - struct to be returned would be allocated on stack requiring extra > code at call sites > - callee updates stack memory to facilitate the return (vs. simple > MOV into return reg r0) > > Hence STRICT_MM_TYPECHECKS is not enabled by default for ARC > > Cc: #4.4+ > Signed-off-by: Vineet Gupta > --- > arch/arc/include/asm/pgtable.h | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/arch/arc/include/asm/pgtable.h b/arch/arc/include/asm/pgtable.h > index 3cab04255ae0..e5fec320f158 100644 > --- a/arch/arc/include/asm/pgtable.h > +++ b/arch/arc/include/asm/pgtable.h > @@ -277,8 +277,7 @@ static inline void pmd_set(pmd_t *pmdp, pte_t *ptep) > > #define mk_pte(page, prot) pfn_pte(page_to_pfn(page), prot) > #define pte_pfn(pte) (pte_val(pte) >> PAGE_SHIFT) > -#define pfn_pte(pfn, prot) (__pte(((pte_t)(pfn) << PAGE_SHIFT) | \ > - pgprot_val(prot))) > +#define pfn_pte(pfn, prot) (__pte(((pfn) << PAGE_SHIFT) | pgprot_val(prot))) > #define __pte_index(addr) (((addr) >> PAGE_SHIFT) & (PTRS_PER_PTE - 1)) > > /* > -- > 2.7.4 Whitespace is correct this time, thanks. You can't cut-and-paste in a web email client... But, you forgot to say what the git commit id is for this patch :( Can you resend it with that info? thanks, greg k-h