All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Staging: wilc1000: Move extern declaration to header
@ 2016-09-17  7:54 Bhumika Goyal
  2016-09-17  8:46 ` [Outreachy kernel] " Julia Lawall
  0 siblings, 1 reply; 4+ messages in thread
From: Bhumika Goyal @ 2016-09-17  7:54 UTC (permalink / raw)
  To: gregkh, outreachy-kernel, ganesh.krishna, aditya.shankar; +Cc: Bhumika Goyal

Move extern declaration in wilc_wfi_cfgoperations.c to the
respective header wilc_wfi_cfgoperations.h. Extern
removed using coccinelle and other changes done by hand.
Script:
@@
identifier func;
type T;
@@
- extern
T func(...);

Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 3 ---
 drivers/staging/wilc1000/wilc_wfi_cfgoperations.h | 2 ++
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
index 2c2e8ac..3b26130 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
@@ -90,9 +90,6 @@ static const struct wiphy_wowlan_support wowlan_support = {
 #define IS_MGMT_STATUS_SUCCES			0x040
 #define GET_PKT_OFFSET(a) (((a) >> 22) & 0x1ff)
 
-extern int wilc_mac_open(struct net_device *ndev);
-extern int wilc_mac_close(struct net_device *ndev);
-
 static struct network_info last_scanned_shadow[MAX_NUM_SCANNED_NETWORKS_SHADOW];
 static u32 last_scanned_cnt;
 struct timer_list wilc_during_ip_timer;
diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
index 85a3810..ca71e49 100644
--- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
+++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
@@ -19,5 +19,7 @@ int WILC_WFI_deinit_mon_interface(void);
 struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_device *real_dev);
 void wilc_mgmt_frame_register(struct wiphy *wiphy, struct wireless_dev *wdev,
 			      u16 frame_type, bool reg);
+int wilc_mac_open(struct net_device *ndev);
+int wilc_mac_close(struct net_device *ndev);
 
 #endif
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Outreachy kernel] [PATCH] Staging: wilc1000: Move extern declaration to header
  2016-09-17  7:54 [PATCH] Staging: wilc1000: Move extern declaration to header Bhumika Goyal
@ 2016-09-17  8:46 ` Julia Lawall
  2016-09-17 11:56   ` Bhumika Goyal
  0 siblings, 1 reply; 4+ messages in thread
From: Julia Lawall @ 2016-09-17  8:46 UTC (permalink / raw)
  To: Bhumika Goyal; +Cc: gregkh, outreachy-kernel, ganesh.krishna, aditya.shankar



On Sat, 17 Sep 2016, Bhumika Goyal wrote:

> Move extern declaration in wilc_wfi_cfgoperations.c to the
> respective header wilc_wfi_cfgoperations.h. Extern
> removed using coccinelle and other changes done by hand.

With grep, it looks to me like these functions are only used in
linux_wlan.c.  There is a declaration in wilc_wfi_cfgoperations.c, but no
use.  Thus, it looks like the functions could be static.  Furthermore, if
the declaration of the wilc_netdev_ops structure were moved lower in the
file, perhaps the forward declarations could be dropped completely.

Be sure that you can compile the whole driver to check this.  There is
always the possibility of something strange being done with a macro that
could obscure another use.

julia

> Script:
> @@
> identifier func;
> type T;
> @@
> - extern
> T func(...);
>
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> ---
>  drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 3 ---
>  drivers/staging/wilc1000/wilc_wfi_cfgoperations.h | 2 ++
>  2 files changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> index 2c2e8ac..3b26130 100644
> --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> @@ -90,9 +90,6 @@ static const struct wiphy_wowlan_support wowlan_support = {
>  #define IS_MGMT_STATUS_SUCCES			0x040
>  #define GET_PKT_OFFSET(a) (((a) >> 22) & 0x1ff)
>
> -extern int wilc_mac_open(struct net_device *ndev);
> -extern int wilc_mac_close(struct net_device *ndev);
> -
>  static struct network_info last_scanned_shadow[MAX_NUM_SCANNED_NETWORKS_SHADOW];
>  static u32 last_scanned_cnt;
>  struct timer_list wilc_during_ip_timer;
> diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
> index 85a3810..ca71e49 100644
> --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
> +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
> @@ -19,5 +19,7 @@ int WILC_WFI_deinit_mon_interface(void);
>  struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_device *real_dev);
>  void wilc_mgmt_frame_register(struct wiphy *wiphy, struct wireless_dev *wdev,
>  			      u16 frame_type, bool reg);
> +int wilc_mac_open(struct net_device *ndev);
> +int wilc_mac_close(struct net_device *ndev);
>
>  #endif
> --
> 1.9.1
>
> --
> You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1474098886-6239-1-git-send-email-bhumirks%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Outreachy kernel] [PATCH] Staging: wilc1000: Move extern declaration to header
  2016-09-17  8:46 ` [Outreachy kernel] " Julia Lawall
