<html><body><div style="color:#000; background-color:#fff; font-family:arial, helvetica, sans-serif;font-size:10pt"><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;">Hello,</div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"><br></div><div style="background-color: transparent;"><font size="2">Thanks for the advice. In fact I removed most of the warnings with the help of Google only in my earlier patch. </font></div><div style="background-color: transparent;"><font size="2" style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 13px; font-style: normal;">I've checked and removed functions at91rm9200_emac_isr_off() & at91rm9200_emac_isr_is_on() since they're defined but not used.</font></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><font size="2"
style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 13px; font-style: normal;">I've made phywrite() & phyread() static since they're not used anywhere else.</font></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><font size="2" style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 13px; font-style: normal;"><br></font></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><font size="2" style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 13px; font-style: normal;">But still I'm getting a warning saying : </font><span style="background-color: transparent;"><font size="2">'phyread' defined but not used [-Wunused-function] . Although it is used a couple of
times in the file, but still I'm getting this warning. Maybe it has something to do with being a static function. Please try this patch.</font></span></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: arial, helvetica, sans-serif; font-style: normal;"><span style="background-color: transparent;"><font size="2"><br></font></span></div><div style="background-color: transparent;"><span style="background-color: transparent;"><font size="2"><div style="background-color: transparent;">commit 43c2a6852c1474f7e5877f590181a47d277c914a</div><div style="background-color: transparent;">Author: Vipul Nayyar <nayyar_vipul@yahoo.com></div><div style="background-color: transparent;">Date: Sat Jul 6 22:26:06 2013 +0530</div><div style="background-color: transparent;"><br></div><div style="background-color: transparent;"> Updated Legacy code in arm csb337</div><div style="background-color:
transparent;"><br></div><div style="background-color: transparent;">diff --git a/c/src/lib/libbsp/arm/csb337/network/network.c b/c/src/lib/libbsp/arm/csb337/network/network.c</div><div style="background-color: transparent;">index e31bcc0..2a39db2 100644</div><div style="background-color: transparent;">--- a/c/src/lib/libbsp/arm/csb337/network/network.c</div><div style="background-color: transparent;">+++ b/c/src/lib/libbsp/arm/csb337/network/network.c</div><div style="background-color: transparent;">@@ -22,6 +22,7 @@</div><div style="background-color: transparent;"> </div><div style="background-color: transparent;"> #include <errno.h></div><div style="background-color: transparent;"> #include <rtems/error.h></div><div style="background-color: transparent;">+#include <assert.h></div><div style="background-color: transparent;"> </div><div style="background-color: transparent;"> #include
<sys/param.h></div><div style="background-color: transparent;"> #include <sys/mbuf.h></div><div style="background-color: transparent;">@@ -83,20 +84,7 @@</div><div style="background-color: transparent;"> #define START_TRANSMIT_EVENT RTEMS_EVENT_2</div><div style="background-color: transparent;"> </div><div style="background-color: transparent;"> static void at91rm9200_emac_isr (rtems_irq_hdl_param unused);</div><div style="background-color: transparent;">-static void at91rm9200_emac_isr_on(const rtems_irq_connect_data *unused);</div><div style="background-color: transparent;">-static void at91rm9200_emac_isr_off(const rtems_irq_connect_data *unused);</div><div style="background-color: transparent;">-static int at91rm9200_emac_isr_is_on(const rtems_irq_connect_data *irq);</div><div style="background-color: transparent;">-</div><div style="background-color: transparent;">-/* Replace the first value with
the clock's interrupt name. */</div><div style="background-color: transparent;">-rtems_irq_connect_data at91rm9200_emac_isr_data = {</div><div style="background-color: transparent;">- AT91RM9200_INT_EMAC,</div><div style="background-color: transparent;">- at91rm9200_emac_isr,</div><div style="background-color: transparent;">- NULL,</div><div style="background-color: transparent;">- at91rm9200_emac_isr_on,</div><div style="background-color: transparent;">- at91rm9200_emac_isr_off,</div><div style="background-color: transparent;">- at91rm9200_emac_isr_is_on</div><div style="background-color: transparent;">-};</div><div style="background-color: transparent;">-</div><div style="background-color: transparent;">+static void at91rm9200_emac_isr_on(void);</div><div style="background-color: transparent;"> </div><div style="background-color: transparent;"> /* use the values
defined in linkcmds for our use of SRAM */</div><div style="background-color: transparent;"> extern void * at91rm9200_emac_rxbuf_hdrs;</div><div style="background-color: transparent;">@@ -208,12 +196,13 @@ void at91rm9200_emac_stats (at91rm9200_emac_softc_t *sc);</div><div style="background-color: transparent;"> static int at91rm9200_emac_ioctl (struct ifnet *ifp,</div><div style="background-color: transparent;"> ioctl_command_t command,</div><div style="background-color: transparent;"> caddr_t data);</div><div style="background-color: transparent;">-</div><div style="background-color: transparent;">+static void phywrite(uint8_t reg, uint16_t data);</div><div style="background-color:
transparent;">+static uint32_t phyread(uint8_t reg);</div><div style="background-color: transparent;"> </div><div style="background-color: transparent;"> /*</div><div style="background-color: transparent;"> * phyread(): Read the PHY</div><div style="background-color: transparent;"> */</div><div style="background-color: transparent;">-uint32_t phyread(uint8_t reg)</div><div style="background-color: transparent;">+static uint32_t phyread(uint8_t reg)</div><div style="background-color: transparent;"> {</div><div style="background-color: transparent;"> EMAC_REG(EMAC_MAN) = (0x01 << 30 /* Start of Frame Delimiter */</div><div style="background-color: transparent;"> | 0x02 << 28 /* Operation, 0x01 = Write, 0x02 = Read */</div><div style="background-color: transparent;">@@ -238,7 +227,7 @@ uint32_t phyread(uint8_t
reg)</div><div style="background-color: transparent;"> /*</div><div style="background-color: transparent;"> * phywrite(): Write the PHY</div><div style="background-color: transparent;"> */</div><div style="background-color: transparent;">-void phywrite(uint8_t reg, uint16_t data)</div><div style="background-color: transparent;">+static void phywrite(uint8_t reg, uint16_t data)</div><div style="background-color: transparent;"> {</div><div style="background-color: transparent;"> EMAC_REG(EMAC_MAN) = (0x01 << 30 /* Start of Frame Delimiter */</div><div style="background-color: transparent;"> | 0x01 << 28 /* Operation, 0x01 = Write, 0x02 = Read */</div><div style="background-color: transparent;">@@ -358,6 +347,7 @@ void at91rm9200_emac_init(void *arg)</div><div style="background-color: transparent;"> {</div><div
style="background-color: transparent;"> at91rm9200_emac_softc_t *sc = arg;</div><div style="background-color: transparent;"> struct ifnet *ifp = &sc->arpcom.ac_if;</div><div style="background-color: transparent;">+ rtems_status_code status = RTEMS_SUCCESSFUL;</div><div style="background-color: transparent;"> </div><div style="background-color: transparent;"> /*</div><div style="background-color: transparent;"> *This is for stuff that only gets done once (at91rm9200_emac_init()</div><div style="background-color: transparent;">@@ -382,7 +372,15 @@ void at91rm9200_emac_init(void *arg)</div><div style="background-color: transparent;"> AIC_SMR_REG(AIC_SMR_EMAC) = AIC_SMR_PRIOR(EMAC_INT_PRIORITY);</div><div style="background-color: transparent;"> </div><div style="background-color: transparent;"> /*
install the interrupt handler */</div><div style="background-color: transparent;">- BSP_install_rtems_irq_handler(&at91rm9200_emac_isr_data);</div><div style="background-color: transparent;">+ status = rtems_interrupt_handler_install(</div><div style="background-color: transparent;">+ AT91RM9200_INT_EMAC,</div><div style="background-color: transparent;">+ "Network",</div><div style="background-color: transparent;">+ RTEMS_INTERRUPT_UNIQUE,</div><div style="background-color: transparent;">+ at91rm9200_emac_isr,</div><div style="background-color: transparent;">+ NULL</div><div style="background-color: transparent;">+ ); </div><div style="background-color: transparent;">+ assert(status == RTEMS_SUCCESSFUL);</div><div style="background-color: transparent;">+
at91rm9200_emac_isr_on(); </div><div style="background-color: transparent;"> </div><div style="background-color: transparent;"> /* EMAC doesn't support promiscuous, so ignore requests */</div><div style="background-color: transparent;"> if (ifp->if_flags & IFF_PROMISC) {</div><div style="background-color: transparent;">@@ -767,7 +765,7 @@ void at91rm9200_emac_stats (at91rm9200_emac_softc_t *sc)</div><div style="background-color: transparent;"> </div><div style="background-color: transparent;"> </div><div style="background-color: transparent;"> /* Enables at91rm9200_emac interrupts. */</div><div style="background-color: transparent;">-static void at91rm9200_emac_isr_on(const rtems_irq_connect_data *unused)</div><div style="background-color: transparent;">+static void at91rm9200_emac_isr_on()</div><div style="background-color: transparent;"> {</div><div
style="background-color: transparent;"> /* Enable various TX/RX interrupts */</div><div style="background-color: transparent;"> EMAC_REG(EMAC_IER) = (EMAC_INT_RCOM | /* Receive complete */</div><div style="background-color: transparent;">@@ -779,23 +777,6 @@ static void at91rm9200_emac_isr_on(const rtems_irq_connect_data *unused)</div><div style="background-color: transparent;"> return;</div><div style="background-color: transparent;"> }</div><div style="background-color: transparent;"> </div><div style="background-color: transparent;">-/* Disables at91rm9200_emac interrupts */</div><div style="background-color: transparent;">-static void at91rm9200_emac_isr_off(const rtems_irq_connect_data *unused)</div><div style="background-color: transparent;">-{</div><div style="background-color: transparent;">- /* disable all various TX/RX interrupts */</div><div
style="background-color: transparent;">- EMAC_REG(EMAC_IDR) = 0xffffffff;</div><div style="background-color: transparent;">- return;</div><div style="background-color: transparent;">-}</div><div style="background-color: transparent;">-</div><div style="background-color: transparent;">-/* Tests to see if at91rm9200_emac interrupts are enabled, and</div><div style="background-color: transparent;">- * returns non-0 if so.</div><div style="background-color: transparent;">- * If interrupt is not enabled, returns 0.</div><div style="background-color: transparent;">- */</div><div style="background-color: transparent;">-static int at91rm9200_emac_isr_is_on(const rtems_irq_connect_data *irq)</div><div style="background-color: transparent;">-{</div><div style="background-color: transparent;">- return EMAC_REG(EMAC_IMR); /* any interrupts enabled? */</div><div style="background-color: transparent;">-}</div><div
style="background-color: transparent;">-</div><div style="background-color: transparent;"> /* Driver ioctl handler */</div><div style="background-color: transparent;"> static int</div><div style="background-color: transparent;"> at91rm9200_emac_ioctl (struct ifnet *ifp, ioctl_command_t command, caddr_t data)</div><div style="color: rgb(0, 0, 0); font-family: arial, helvetica, sans-serif; font-size: 13px; font-style: normal;"><br></div></font></span></div><div style="font-family: arial, helvetica, clean, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><br></div><div style="font-family: arial, helvetica, clean, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;">Regards</div><div style="font-family: arial, helvetica, clean, sans-serif; font-size: 13px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><span
style="background-color:transparent;line-height:1.22;">Vipul Nayyar </span></div><div style="font-family: arial, helvetica, clean, sans-serif; font-size: 12.727272033691406px; color: rgb(0, 0, 0); background-color: transparent; font-style: normal;"><br></div><div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"><br></div> <div style="font-family: arial, helvetica, sans-serif; font-size: 10pt;"> <div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt;"> <div dir="ltr"> <hr size="1"> <font size="2" face="Arial"> <b><span style="font-weight:bold;">From:</span></b> Sebastian Huber <sebastian.huber@embedded-brains.de><br> <b><span style="font-weight: bold;">To:</span></b> Vipul Nayyar <nayyar_vipul@yahoo.com> <br><b><span style="font-weight: bold;">Cc:</span></b> "rtems-devel@rtems.org" <rtems-devel@rtems.org> <br> <b><span style="font-weight: bold;">Sent:</span></b> Saturday, 6 July
2013 2:03 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [Patch] Removing legacy method from arm csb337<br> </font> </div> <div class="y_msg_container"><br>Hello,<br><br>if you encounter a warning and you don't know how to get rid of it, then <br>don't ignore it. You can for example ask on the mailing list how to <br>deal with it. Before this ask a search engine.<br><br>On 05/07/13 18:58, Sebastian Huber wrote:<br>> gmake[6]: Entering directory <br>> `/home/sh/git-build/b-csb337/arm-rtems4.11/c/csb337/lib/libbsp/arm/csb337'<br>> arm-rtems4.11-gcc --pipe -B../../../../../.././lib/ <br>> -B../../../../../.././csb337/lib/ -specs bsp_specs -qrtems <br>> -DHAVE_CONFIG_H -isystem ../../../../../.././csb337/lib/include <br>> -D__INSIDE_RTEMS_BSD_TCPIP_STACK__ -mstructure-size-boundary=8 <br>> -mcpu=arm920 -mfpu=vfp -mfloat-abi=soft -O2 -g -Wall <br>> -Wmissing-prototypes
-Wimplicit-function-declaration <br>> -Wstrict-prototypes -Wnested-externs -MT network_rel-network.o -MD -MP <br>> -MF .deps/network_rel-network.Tpo -c -o network_rel-network.o `test -f <br>> 'network/network.c' || echo <br>> '/home/sh/rtems-4.11/c/src/lib/libbsp/arm/csb337/'`network/network.c<br>> /home/sh/rtems-4.11/c/src/lib/libbsp/arm/csb337/network/network.c:87:1: warning: <br>> function declaration isn't a prototype [-Wstrict-prototypes]<br>> static void at91rm9200_emac_isr_on();<br>> ^<br><br>This is the first hit with Google:<br><br><a href="http://stackoverflow.com/questions/42125/function-declaration-isnt-a-prototype" target="_blank">http://stackoverflow.com/questions/42125/function-declaration-isnt-a-prototype</a><br><br>[...]<br>> ^<br>> /home/sh/rtems-4.11/c/src/lib/libbsp/arm/csb337/network/network.c:207:10: <br>> warning: no previous prototype for 'phyread'
[-Wmissing-prototypes]<br>> uint32_t phyread(uint8_t reg)<br>> ^<br>> /home/sh/rtems-4.11/c/src/lib/libbsp/arm/csb337/network/network.c:232:6: <br>> warning: no previous prototype for 'phywrite' [-Wmissing-prototypes]<br>> void phywrite(uint8_t reg, uint16_t data)<br><br>Here we have global functions without a prototype in a header file. This <br>is very bad. In case you see this, then search if this function is used <br>in other places. If yes, then ask on the mailing list. If no, then make <br>it static.<br><br>[...]<br><br>> /home/sh/rtems-4.11/c/src/lib/libbsp/arm/csb337/network/network.c:784:13: <br>> warning: 'at91rm9200_emac_isr_off' defined but not used <br>> [-Wunused-function]<br>> static void at91rm9200_emac_isr_off()<br>> ^<br>>
/home/sh/rtems-4.11/c/src/lib/libbsp/arm/csb337/network/network.c:795:12: <br>> warning: 'at91rm9200_emac_isr_is_on' defined but not used <br>> [-Wunused-function]<br>> static int at91rm9200_emac_isr_is_on() <br><br>In case you get this warning, then you have to determine if it is really <br>unused. If yes, then delete this function (and its prototype). If no, <br>then use it.<br><br>-- <br>Sebastian Huber, embedded brains GmbH<br><br>Address : Dornierstr. 4, D-82178 Puchheim, Germany<br>Phone : +49 89 189 47 41-16<br>Fax : +49 89 189 47 41-09<br>E-Mail : <a ymailto="mailto:sebastian.huber@embedded-brains.de" href="mailto:sebastian.huber@embedded-brains.de">sebastian.huber@embedded-brains.de</a><br>PGP : Public key available on request.<br><br>Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.<br><br><br><br></div> </div> </div> </div></body></html>