[PATCH 4/7] smc91111: Move driver attach prototype to header file.

Gedare Bloom gedare at rtems.org
Fri Mar 14 12:38:51 UTC 2014


On Fri, Mar 14, 2014 at 4:59 AM, Daniel Cederman <cederman at gaisler.com> wrote:
>
> On 2014-03-13 15:30, Joel Sherrill wrote:
>>
>> One comment below which doesn't match your description.
>>
>> On 3/13/2014 9:19 AM, Daniel Cederman wrote:
>>>
>>> ---
>>>   .../lib/libbsp/powerpc/mpc55xxevb/network/if_smc.c |    5 -----
>>>   .../sparc/leon2/leon_smc91111/leon_smc91111.c      |    5 -----
>>>   .../sparc/leon3/leon_smc91111/leon_smc91111.c      |    3 ---
>>>   c/src/libchip/network/smc91111.c                   |    7 ++++---
>>>   c/src/libchip/network/smc91111exp.h                |    3 +++
>>>   5 files changed, 7 insertions(+), 16 deletions(-)
>>>
>>> diff --git a/c/src/lib/libbsp/powerpc/mpc55xxevb/network/if_smc.c
>>> b/c/src/lib/libbsp/powerpc/mpc55xxevb/network/if_smc.c
>>> index 026a56c..995bf0b 100644
>>> --- a/c/src/lib/libbsp/powerpc/mpc55xxevb/network/if_smc.c
>>> +++ b/c/src/lib/libbsp/powerpc/mpc55xxevb/network/if_smc.c
>>> @@ -64,11 +64,6 @@ scmv91111_configuration_t
>>> mpc5554_scmv91111_configuration = {
>>>     (void *)0
>>>   };
>>>
>>> -int _rtems_smc91111_driver_attach(
>>> -  struct rtems_bsdnet_ifconfig *config,
>>> -  scmv91111_configuration_t    *scm_config
>>> -);
>>> -
>>>   /*
>>>    * Attach an SMC91111 driver to the system
>>>    */
>>> diff --git a/c/src/lib/libbsp/sparc/leon2/leon_smc91111/leon_smc91111.c
>>> b/c/src/lib/libbsp/sparc/leon2/leon_smc91111/leon_smc91111.c
>>> index ad74c9a..abf1efc 100644
>>> --- a/c/src/lib/libbsp/sparc/leon2/leon_smc91111/leon_smc91111.c
>>> +++ b/c/src/lib/libbsp/sparc/leon2/leon_smc91111/leon_smc91111.c
>>> @@ -40,11 +40,6 @@ scmv91111_configuration_t leon_scmv91111_configuration
>>> = {
>>>     1                   /* autoneg */
>>>   };
>>>
>>> -int _rtems_smc91111_driver_attach(
>>> -  struct rtems_bsdnet_ifconfig *config,
>>> -  scmv91111_configuration_t    *scm_config
>>> -);
>>> -
>>>   /*
>>>    * Attach an SMC91111 driver to the system
>>>    */
>>> diff --git a/c/src/lib/libbsp/sparc/leon3/leon_smc91111/leon_smc91111.c
>>> b/c/src/lib/libbsp/sparc/leon3/leon_smc91111/leon_smc91111.c
>>> index 9b9961d..a57de8f 100644
>>> --- a/c/src/lib/libbsp/sparc/leon3/leon_smc91111/leon_smc91111.c
>>> +++ b/c/src/lib/libbsp/sparc/leon3/leon_smc91111/leon_smc91111.c
>>> @@ -23,9 +23,6 @@ scmv91111_configuration_t leon_scmv91111_configuration
>>> = {
>>>     1                                   /* autoneg */
>>>   };
>>>
>>> -int _rtems_smc91111_driver_attach (struct rtems_bsdnet_ifconfig *config,
>>> -                                  scmv91111_configuration_t *
>>> scm_config);
>>> -
>>>   /*
>>>    * Attach an SMC91111 driver to the system
>>>    */
>>> diff --git a/c/src/libchip/network/smc91111.c
>>> b/c/src/libchip/network/smc91111.c
>>> index 2332688..6628ad5 100644
>>> --- a/c/src/libchip/network/smc91111.c
>>> +++ b/c/src/libchip/network/smc91111.c
>>> @@ -82,7 +82,7 @@ static void lan91cxx_phy_configure(struct
>>> lan91cxx_priv_data *cpd);
>>>   #define max(l,r) ((l) > (r) ? (l) : (r))
>>>
>>>   /* \ ------------- Interrupt ------------- \ */
>>> -void lan91cxx_interrupt_handler(void *arg)
>>> +static void lan91cxx_interrupt_handler(void *arg)
>>>   {
>>>         struct lan91cxx_priv_data *cpd = arg;
>>>         unsigned short irq, event;
>>> @@ -247,7 +247,8 @@ static void lan91cxx_recv(struct lan91cxx_priv_data
>>> *cpd, struct mbuf *m)
>>>                         }
>>>                 }
>>>                 db64_printf(" \n");
>>> -
>>> +#else
>>> +               (void)start;
>>>   #endif
>>
>> Why this change?
>>
>
> start is set in multiple places but only used when debugging is enabled. So
> to remove the warning when debugging is not enabled I added the ifdef to
> signal to the compiler that start is not used. Should I update the
> description or make a new patch?
>
>
For this long of an ifdef...endif block, i found it hard to understand
what the condition was, perhaps you can just document it somehow.
(This seems like another possible coding convention we should
discuss..) Otherwise, the change is fine.
-Gedare

>>>         }
>>>         val = get_data(cpd);    /* Read control word (and potential data)
>>> unconditionally */
>>> @@ -657,7 +658,7 @@ static void sendpacket(struct ifnet *ifp, struct mbuf
>>> *m)
>>>         dbg_prefix = "";
>>>   }
>>>
>>> -void smc91111_txDaemon(void *arg)
>>> +static void smc91111_txDaemon(void *arg)
>>>   {
>>>         struct lan91cxx_priv_data *cpd = arg;
>>>         struct ifnet *ifp = &cpd->arpcom.ac_if;
>>> diff --git a/c/src/libchip/network/smc91111exp.h
>>> b/c/src/libchip/network/smc91111exp.h
>>> index 11feaab..08e086d 100644
>>> --- a/c/src/libchip/network/smc91111exp.h
>>> +++ b/c/src/libchip/network/smc91111exp.h
>>> @@ -18,6 +18,9 @@ typedef struct scmv91111_configuration {
>>>   #endif
>>>   } scmv91111_configuration_t;
>>>
>>> +int _rtems_smc91111_driver_attach (struct rtems_bsdnet_ifconfig *config,
>>> +                                  scmv91111_configuration_t *
>>> scm_config);
>>> +
>>>   #endif  /* _SMC_91111_EXP_H_ */
>>>
>>>
>>
> _______________________________________________
> rtems-devel mailing list
> rtems-devel at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-devel



More information about the devel mailing list