On Nov 23, 2017 23:32 Mark Rutland [mailto:mark.rutland@xxxxxxx] wrote: >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 for your review. I'm going to change it in the new version. -----邮件原件----- 发件人: Mark Rutland [mailto:mark.rutland@xxxxxxx] 发送时间: 2017年11月23日 23:32 收件人: Liuwenliang (Abbott Liu) 抄送: Marc Zyngier; tixy@xxxxxxxxxx; mhocko@xxxxxxxx; grygorii.strashko@xxxxxxxxxx; catalin.marinas@xxxxxxx; linux-mm@xxxxxxxxx; glider@xxxxxxxxxx; afzal.mohd.ma@xxxxxxxxx; mingo@xxxxxxxxxx; Christoffer Dall; f.fainelli@xxxxxxxxx; mawilcox@xxxxxxxxxxxxx; linux@xxxxxxxxxxxxxxx; kasan-dev@xxxxxxxxxxxxxxxx; Dailei; linux-arm-kernel@xxxxxxxxxxxxxxxxxxx; aryabinin@xxxxxxxxxxxxx; labbott@xxxxxxxxxx; vladimir.murzin@xxxxxxx; keescook@xxxxxxxxxxxx; arnd@xxxxxxxx; Zengweilin; opendmb@xxxxxxxxx; Heshaoliang; tglx@xxxxxxxxxxxxx; dvyukov@xxxxxxxxxx; ard.biesheuvel@xxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx; Jiazhenghua; akpm@xxxxxxxxxxxxxxxxxxxx; robin.murphy@xxxxxxx; thgarnie@xxxxxxxxxx; kirill.shutemov@xxxxxxxxxxxxxxx 主题: 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. ?韬{.n???檩jg???a?旃???)钋???骅w+h?璀?y/i?⒏??⒎???Щ??m???)钋???痂?^??觥??ザ?v???O璁?f??i?⒏?