[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20171123153133.mwyuxthy2ysktx7c@lakrids.cambridge.arm.com>
Date: Thu, 23 Nov 2017 15:31:34 +0000
From: Mark Rutland <mark.rutland@....com>
To: "Liuwenliang (Abbott Liu)" <liuwenliang@...wei.com>
Cc: Marc Zyngier <marc.zyngier@....com>,
"tixy@...aro.org" <tixy@...aro.org>,
"mhocko@...e.com" <mhocko@...e.com>,
"grygorii.strashko@...aro.org" <grygorii.strashko@...aro.org>,
"catalin.marinas@....com" <catalin.marinas@....com>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"glider@...gle.com" <glider@...gle.com>,
"afzal.mohd.ma@...il.com" <afzal.mohd.ma@...il.com>,
"mingo@...nel.org" <mingo@...nel.org>,
Christoffer Dall <cdall@...aro.org>,
"f.fainelli@...il.com" <f.fainelli@...il.com>,
"mawilcox@...rosoft.com" <mawilcox@...rosoft.com>,
"linux@...linux.org.uk" <linux@...linux.org.uk>,
"kasan-dev@...glegroups.com" <kasan-dev@...glegroups.com>,
Dailei <dylix.dailei@...wei.com>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"aryabinin@...tuozzo.com" <aryabinin@...tuozzo.com>,
"labbott@...hat.com" <labbott@...hat.com>,
"vladimir.murzin@....com" <vladimir.murzin@....com>,
"keescook@...omium.org" <keescook@...omium.org>,
"arnd@...db.de" <arnd@...db.de>,
Zengweilin <zengweilin@...wei.com>,
"opendmb@...il.com" <opendmb@...il.com>,
Heshaoliang <heshaoliang@...wei.com>,
"tglx@...utronix.de" <tglx@...utronix.de>,
"dvyukov@...gle.com" <dvyukov@...gle.com>,
"ard.biesheuvel@...aro.org" <ard.biesheuvel@...aro.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Jiazhenghua <jiazhenghua@...wei.com>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"robin.murphy@....com" <robin.murphy@....com>,
"thgarnie@...gle.com" <thgarnie@...gle.com>,
"kirill.shutemov@...ux.intel.com" <kirill.shutemov@...ux.intel.com>
Subject: Re: [PATCH 01/11] Initialize the mapping of KASan shadow memory
On Wed, Nov 22, 2017 at 12:56:44PM +0000, Liuwenliang (Abbott Liu) wrote:
> +static inline u64 get_ttbr0(void)
> +{
> + if (IS_ENABLED(CONFIG_ARM_LPAE))
> + return read_sysreg(TTBR0_64);
> + else
> + return (u64)read_sysreg(TTBR0_32);
> +}
> +static inline u64 get_ttbr1(void)
> +{
> + if (IS_ENABLED(CONFIG_ARM_LPAE))
> + return read_sysreg(TTBR1_64);
> + else
> + return (u64)read_sysreg(TTBR1_32);
> +}
In addition to the whitespace damage that need to be fixed, there's no
need for the u64 casts here. The compiler will implicitly cast to the
return type, and as u32 and u64 are both arithmetic types, we don't need
an explicit cast here.
Thanks,
Mark.
Powered by blists - more mailing lists