linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] b43: mark some functions and structs static
@ 2013-03-27 16:15 Hauke Mehrtens
  2013-03-27 16:15 ` [PATCH 2/2] b43: make struct b2056_inittabs_pts const Hauke Mehrtens
  2013-03-27 17:27 ` [PATCH 1/2] b43: mark some functions and structs static John W. Linville
  0 siblings, 2 replies; 6+ messages in thread
From: Hauke Mehrtens @ 2013-03-27 16:15 UTC (permalink / raw)
  To: linville; +Cc: zajec5, linux-wireless, b43-dev, Hauke Mehrtens

This fixes some sparse warnings.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 drivers/net/wireless/b43/phy_n.c          |    6 ++++--
 drivers/net/wireless/b43/radio_2056.c     |    2 +-
 drivers/net/wireless/b43/sdio.h           |    4 ++--
 drivers/net/wireless/b43/tables_nphy.c    |    4 ++--
 drivers/net/wireless/b43/tables_phy_lcn.c |    6 +++---
 5 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 1ec0d69..8d15878 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -2789,9 +2789,11 @@ static void b43_nphy_iq_cal_gain_params(struct b43_wldev *dev, u16 core,
  * Tx and Rx
  **************************************************/
 
-void b43_nphy_set_rxantenna(struct b43_wldev *dev, int antenna)
+#if 0
+static void b43_nphy_set_rxantenna(struct b43_wldev *dev, int antenna)
 {//TODO
 }
+#endif
 
 static void b43_nphy_op_adjust_txpower(struct b43_wldev *dev)
 {//TODO
@@ -4892,7 +4894,7 @@ static void b43_nphy_superswitch_init(struct b43_wldev *dev, bool init)
 }
 
 /* http://bcm-v4.sipsolutions.net/802.11/PHY/Init/N */
-int b43_phy_initn(struct b43_wldev *dev)
+static int b43_phy_initn(struct b43_wldev *dev)
 {
 	struct ssb_sprom *sprom = dev->dev->bus_sprom;
 	struct b43_phy *phy = &dev->phy;
diff --git a/drivers/net/wireless/b43/radio_2056.c b/drivers/net/wireless/b43/radio_2056.c
index ce037fb..ab1f55f 100644
--- a/drivers/net/wireless/b43/radio_2056.c
+++ b/drivers/net/wireless/b43/radio_2056.c
@@ -2980,7 +2980,7 @@ static const struct b2056_inittab_entry b2056_inittab_rev8_rx[] = {
 	.rx		= prefix##_rx,			\
 	.rx_length	= ARRAY_SIZE(prefix##_rx)
 
-struct b2056_inittabs_pts b2056_inittabs[] = {
+static struct b2056_inittabs_pts b2056_inittabs[] = {
 	[3] = { INITTABSPTS(b2056_inittab_rev3) },
 	[4] = { INITTABSPTS(b2056_inittab_rev4) },
 	[5] = { INITTABSPTS(b2056_inittab_rev5) },
diff --git a/drivers/net/wireless/b43/sdio.h b/drivers/net/wireless/b43/sdio.h
index fb63309..1e93926 100644
--- a/drivers/net/wireless/b43/sdio.h
+++ b/drivers/net/wireless/b43/sdio.h
@@ -25,12 +25,12 @@ void b43_sdio_exit(void);
 #else /* CONFIG_B43_SDIO */
 
 
-int b43_sdio_request_irq(struct b43_wldev *dev,
+static inline int b43_sdio_request_irq(struct b43_wldev *dev,
 			 void (*handler)(struct b43_wldev *dev))
 {
 	return -ENODEV;
 }
-void b43_sdio_free_irq(struct b43_wldev *dev)
+static inline void b43_sdio_free_irq(struct b43_wldev *dev)
 {
 }
 static inline int b43_sdio_init(void)
diff --git a/drivers/net/wireless/b43/tables_nphy.c b/drivers/net/wireless/b43/tables_nphy.c
index aaca60c..110510d 100644
--- a/drivers/net/wireless/b43/tables_nphy.c
+++ b/drivers/net/wireless/b43/tables_nphy.c
@@ -2800,7 +2800,7 @@ static const struct nphy_rf_control_override_rev7
 	{ 0x0010, 0x344, 0x345, 0x0010, 4 },
 };
 
-struct nphy_gain_ctl_workaround_entry nphy_gain_ctl_wa_phy6_radio11_ghz2 = {
+static struct nphy_gain_ctl_workaround_entry nphy_gain_ctl_wa_phy6_radio11_ghz2 = {
 	{ 10, 14, 19, 27 },
 	{ -5, 6, 10, 15 },
 	{ 0xA, 0xA, 0xA, 0xA, 0xA, 0xA, 0xA, 0xA, 0xA, 0xA },
@@ -2811,7 +2811,7 @@ struct nphy_gain_ctl_workaround_entry nphy_gain_ctl_wa_phy6_radio11_ghz2 = {
 	0x18, 0x18, 0x18,
 	0x01D0, 0x5,
 };
-struct nphy_gain_ctl_workaround_entry nphy_gain_ctl_workaround[2][4] = {
+static struct nphy_gain_ctl_workaround_entry nphy_gain_ctl_workaround[2][4] = {
 	{ /* 2GHz */
 		{ /* PHY rev 3 */
 			{ 7, 11, 16, 23 },
diff --git a/drivers/net/wireless/b43/tables_phy_lcn.c b/drivers/net/wireless/b43/tables_phy_lcn.c
index 5176363..e347b8d 100644
--- a/drivers/net/wireless/b43/tables_phy_lcn.c
+++ b/drivers/net/wireless/b43/tables_phy_lcn.c
@@ -313,7 +313,7 @@ static const u32 b43_lcntab_0x18[] = {
  * TX gain.
  **************************************************/
 
-const struct b43_lcntab_tx_gain_tbl_entry
+static const struct b43_lcntab_tx_gain_tbl_entry
 	b43_lcntab_tx_gain_tbl_2ghz_ext_pa_rev0[B43_LCNTAB_TX_GAIN_SIZE] = {
 	{ 0x03, 0x00, 0x1f, 0x0, 0x48 },
 	{ 0x03, 0x00, 0x1f, 0x0, 0x46 },
@@ -449,7 +449,7 @@ const struct b43_lcntab_tx_gain_tbl_entry
  * SW control.
  **************************************************/
 
-const u16 b43_lcntab_sw_ctl_4313_epa_rev0[] = {
+static const u16 b43_lcntab_sw_ctl_4313_epa_rev0[] = {
 	0x0002, 0x0008, 0x0004, 0x0001, 0x0002, 0x0008,
 	0x0004, 0x0001, 0x0002, 0x0008, 0x0004, 0x0001,
 	0x0002, 0x0008, 0x0004, 0x0001, 0x0002, 0x0008,
@@ -631,7 +631,7 @@ static void b43_phy_lcn_upload_static_tables(struct b43_wldev *dev)
 	lcntab_upload(dev, B43_LCNTAB32(0x18, 0), b43_lcntab_0x18);
 }
 
-void b43_phy_lcn_load_tx_gain_tab(struct b43_wldev *dev,
+static void b43_phy_lcn_load_tx_gain_tab(struct b43_wldev *dev,
 			const struct b43_lcntab_tx_gain_tbl_entry *gain_table)
 {
 	u32 i;
-- 
1.7.10.4


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

* [PATCH 2/2] b43: make struct b2056_inittabs_pts const
  2013-03-27 16:15 [PATCH 1/2] b43: mark some functions and structs static Hauke Mehrtens
@ 2013-03-27 16:15 ` Hauke Mehrtens
  2013-03-27 17:27 ` [PATCH 1/2] b43: mark some functions and structs static John W. Linville
  1 sibling, 0 replies; 6+ messages in thread
From: Hauke Mehrtens @ 2013-03-27 16:15 UTC (permalink / raw)
  To: linville; +Cc: zajec5, linux-wireless, b43-dev, Hauke Mehrtens

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
 drivers/net/wireless/b43/radio_2056.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/b43/radio_2056.c b/drivers/net/wireless/b43/radio_2056.c
index ab1f55f..b4fd934 100644
--- a/drivers/net/wireless/b43/radio_2056.c
+++ b/drivers/net/wireless/b43/radio_2056.c
@@ -2980,7 +2980,7 @@ static const struct b2056_inittab_entry b2056_inittab_rev8_rx[] = {
 	.rx		= prefix##_rx,			\
 	.rx_length	= ARRAY_SIZE(prefix##_rx)
 
-static struct b2056_inittabs_pts b2056_inittabs[] = {
+static const struct b2056_inittabs_pts b2056_inittabs[] = {
 	[3] = { INITTABSPTS(b2056_inittab_rev3) },
 	[4] = { INITTABSPTS(b2056_inittab_rev4) },
 	[5] = { INITTABSPTS(b2056_inittab_rev5) },
@@ -9035,7 +9035,7 @@ static void b2056_upload_inittab(struct b43_wldev *dev, bool ghz5,
 void b2056_upload_inittabs(struct b43_wldev *dev,
 			   bool ghz5, bool ignore_uploadflag)
 {
-	struct b2056_inittabs_pts *pts;
+	const struct b2056_inittabs_pts *pts;
 
 	if (dev->phy.rev >= ARRAY_SIZE(b2056_inittabs)) {
 		B43_WARN_ON(1);
@@ -9057,7 +9057,7 @@ void b2056_upload_inittabs(struct b43_wldev *dev,
 
 void b2056_upload_syn_pll_cp2(struct b43_wldev *dev, bool ghz5)
 {
-	struct b2056_inittabs_pts *pts;
+	const struct b2056_inittabs_pts *pts;
 	const struct b2056_inittab_entry *e;
 
 	if (dev->phy.rev >= ARRAY_SIZE(b2056_inittabs)) {
-- 
1.7.10.4


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

* Re: [PATCH 1/2] b43: mark some functions and structs static
  2013-03-27 16:15 [PATCH 1/2] b43: mark some functions and structs static Hauke Mehrtens
  2013-03-27 16:15 ` [PATCH 2/2] b43: make struct b2056_inittabs_pts const Hauke Mehrtens
@ 2013-03-27 17:27 ` John W. Linville
  2013-03-27 17:43   ` Rafał Miłecki
  1 sibling, 1 reply; 6+ messages in thread
From: John W. Linville @ 2013-03-27 17:27 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: zajec5, linux-wireless, b43-dev

On Wed, Mar 27, 2013 at 05:15:50PM +0100, Hauke Mehrtens wrote:
> This fixes some sparse warnings.
> 
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> ---
>  drivers/net/wireless/b43/phy_n.c          |    6 ++++--
>  drivers/net/wireless/b43/radio_2056.c     |    2 +-
>  drivers/net/wireless/b43/sdio.h           |    4 ++--
>  drivers/net/wireless/b43/tables_nphy.c    |    4 ++--
>  drivers/net/wireless/b43/tables_phy_lcn.c |    6 +++---
>  5 files changed, 12 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
> index 1ec0d69..8d15878 100644
> --- a/drivers/net/wireless/b43/phy_n.c
> +++ b/drivers/net/wireless/b43/phy_n.c
> @@ -2789,9 +2789,11 @@ static void b43_nphy_iq_cal_gain_params(struct b43_wldev *dev, u16 core,
>   * Tx and Rx
>   **************************************************/
>  
> -void b43_nphy_set_rxantenna(struct b43_wldev *dev, int antenna)
> +#if 0
> +static void b43_nphy_set_rxantenna(struct b43_wldev *dev, int antenna)
>  {//TODO
>  }
> +#endif
>  
>  static void b43_nphy_op_adjust_txpower(struct b43_wldev *dev)
>  {//TODO

If this isn't necessary, why not just remove it?

-- 
John W. Linville		Someday the world will need a hero, and you
linville@tuxdriver.com			might be all we have.  Be ready.

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

* Re: [PATCH 1/2] b43: mark some functions and structs static
  2013-03-27 17:27 ` [PATCH 1/2] b43: mark some functions and structs static John W. Linville
@ 2013-03-27 17:43   ` Rafał Miłecki
  2013-03-27 17:53     ` Hauke Mehrtens
  0 siblings, 1 reply; 6+ messages in thread
From: Rafał Miłecki @ 2013-03-27 17:43 UTC (permalink / raw)
  To: John W. Linville; +Cc: Hauke Mehrtens, linux-wireless, b43-dev

2013/3/27 John W. Linville <linville@tuxdriver.com>:
> On Wed, Mar 27, 2013 at 05:15:50PM +0100, Hauke Mehrtens wrote:
>> This fixes some sparse warnings.
>>
>> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
>> ---
>>  drivers/net/wireless/b43/phy_n.c          |    6 ++++--
>>  drivers/net/wireless/b43/radio_2056.c     |    2 +-
>>  drivers/net/wireless/b43/sdio.h           |    4 ++--
>>  drivers/net/wireless/b43/tables_nphy.c    |    4 ++--
>>  drivers/net/wireless/b43/tables_phy_lcn.c |    6 +++---
>>  5 files changed, 12 insertions(+), 10 deletions(-)
>>
>> diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
>> index 1ec0d69..8d15878 100644
>> --- a/drivers/net/wireless/b43/phy_n.c
>> +++ b/drivers/net/wireless/b43/phy_n.c
>> @@ -2789,9 +2789,11 @@ static void b43_nphy_iq_cal_gain_params(struct b43_wldev *dev, u16 core,
>>   * Tx and Rx
>>   **************************************************/
>>
>> -void b43_nphy_set_rxantenna(struct b43_wldev *dev, int antenna)
>> +#if 0
>> +static void b43_nphy_set_rxantenna(struct b43_wldev *dev, int antenna)
>>  {//TODO
>>  }
>> +#endif
>>
>>  static void b43_nphy_op_adjust_txpower(struct b43_wldev *dev)
>>  {//TODO
>
> If this isn't necessary, why not just remove it?

They are used for pointers that AFAIR can't be null.

-- 
Rafał

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

* Re: [PATCH 1/2] b43: mark some functions and structs static
  2013-03-27 17:43   ` Rafał Miłecki
@ 2013-03-27 17:53     ` Hauke Mehrtens
  2013-03-28 10:00       ` Rafał Miłecki
  0 siblings, 1 reply; 6+ messages in thread
From: Hauke Mehrtens @ 2013-03-27 17:53 UTC (permalink / raw)
  To: Rafał Miłecki; +Cc: John W. Linville, linux-wireless, b43-dev

On 03/27/2013 06:43 PM, Rafał Miłecki wrote:
> 2013/3/27 John W. Linville <linville@tuxdriver.com>:
>> On Wed, Mar 27, 2013 at 05:15:50PM +0100, Hauke Mehrtens wrote:
>>> This fixes some sparse warnings.
>>>
>>> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
>>> ---
>>>  drivers/net/wireless/b43/phy_n.c          |    6 ++++--
>>>  drivers/net/wireless/b43/radio_2056.c     |    2 +-
>>>  drivers/net/wireless/b43/sdio.h           |    4 ++--
>>>  drivers/net/wireless/b43/tables_nphy.c    |    4 ++--
>>>  drivers/net/wireless/b43/tables_phy_lcn.c |    6 +++---
>>>  5 files changed, 12 insertions(+), 10 deletions(-)
>>>
>>> diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
>>> index 1ec0d69..8d15878 100644
>>> --- a/drivers/net/wireless/b43/phy_n.c
>>> +++ b/drivers/net/wireless/b43/phy_n.c
>>> @@ -2789,9 +2789,11 @@ static void b43_nphy_iq_cal_gain_params(struct b43_wldev *dev, u16 core,
>>>   * Tx and Rx
>>>   **************************************************/
>>>
>>> -void b43_nphy_set_rxantenna(struct b43_wldev *dev, int antenna)
>>> +#if 0
>>> +static void b43_nphy_set_rxantenna(struct b43_wldev *dev, int antenna)
>>>  {//TODO
>>>  }
>>> +#endif
>>>
>>>  static void b43_nphy_op_adjust_txpower(struct b43_wldev *dev)
>>>  {//TODO
>>
>> If this isn't necessary, why not just remove it?
> 
> They are used for pointers that AFAIR can't be null.

The set_rx_antenna is not set for the n-phy and it is checked for null
before calling it and b43_nphy_set_rxantenna() is not referenced, so it
could be removed. The others are probably needed.

Hauke

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

* Re: [PATCH 1/2] b43: mark some functions and structs static
  2013-03-27 17:53     ` Hauke Mehrtens
@ 2013-03-28 10:00       ` Rafał Miłecki
  0 siblings, 0 replies; 6+ messages in thread
From: Rafał Miłecki @ 2013-03-28 10:00 UTC (permalink / raw)
  To: Hauke Mehrtens; +Cc: John W. Linville, linux-wireless, b43-dev

2013/3/27 Hauke Mehrtens <hauke@hauke-m.de>:
> On 03/27/2013 06:43 PM, Rafał Miłecki wrote:
>> 2013/3/27 John W. Linville <linville@tuxdriver.com>:
>>> On Wed, Mar 27, 2013 at 05:15:50PM +0100, Hauke Mehrtens wrote:
>>>> This fixes some sparse warnings.
>>>>
>>>> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
>>>> ---
>>>>  drivers/net/wireless/b43/phy_n.c          |    6 ++++--
>>>>  drivers/net/wireless/b43/radio_2056.c     |    2 +-
>>>>  drivers/net/wireless/b43/sdio.h           |    4 ++--
>>>>  drivers/net/wireless/b43/tables_nphy.c    |    4 ++--
>>>>  drivers/net/wireless/b43/tables_phy_lcn.c |    6 +++---
>>>>  5 files changed, 12 insertions(+), 10 deletions(-)
>>>>
>>>> diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
>>>> index 1ec0d69..8d15878 100644
>>>> --- a/drivers/net/wireless/b43/phy_n.c
>>>> +++ b/drivers/net/wireless/b43/phy_n.c
>>>> @@ -2789,9 +2789,11 @@ static void b43_nphy_iq_cal_gain_params(struct b43_wldev *dev, u16 core,
>>>>   * Tx and Rx
>>>>   **************************************************/
>>>>
>>>> -void b43_nphy_set_rxantenna(struct b43_wldev *dev, int antenna)
>>>> +#if 0
>>>> +static void b43_nphy_set_rxantenna(struct b43_wldev *dev, int antenna)
>>>>  {//TODO
>>>>  }
>>>> +#endif
>>>>
>>>>  static void b43_nphy_op_adjust_txpower(struct b43_wldev *dev)
>>>>  {//TODO
>>>
>>> If this isn't necessary, why not just remove it?
>>
>> They are used for pointers that AFAIR can't be null.
>
> The set_rx_antenna is not set for the n-phy and it is checked for null
> before calling it and b43_nphy_set_rxantenna() is not referenced, so it
> could be removed. The others are probably needed.

Whoops, I didn't know that fact about b43_nphy_set_rxantenna. Yeah, it
should be removed.

-- 
Rafał

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

end of thread, other threads:[~2013-03-28 10:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-27 16:15 [PATCH 1/2] b43: mark some functions and structs static Hauke Mehrtens
2013-03-27 16:15 ` [PATCH 2/2] b43: make struct b2056_inittabs_pts const Hauke Mehrtens
2013-03-27 17:27 ` [PATCH 1/2] b43: mark some functions and structs static John W. Linville
2013-03-27 17:43   ` Rafał Miłecki
2013-03-27 17:53     ` Hauke Mehrtens
2013-03-28 10:00       ` Rafał Miłecki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).