From patchwork Mon Jun 23 21:20:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeroen Hofstee X-Patchwork-Id: 363161 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 023B61400D5 for ; Tue, 24 Jun 2014 07:20:40 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B85CDA74A9; Mon, 23 Jun 2014 23:20:39 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id JQFXaRdlIC4Q; Mon, 23 Jun 2014 23:20:39 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F008DA74AB; Mon, 23 Jun 2014 23:20:35 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E7329A74AB for ; Mon, 23 Jun 2014 23:20:31 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id i2avQT0mUHWX for ; Mon, 23 Jun 2014 23:20:27 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from orange.myspectrum.nl (orange.myspectrum.nl [149.210.134.247]) by theia.denx.de (Postfix) with ESMTP id 51CAAA74A9 for ; Mon, 23 Jun 2014 23:20:22 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by orange.myspectrum.nl (Postfix) with ESMTP id BA3098C491; Mon, 23 Jun 2014 23:20:21 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at myspectrum.nl Received: from orange.myspectrum.nl ([127.0.0.1]) by localhost (orange.myspectrum.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id tNt8_1Zll0ts; Mon, 23 Jun 2014 23:20:20 +0200 (CEST) Received: from yellow (ip136-5-208-87.adsl2.static.versatel.nl [87.208.5.136]) (Authenticated sender: jeroen@myspectrum.nl) by orange.myspectrum.nl (Postfix) with ESMTPSA id CFE018C48D; Mon, 23 Jun 2014 23:20:20 +0200 (CEST) Received: by yellow (Postfix, from userid 1000) id 904DD742CA3; Mon, 23 Jun 2014 23:20:20 +0200 (CEST) From: Jeroen Hofstee To: u-boot@lists.denx.de Date: Mon, 23 Jun 2014 23:20:19 +0200 Message-Id: <1403558419-9215-1-git-send-email-jeroen@myspectrum.nl> X-Mailer: git-send-email 1.8.3.2 Cc: Jeroen Hofstee Subject: [U-Boot] [PATCH] common: board_f: cosmetic use __weak for leds X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de First of all this looks a lot better, but it also prevents a gcc warning (W=1), that the weak function has no previous prototype. cc: Simon Glass Signed-off-by: Jeroen Hofstee Acked-by: Simon Glass --- This likely causes some merge issues, but is so uggly it deserves it. --- common/board_f.c | 29 ++++++++++------------------- include/status_led.h | 22 +++++++++++----------- 2 files changed, 21 insertions(+), 30 deletions(-) diff --git a/common/board_f.c b/common/board_f.c index 4ea4cb2..bdab38e 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -37,6 +37,7 @@ #include #include #include +#include #include #include #include @@ -78,25 +79,15 @@ DECLARE_GLOBAL_DATA_PTR; ************************************************************************ * May be supplied by boards if desired */ -inline void __coloured_LED_init(void) {} -void coloured_LED_init(void) - __attribute__((weak, alias("__coloured_LED_init"))); -inline void __red_led_on(void) {} -void red_led_on(void) __attribute__((weak, alias("__red_led_on"))); -inline void __red_led_off(void) {} -void red_led_off(void) __attribute__((weak, alias("__red_led_off"))); -inline void __green_led_on(void) {} -void green_led_on(void) __attribute__((weak, alias("__green_led_on"))); -inline void __green_led_off(void) {} -void green_led_off(void) __attribute__((weak, alias("__green_led_off"))); -inline void __yellow_led_on(void) {} -void yellow_led_on(void) __attribute__((weak, alias("__yellow_led_on"))); -inline void __yellow_led_off(void) {} -void yellow_led_off(void) __attribute__((weak, alias("__yellow_led_off"))); -inline void __blue_led_on(void) {} -void blue_led_on(void) __attribute__((weak, alias("__blue_led_on"))); -inline void __blue_led_off(void) {} -void blue_led_off(void) __attribute__((weak, alias("__blue_led_off"))); +__weak void coloured_LED_init(void) {} +__weak void red_led_on(void) {} +__weak void red_led_off(void) {} +__weak void green_led_on(void) {} +__weak void green_led_off(void) {} +__weak void yellow_led_on(void) {} +__weak void yellow_led_off(void) {} +__weak void blue_led_on(void) {} +__weak void blue_led_off(void) {} /* * Why is gd allocated a register? Prior to reloc it might be better to diff --git a/include/status_led.h b/include/status_led.h index ecff60d..848708a 100644 --- a/include/status_led.h +++ b/include/status_led.h @@ -294,19 +294,21 @@ extern void __led_set (led_id_t mask, int state); # include #endif +#endif /* CONFIG_STATUS_LED */ + /* * Coloured LEDs API */ #ifndef __ASSEMBLY__ -extern void coloured_LED_init (void); -extern void red_led_on(void); -extern void red_led_off(void); -extern void green_led_on(void); -extern void green_led_off(void); -extern void yellow_led_on(void); -extern void yellow_led_off(void); -extern void blue_led_on(void); -extern void blue_led_off(void); +void coloured_LED_init(void); +void red_led_on(void); +void red_led_off(void); +void green_led_on(void); +void green_led_off(void); +void yellow_led_on(void); +void yellow_led_off(void); +void blue_led_on(void); +void blue_led_off(void); #else .extern LED_init .extern red_led_on @@ -319,6 +321,4 @@ extern void blue_led_off(void); .extern blue_led_off #endif -#endif /* CONFIG_STATUS_LED */ - #endif /* _STATUS_LED_H_ */