From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bo Shen Date: Wed, 29 Oct 2014 11:38:02 +0800 Subject: [U-Boot] [PATCH v2 3/3] ARM: atmel: add sama5d4ek board support In-Reply-To: <54505E02.8090001@googlemail.com> References: <1414549973-23558-1-git-send-email-voice.shen@atmel.com> <1414549973-23558-4-git-send-email-voice.shen@atmel.com> <54505E02.8090001@googlemail.com> Message-ID: <5450611A.5070401@atmel.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi Andreas, On 10/29/2014 11:24 AM, Andreas Bie?mann wrote: [snip] >> >diff --git a/arch/arm/include/asm/arch-at91/clk.h b/arch/arm/include/asm/arch-at91/clk.h >> >index 4076a78..21ce2db 100644 >> >--- a/arch/arm/include/asm/arch-at91/clk.h >> >+++ b/arch/arm/include/asm/arch-at91/clk.h >> >@@ -10,6 +10,7 @@ >> > #define __ASM_ARM_ARCH_CLK_H__ >> > >> > #include >> >+#include >> > #include >> > >> > static inline unsigned long get_cpu_clk_rate(void) > Could we please rewrite this peace of code like this: > > #ifdef CPU_HAS_H32MXDIV > static inline unsigned int get_h32mxdiv(void) > { > at91_pmc_t *pmc = (at91_pmc_t *)ATMEL_BASE_PMC; > return readl(pmc->mckr) & (AT91_PMC_MCKR_H32MXDIV)); > } > #else > static inline unsigned int get_h32mxdiv(void) > { > return 0; > } > #endif > > static inline unsigned long get_macb_pclk_rate(unsigned int dev_id) > { > if (get_h32mxdiv()) > return get_mck_clk_rate() / 2; > else > return get_mck_clk_rate(); > } > > and so forth > > The 'if'-path should be optimized away anyway and I feel the single > get_clk_X functions will look nicer then. OK, I will change the code like this. Thanks. > Rest of this series looks good and should be applied soon. > > Best Regards > > Andreas Bie?mann > Best Regards, Bo Shen