[rtems commit] bsp/gumstix: Fix warnings

Sebastian Huber sebh at rtems.org
Fri Jul 12 19:52:18 UTC 2013


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

Author:    Vipul Nayyar <nayyar_vipul at yahoo.com>
Date:      Fri Jul 12 22:51:57 2013 +0530

bsp/gumstix: Fix warnings

---

 c/src/lib/libbsp/arm/gumstix/rtl8019/rtl8019.c |   68 +++++-------------------
 1 files changed, 14 insertions(+), 54 deletions(-)

diff --git a/c/src/lib/libbsp/arm/gumstix/rtl8019/rtl8019.c b/c/src/lib/libbsp/arm/gumstix/rtl8019/rtl8019.c
index ef8ae4e..dd513ee 100644
--- a/c/src/lib/libbsp/arm/gumstix/rtl8019/rtl8019.c
+++ b/c/src/lib/libbsp/arm/gumstix/rtl8019/rtl8019.c
@@ -332,9 +332,9 @@ ne_check_status (struct ne_softc *sc, int from_irq_handler)
 /* Handle an NE2000 interrupt.  */
 
 static void
-ne_interrupt_handler (rtems_irq_hdl_param handle)
+ne_interrupt_handler (void *arg)
 {
-  struct ne_softc *sc = handle;
+  struct ne_softc *sc = arg;
 
   if (sc == NULL)
     return;
@@ -350,10 +350,8 @@ ne_interrupt_handler (rtems_irq_hdl_param handle)
 /* Turn NE2000 interrupts on.  */
 
 static void
-ne_interrupt_on (const void * handle)
+ne_interrupt_on (struct ne_softc *sc)
 {
-  struct ne_softc *sc = handle;
-
 #ifdef DEBUG_NE
   printk ("ne_interrupt_on()\n");
 #endif
@@ -361,44 +359,6 @@ ne_interrupt_on (const void * handle)
     outport_byte (sc->port + IMR, NE_INTERRUPTS);
 }
 
-/* Turn NE2000 interrupts off.  See ne_interrupt_on.  */
-
-static void
-ne_interrupt_off (const void * handle)
-{
-  struct ne_softc *sc = handle;
-
-#ifdef DEBUG_NE
-  printk ("ne_interrupt_off()\n");
-#endif
-  if (sc != NULL)
-    outport_byte (sc->port + IMR, 0);
-}
-
-/*
- *Return whether NE2000 interrupts are on.
- *If it is eanbled, return 1
-*/
-static int
-ne_interrupt_is_on (const void * handle)
-{
-  struct ne_softc *sc = handle;
-  unsigned char imr;
-#ifdef DEBUG_NE
-  printk("ne_interrupt_is_on()\n");
-#endif
-  if(sc != NULL){
-    /*Read IMR in Page2*/
-    outport_byte (sc->port + CMDR, MSK_PG2 | MSK_RD2 | MSK_STP);
-    inport_byte(sc->port + IMR, imr);
-    /*Back Page 0*/
-    outport_byte (sc->port + CMDR, MSK_PG0 | MSK_RD2 | MSK_STP);
-    if(imr == NE_INTERRUPTS)
-      return 1;
-  }
-  return 0;
-}
-
 /* Initialize the NE2000 hardware.  */
 
 static void
@@ -484,15 +444,17 @@ ne_init_irq_handler(struct ne_softc *sc)
 #ifdef DEBUG_NE
   printk("ne_init_irq_handler(%d)\n", sc->irno);
 #endif
+
   status = rtems_interrupt_handler_install(
-        sc->irno,
-        "RTL8019",
-        RTEMS_INTERRUPT_UNIQUE,
-        ne_interrupt_handler,
-        sc
-    );
-    assert(status == RTEMS_SUCCESSFUL);
-    ne_interrupt_on(sc);
+    sc->irno,
+    "RTL8019",
+    RTEMS_INTERRUPT_UNIQUE,
+    ne_interrupt_handler,
+    sc
+  );
+  assert(status == RTEMS_SUCCESSFUL);
+  ne_interrupt_on(sc);
+}
 
 /* The NE2000 packet receive daemon.  This task is started when the
    NE2000 driver is initialized.  */
@@ -526,7 +488,7 @@ ne_rx_daemon (void *arg)
     {
       unsigned char startpage, currpage;
       unsigned short len;
-      unsigned char next, stat, cnt1, cnt2;
+      unsigned char next, cnt1, cnt2;
       struct mbuf *m = NULL;
       unsigned char *p;
       int startaddr;
@@ -614,8 +576,6 @@ ne_rx_daemon (void *arg)
         goto Next;
       }
 
-      stat = hdr.rsr;
-
       /* The first four bytes of the length are the buffer header
        * Just decrease them by 2 since in ARM, we have to make sure
        * 4bytes memory access align on 4bytes




More information about the vc mailing list