1
0
Fork 0
forked from nuttx/nuttx-update

arch/tricore: fix compiler warning on GCC toolchain

tc3xx/tc3xx_timerisr.c: In function ‘up_timer_initialize’:
tc3xx/tc3xx_timerisr.c:58:39: warning: passing argument 1 of ‘tricore_systimer_initialize’ discards ‘volatile’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   58 |   lower = tricore_systimer_initialize(&MODULE_STM0, 192, SCU_FREQUENCY);
In file included from tc3xx/tc3xx_timerisr.c:31:
nuttx/arch/tricore/src/common/tricore_internal.h:252:35: note: expected ‘void *’ but argument is of type ‘volatile Ifx_STM *’ {aka ‘volatile struct _Ifx_STM *’}
  252 | tricore_systimer_initialize(void *tbase, int irq, uint64_t freq);
      |                             ~~~~~~^~~~~
tc3xx/tc3xx_serial.c:177:16: warning: initialization discards ‘volatile’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  177 |   .uartbase  = &MODULE_ASCLIN0,
      |                ^
tc3xx/tc3xx_serial.c:178:16: warning: initialization discards ‘const’ qualifier from pointer target type [-Wdiscarded-qualifiers]
  178 |   .pins      = &g_uart0_pins,
      |                ^
common/tricore_trapcall.c: In function ‘tricore_trapcall’:
common/tricore_trapcall.c:66:3: warning: passing argument 4 of ‘_assert’ discards ‘volatile’ qualifier from pointer target type [-Wdiscarded-qualifiers]
   66 |   PANIC_WITH_REGS("Trap", CURRENT_REGS);
      |   ^~~~~~~~~~~~~~~
In file included from common/tricore_trapcall.c:29:
nuttx/include/assert.h:189:45: note: expected ‘void *’ but argument is of type ‘volatile uintptr_t *’ {aka ‘volatile long unsigned int *’}
  189 |              FAR const char *msg, FAR void *regs);

Signed-off-by: chao an <anchao@lixiang.com>
This commit is contained in:
chao an 2024-07-13 02:03:26 +08:00 committed by Xiang Xiao
parent 8e20b8d862
commit 4db1169e6f
4 changed files with 10 additions and 10 deletions

View file

@ -190,8 +190,8 @@ extern uintptr_t _lc_ge_data[]; /* End+1 of .data */
#define _edata _lc_ge_data
#define _eheap __USTACK0_END
#else
extern uintptr_t __HEAP[]; /* End+1 of .data */
extern uintptr_t __A0_MEM[]; /* End+1 of .data */
extern uintptr_t __HEAP[]; /* End+1 of .data */
extern uintptr_t __A0_MEM[]; /* End+1 of .data */
#define _sdata LCF_DSPR0_START
#define _edata __A0_MEM
#define _eheap __USTACK0_END
@ -250,7 +250,7 @@ void tricore_earlyserialinit(void);
/* System Timer *************************************************************/
struct oneshot_lowerhalf_s *
tricore_systimer_initialize(void *tbase, int irq, uint64_t freq);
tricore_systimer_initialize(volatile void *tbase, int irq, uint64_t freq);
/* Debug ********************************************************************/

View file

@ -44,7 +44,7 @@
struct tricore_systimer_lowerhalf_s
{
struct oneshot_lowerhalf_s lower;
void *tbase;
volatile void *tbase;
uint64_t freq;
uint64_t alarm;
oneshot_callback_t callback;
@ -307,7 +307,7 @@ static int tricore_systimer_interrupt(int irq, void *context, void *arg)
****************************************************************************/
struct oneshot_lowerhalf_s *
tricore_systimer_initialize(void *tbase, int irq, uint64_t freq)
tricore_systimer_initialize(volatile void *tbase, int irq, uint64_t freq)
{
struct tricore_systimer_lowerhalf_s *priv = &g_systimer_lower;

View file

@ -63,5 +63,5 @@ void tricore_trapcall(volatile void *trap)
CURRENT_REGS = regs;
up_irq_save();
PANIC_WITH_REGS("Trap", CURRENT_REGS);
PANIC_WITH_REGS("Trap", (void *)CURRENT_REGS);
}

View file

@ -100,10 +100,10 @@
struct up_dev_s
{
void *uartbase; /* Base address of UART registers */
void *pins; /* Pin configuration */
uint32_t baud; /* Configured baud */
uint8_t irq; /* IRQ associated with this UART */
volatile void *uartbase; /* Base address of UART registers */
const void *pins; /* Pin configuration */
uint32_t baud; /* Configured baud */
uint8_t irq; /* IRQ associated with this UART */
};
/****************************************************************************