Skip to content

Commit

Permalink
arch/tricore: fix compiler warning on GCC toolchain
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
anchao committed Jul 16, 2024
1 parent 0cfbfcd commit 7b73250
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion arch/tricore/src/common/tricore_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 ********************************************************************/

Expand Down
4 changes: 2 additions & 2 deletions arch/tricore/src/common/tricore_systimer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion arch/tricore/src/common/tricore_trapcall.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
8 changes: 4 additions & 4 deletions arch/tricore/src/tc3xx/tc3xx_serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
};

/****************************************************************************
Expand Down

0 comments on commit 7b73250

Please sign in to comment.