From: Christian Lamparter Date: Thu, 30 Sep 2010 15:34:47 +0000 (+0200) Subject: carl9170 firmware: introduce __noreturn attribute X-Git-Tag: 1.9.0~7 X-Git-Url: https://jxself.org/git/?a=commitdiff_plain;h=0eb34487ee8e70ecb8e4ee2ed5092b2788eb7f26;p=carl9170fw.git carl9170 firmware: introduce __noreturn attribute Signed-off-by: Christian Lamparter --- diff --git a/carlfw/include/usb.h b/carlfw/include/usb.h index 1fb9e82..3f35567 100644 --- a/carlfw/include/usb.h +++ b/carlfw/include/usb.h @@ -162,7 +162,7 @@ static inline void usb_structure_check(void) BUILD_BUG_ON(sizeof(struct usb_interface_descriptor) != USB_DT_INTERFACE_SIZE); } -void __attribute__((noreturn)) jump_to_bootcode(void); +void __noreturn jump_to_bootcode(void); void send_cmd_to_host(const uint8_t len, const uint8_t type, const uint8_t ext, const uint8_t *body); @@ -180,7 +180,7 @@ void usb_print_hex_dump(const void *buf, int len); void usb_init_highspeed_fifo_cfg(void); void usb_init_fullspeed_fifo_cfg(void); -void start(void); -void __attribute__((noreturn)) reboot(void); +void __noreturn start(void); +void __noreturn reboot(void); #endif /* __CARL9170FW_USB_H */ diff --git a/carlfw/src/main.c b/carlfw/src/main.c index 3efa6a8..9500c0d 100644 --- a/carlfw/src/main.c +++ b/carlfw/src/main.c @@ -85,7 +85,7 @@ static void handle_fw(void) reboot(); } -static void __attribute__((noreturn)) main_loop(void) +static void __noreturn main_loop(void) { /* main loop */ while (1) { @@ -117,7 +117,7 @@ static void __attribute__((noreturn)) main_loop(void) * we put _start() there with the linker script carl9170.lds. */ -void __attribute__((noreturn)) start(void) +void start(void) { clock_set(true, AHB_40MHZ_OSC); diff --git a/carlfw/usb/main.c b/carlfw/usb/main.c index 1a96625..57f75a4 100644 --- a/carlfw/usb/main.c +++ b/carlfw/usb/main.c @@ -270,7 +270,7 @@ static void turn_power_off(void) set(AR9170_PHY_REG_ADC_SERIAL_CTL, AR9170_PHY_ADC_SCTL_SEL_INTERNAL_ADDAC); } -void __attribute__((noreturn)) reboot(void) +void __noreturn reboot(void) { /* write watchdog magic pattern for suspend */ andl(AR9170_PWR_REG_WATCH_DOG_MAGIC, 0xffff); diff --git a/include/linux/compiler.h b/include/linux/compiler.h index fe04cc6..ec4edf7 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h @@ -18,6 +18,7 @@ #define __SHARED_COMPILER_H #define __noinline __attribute__((noinline)) +#define __noreturn __attribute__((noreturn)) #define __inline __attribute__((always_inline)) #define __hot __attribute__((hot)) #define __cold __attribute__((cold))