From 92d8f95cba6d739d7637459ae02fab297345f292 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Th=C3=A9baudeau?= Date: Sat, 9 Jan 2016 14:07:47 +0100 Subject: [PATCH] cc2538: Fix GCC 5 warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix the following warning issued by GCC ARM Embedded 5-2015-q4-major: ../../cpu/cc2538/dev/udma.c: In function 'udma_init': ../../cpu/cc2538/dev/udma.c:59:10: warning: passing argument 1 of 'memset' discards 'volatile' qualifier from pointer target type [-Wdiscarded-array-qualifiers] memset(&channel_config, 0, sizeof(channel_config)); ^ In file included from /arm-none-eabi/include/string.h:10:0, from ../../platform/cc2538dk/./contiki-conf.h:12, from ../../cpu/cc2538/dev/udma.c:38: /arm-none-eabi/include/string.h:25:7: note: expected 'void *' but argument is of type 'volatile struct channel_ctrl (*)[4]' _PTR _EXFUN(memset,(_PTR, int, size_t)); ^ Signed-off-by: Benoît Thébaudeau --- cpu/cc2538/dev/udma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cpu/cc2538/dev/udma.c b/cpu/cc2538/dev/udma.c index c285d1b11..c9770869b 100644 --- a/cpu/cc2538/dev/udma.c +++ b/cpu/cc2538/dev/udma.c @@ -56,7 +56,7 @@ static volatile struct channel_ctrl channel_config[UDMA_CONF_MAX_CHANNEL + 1] void udma_init() { - memset(&channel_config, 0, sizeof(channel_config)); + memset((void *)&channel_config, 0, sizeof(channel_config)); REG(UDMA_CFG) = UDMA_CFG_MASTEN;