[rtems commit] sparc/.../grcan.c: Switch to using RTEMS_COMPILER_UNUSED_ATTRIBUTE

Joel Sherrill joel at rtems.org
Sun Sep 22 14:37:20 UTC 2013


Module:    rtems
Branch:    master
Commit:    f07b0e6563430b38f6d362a6b21011190e331562
Changeset: http://git.rtems.org/rtems/commit/?id=f07b0e6563430b38f6d362a6b21011190e331562

Author:    Joel Sherrill <joel.sherrill at oarcorp.com>
Date:      Sun Sep 22 09:41:49 2013 -0500

sparc/.../grcan.c: Switch to using RTEMS_COMPILER_UNUSED_ATTRIBUTE

---

 c/src/lib/libbsp/sparc/shared/can/grcan.c |   14 ++++++--------
 1 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/c/src/lib/libbsp/sparc/shared/can/grcan.c b/c/src/lib/libbsp/sparc/shared/can/grcan.c
index e7e0ca0..9d86bc4 100644
--- a/c/src/lib/libbsp/sparc/shared/can/grcan.c
+++ b/c/src/lib/libbsp/sparc/shared/can/grcan.c
@@ -299,15 +299,14 @@ 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;
+  /*
+   * tmp is set but never used. GCC gives a warning for this
+   * and we need to tell GCC not to complain.
+   */
+  unsigned int tmp RTEMS_COMPILER_UNUSED_ATTRIBUTE;
+
   IRQ_GLOBAL_PREPARE(oldLevel);
 
   FUNCDBG();
@@ -374,7 +373,6 @@ 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)
 {




More information about the vc mailing list