sparc/.../grcan.c: Fix multiple warnings

This commit is contained in:
Joel Sherrill
2013-09-21 16:10:17 -05:00
parent e9da278c05
commit 34b57d61be

View File

@@ -299,6 +299,12 @@ static void __inline__ grcan_hw_reset(struct grcan_regs *regs)
regs->ctrl = GRCAN_CTRL_RESET; regs->ctrl = GRCAN_CTRL_RESET;
} }
/*
* tmp is set but never used. GCC gives a warning for this
* and we need to tell GCC not to complain.
*/
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-but-set-variable"
static rtems_device_driver grcan_start(struct grcan_priv *pDev) static rtems_device_driver grcan_start(struct grcan_priv *pDev)
{ {
unsigned int tmp; unsigned int tmp;
@@ -368,6 +374,7 @@ static rtems_device_driver grcan_start(struct grcan_priv *pDev)
*/ */
return RTEMS_SUCCESSFUL; return RTEMS_SUCCESSFUL;
} }
#pragma GCC diagnostic pop
static void grcan_stop(struct grcan_priv *pDev) static void grcan_stop(struct grcan_priv *pDev)
{ {
@@ -533,7 +540,7 @@ static int grcan_calc_timing(
{ {
int best_error = 1000000000; int best_error = 1000000000;
int error; int error;
int best_tseg=0, best_brp=0, best_rate=0, brp=0; int best_tseg=0, best_brp=0, brp=0;
int tseg=0, tseg1=0, tseg2=0; int tseg=0, tseg1=0, tseg2=0;
int sjw = 1; int sjw = 1;
@@ -583,7 +590,6 @@ static int grcan_calc_timing(
best_error = error; best_error = error;
best_tseg = tseg/2; best_tseg = tseg/2;
best_brp = brp-1; best_brp = brp-1;
best_rate = core_hz/(brp*(1+tseg/2));
} }
} }