@ 2016-09-17 11:56   ` Bhumika Goyal
  2016-09-17 15:32     ` Bhumika Goyal
  0 siblings, 1 reply; 4+ messages in thread
From: Bhumika Goyal @ 2016-09-17 11:56 UTC (permalink / raw)
  To: Julia Lawall; +Cc: gregkh, outreachy-kernel, ganesh.krishna, aditya.shankar

On Sat, Sep 17, 2016 at 2:16 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
>
>
>
> On Sat, 17 Sep 2016, Bhumika Goyal wrote:
>
> > Move extern declaration in wilc_wfi_cfgoperations.c to the
> > respective header wilc_wfi_cfgoperations.h. Extern
> > removed using coccinelle and other changes done by hand.
>
> With grep, it looks to me like these functions are only used in
> linux_wlan.c.  There is a declaration in wilc_wfi_cfgoperations.c, but no
> use.  Thus, it looks like the functions could be static.  Furthermore, if
> the declaration of the wilc_netdev_ops structure were moved lower in the
> file, perhaps the forward declarations could be dropped completely.
>

Yes, the functions wilc_mac_{close/open} can be made static. So I will
do it in v2 of this patch and remove their declaration from the header
as well as it won't be needed after making them static.
And the forward function prototypes can be dropped as well  if the
structure wilc_netdev_ops is moved lower.
I will make a separate patch for this change.

Thanks,
Bhumika
>
> Be sure that you can compile the whole driver to check this.  There is
> always the possibility of something strange being done with a macro that
> could obscure another use.
>
> julia
>
> > Script:
> > @@
> > identifier func;
> > type T;
> > @@
> > - extern
> > T func(...);
> >
> > Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> > ---
> >  drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 3 ---
> >  drivers/staging/wilc1000/wilc_wfi_cfgoperations.h | 2 ++
> >  2 files changed, 2 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> > index 2c2e8ac..3b26130 100644
> > --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> > +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> > @@ -90,9 +90,6 @@ static const struct wiphy_wowlan_support wowlan_support = {
> >  #define IS_MGMT_STATUS_SUCCES                        0x040
> >  #define GET_PKT_OFFSET(a) (((a) >> 22) & 0x1ff)
> >
> > -extern int wilc_mac_open(struct net_device *ndev);
> > -extern int wilc_mac_close(struct net_device *ndev);
> > -
> >  static struct network_info last_scanned_shadow[MAX_NUM_SCANNED_NETWORKS_SHADOW];
> >  static u32 last_scanned_cnt;
> >  struct timer_list wilc_during_ip_timer;
> > diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
> > index 85a3810..ca71e49 100644
> > --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
> > +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
> > @@ -19,5 +19,7 @@ int WILC_WFI_deinit_mon_interface(void);
> >  struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_device *real_dev);
> >  void wilc_mgmt_frame_register(struct wiphy *wiphy, struct wireless_dev *wdev,
> >                             u16 frame_type, bool reg);
> > +int wilc_mac_open(struct net_device *ndev);
> > +int wilc_mac_close(struct net_device *ndev);
> >
> >  #endif
> > --
> > 1.9.1
> >
> > --
> > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1474098886-6239-1-git-send-email-bhumirks%40gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
> >


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Outreachy kernel] [PATCH] Staging: wilc1000: Move extern declaration to header
  2016-09-17 11:56   ` Bhumika Goyal
@ 2016-09-17 15:32     ` Bhumika Goyal
  0 siblings, 0 replies; 4+ messages in thread
From: Bhumika Goyal @ 2016-09-17 15:32 UTC (permalink / raw)
  To: Julia Lawall; +Cc: gregkh, outreachy-kernel, ganesh.krishna, aditya.shankar

