[PATCH 3/5] dfu: Mark unsued variables as __unused for now

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/simtrace@lists.osmocom.org/.

Holger Hans Peter Freyther holger at freyther.de
Wed Nov 9 22:24:14 UTC 2011


From: Holger Hans Peter Freyther <zecke at selfish.org>

---
 firmware/include/asm/compiler.h |    2 ++
 firmware/src/dfu/dfu.c          |    8 ++++----
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/firmware/include/asm/compiler.h b/firmware/include/asm/compiler.h
index de4dfaa..08b6bae 100644
--- a/firmware/include/asm/compiler.h
+++ b/firmware/include/asm/compiler.h
@@ -4,4 +4,6 @@
 #define likely(x)       __builtin_expect(!!(x), 1)
 #define unlikely(x)     __builtin_expect(!!(x), 0)
 
+#define __unused	__attribute__((unused))
+
 #endif
diff --git a/firmware/src/dfu/dfu.c b/firmware/src/dfu/dfu.c
index 9cd9996..682ce5e 100644
--- a/firmware/src/dfu/dfu.c
+++ b/firmware/src/dfu/dfu.c
@@ -231,7 +231,7 @@ static void chk_first_dnload_set_ptr(void)
 	first_download = 0;
 }
 
-static int __dfufunc handle_dnload_flash(u_int16_t val, u_int16_t len)
+static int __dfufunc handle_dnload_flash(u_int16_t __unused val, u_int16_t len)
 {
 	volatile u_int32_t *p;
 	u_int8_t *pagebuf = (u_int8_t *) pagebuf32;
@@ -297,7 +297,7 @@ static int __dfufunc handle_dnload_flash(u_int16_t val, u_int16_t len)
 	return RET_ZLP;
 }
 
-static int __dfufunc handle_dnload_ram(u_int16_t val, u_int16_t len)
+static int __dfufunc handle_dnload_ram(u_int16_t __unused val, u_int16_t len)
 {
 	DEBUGE("download ");
 
@@ -349,7 +349,7 @@ static int __dfufunc handle_dnload(u_int16_t val, u_int16_t len)
 }
 
 #define AT91C_IFLASH_END ((u_int8_t *)AT91C_IFLASH + AT91C_IFLASH_SIZE)
-static __dfufunc int handle_upload(u_int16_t val, u_int16_t len)
+static __dfufunc int handle_upload(u_int16_t __unused val, u_int16_t len)
 {
 	DEBUGE("upload ");
 	if (len > AT91C_IFLASH_PAGE_SIZE) {
@@ -421,7 +421,7 @@ static void __dfufunc handle_getstate(void)
 }
 
 /* callback function for DFU requests */
-int __dfufunc dfu_ep0_handler(u_int8_t req_type, u_int8_t req,
+int __dfufunc dfu_ep0_handler(u_int8_t __unused req_type, u_int8_t req,
 		    u_int16_t val, u_int16_t len)
 {
 	int rc, ret = RET_NOTHING;
-- 
1.7.7.2





More information about the simtrace mailing list