summaryrefslogtreecommitdiffstats
path: root/c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@oarcorp.com>2013-09-21 16:10:17 -0500
committerJoel Sherrill <joel.sherrill@oarcorp.com>2013-09-21 16:10:17 -0500
commit34b57d61be1416686f13b66cf0b687f1006fdc0d (patch)
treeea3ef522a8665a1d0e8d76ab26d2324d0ae15103 /c
parentsparc/.../ambapp.h: Add ambapp_get_number_apbslv_devices() prototype (diff)
downloadrtems-34b57d61be1416686f13b66cf0b687f1006fdc0d.tar.bz2
sparc/.../grcan.c: Fix multiple warnings
Diffstat (limited to 'c')
-rw-r--r--c/src/lib/libbsp/sparc/shared/can/grcan.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/c/src/lib/libbsp/sparc/shared/can/grcan.c b/c/src/lib/libbsp/sparc/shared/can/grcan.c
index d592fbaad3..e7e0ca06ad 100644
--- a/c/src/lib/libbsp/sparc/shared/can/grcan.c
+++ b/c/src/lib/libbsp/sparc/shared/can/grcan.c
@@ -299,6 +299,12 @@ static void __inline__ grcan_hw_reset(struct grcan_regs *regs)
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)
{
unsigned int tmp;
@@ -368,6 +374,7 @@ static rtems_device_driver grcan_start(struct grcan_priv *pDev)
*/
return RTEMS_SUCCESSFUL;
}
+#pragma GCC diagnostic pop
static void grcan_stop(struct grcan_priv *pDev)
{
@@ -533,7 +540,7 @@ static int grcan_calc_timing(
{
int best_error = 1000000000;
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 sjw = 1;
@@ -583,7 +590,6 @@ static int grcan_calc_timing(
best_error = error;
best_tseg = tseg/2;
best_brp = brp-1;
- best_rate = core_hz/(brp*(1+tseg/2));
}
}