On Sat, Sep 17, 2016 at 5:26 PM, Bhumika Goyal <bhumirks@gmail.com> wrote:
>
> On Sat, Sep 17, 2016 at 2:16 PM, Julia Lawall <julia.lawall@lip6.fr> wrote:
> >
> >
> >
> > On Sat, 17 Sep 2016, Bhumika Goyal wrote:
> >
> > > Move extern declaration in wilc_wfi_cfgoperations.c to the
> > > respective header wilc_wfi_cfgoperations.h. Extern
> > > removed using coccinelle and other changes done by hand.
> >
> > With grep, it looks to me like these functions are only used in
> > linux_wlan.c.  There is a declaration in wilc_wfi_cfgoperations.c, but no
> > use.  Thus, it looks like the functions could be static.  Furthermore, if
> > the declaration of the wilc_netdev_ops structure were moved lower in the
> > file, perhaps the forward declarations could be dropped completely.
> >
>
> Yes, the functions wilc_mac_{close/open} can be made static. So I will
> do it in v2 of this patch and remove their declaration from the header
> as well as it won't be needed after making them static.
> And the forward function prototypes can be dropped as well  if the
> structure wilc_netdev_ops is moved lower.
> I will make a separate patch for this change.
>
> Thanks,
> Bhumika

Hey Greg,
I am dropping this patch because as pointed by Julia the functions can
be made static. So, I will do that in a separate patch along with some
other changes.

Thanks,
Bhumika
> >
> > Be sure that you can compile the whole driver to check this.  There is
> > always the possibility of something strange being done with a macro that
> > could obscure another use.
> >
> > julia
> >
> > > Script:
> > > @@
> > > identifier func;
> > > type T;
> > > @@
> > > - extern
> > > T func(...);
> > >
> > > Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> > > ---
> > >  drivers/staging/wilc1000/wilc_wfi_cfgoperations.c | 3 ---
> > >  drivers/staging/wilc1000/wilc_wfi_cfgoperations.h | 2 ++
> > >  2 files changed, 2 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> > > index 2c2e8ac..3b26130 100644
> > > --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> > > +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.c
> > > @@ -90,9 +90,6 @@ static const struct wiphy_wowlan_support wowlan_support = {
> > >  #define IS_MGMT_STATUS_SUCCES                        0x040
> > >  #define GET_PKT_OFFSET(a) (((a) >> 22) & 0x1ff)
> > >
> > > -extern int wilc_mac_open(struct net_device *ndev);
> > > -extern int wilc_mac_close(struct net_device *ndev);
> > > -
> > >  static struct network_info last_scanned_shadow[MAX_NUM_SCANNED_NETWORKS_SHADOW];
> > >  static u32 last_scanned_cnt;
> > >  struct timer_list wilc_during_ip_timer;
> > > diff --git a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
> > > index 85a3810..ca71e49 100644
> > > --- a/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
> > > +++ b/drivers/staging/wilc1000/wilc_wfi_cfgoperations.h
> > > @@ -19,5 +19,7 @@ int WILC_WFI_deinit_mon_interface(void);
> > >  struct net_device *WILC_WFI_init_mon_interface(const char *name, struct net_device *real_dev);
> > >  void wilc_mgmt_frame_register(struct wiphy *wiphy, struct wireless_dev *wdev,
> > >                             u16 frame_type, bool reg);
> > > +int wilc_mac_open(struct net_device *ndev);
> > > +int wilc_mac_close(struct net_device *ndev);
> > >
> > >  #endif
> > > --
> > > 1.9.1
> > >
> > > --
> > > You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
> > > To unsubscribe from this group and stop receiving emails from it, send an email to outreachy-kernel+unsubscribe@googlegroups.com.
> > > To post to this group, send email to outreachy-kernel@googlegroups.com.
> > > To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/1474098886-6239-1-git-send-email-bhumirks%40gmail.com.
> > > For more options, visit https://groups.google.com/d/optout.
> > >


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-09-17 15:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-17  7:54 [PATCH] Staging: wilc1000: Move extern declaration to header Bhumika Goyal
2016-09-17  8:46 ` [Outreachy kernel] " Julia Lawall
2016-09-17 11:56   ` Bhumika Goyal
2016-09-17 15:32     ` Bhumika Goyal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.