From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hans de Goede Date: Fri, 19 Dec 2014 17:42:58 +0100 Subject: [U-Boot] [PATCH 10/14] sunxi: Move await_completion dram helper to dram.h In-Reply-To: <20141219120624.6aac3a0b@i7> References: <1418761900-14035-1-git-send-email-hdegoede@redhat.com> <1418761900-14035-10-git-send-email-hdegoede@redhat.com> <20141219120624.6aac3a0b@i7> Message-ID: <54945592.5010902@redhat.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, On 19-12-14 11:06, Siarhei Siamashka wrote: > On Tue, 16 Dec 2014 21:31:35 +0100 > Hans de Goede wrote: > >> The await_completion helper is already copy pasted between the sun4i and sun6i >> dram code, and we need it for sun8i too, so lets make it an inline helper in >> dram.h, rather then adding yet another copy. >> >> Signed-off-by: Hans de Goede > > Making this function "static inline" and placing it into a header file > encourages the compiler to actually inline it. Which is not great for > code size: > > > == Before the patch and using gcc version 4.8.3 == > > $ arm-none-linux-gnieabi-size spl/arch/arm/cpu/armv7/sunxi/dram_sun4i.o > text data bss dec hex filename > 1731 0 0 1731 6c3 > > $ arm-none-linux-gnieabi-size spl/arch/arm/cpu/armv7/sunxi/dram_sun6i.o > text data bss dec hex filename > 1841 0 0 1841 731 > > == After the patch and using gcc version 4.8.3 == > > $ arm-none-linux-gnieabi-size spl/arch/arm/cpu/armv7/sunxi/dram_sun4i.o > text data bss dec hex filename > 1763 0 0 1763 6e3 > > $ arm-none-linux-gnieabi-size spl/arch/arm/cpu/armv7/sunxi/dram_sun6i.o > text data bss dec hex filename > 1983 0 0 1983 7bf Ah, thanks for catching that, the size increase does not seem to be a problem right now, but it certainly is something to keep in mind. > Could we perhaps just introduce something like a new source file > "dram_common.c" or even "dram.c"? Sounds like a good idea, patches welcome. > As an additional observation, moving await_bits_clear/await_bits_set > functions into a common header file and using them in the sun6i dram > code might improve readability. Sounds like another good idea, patches welcome. Regards, Hans