linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtl8xxxu: mark symbol static where possible
@ 2016-10-26  9:32 Baoyou Xie
  2016-10-26 12:37 ` Jakub Sitnicki
  0 siblings, 1 reply; 3+ messages in thread
From: Baoyou Xie @ 2016-10-26  9:32 UTC (permalink / raw)
  To: andrew, vivien.didelot, f.fainelli
  Cc: netdev, linux-kernel, arnd, baoyou.xie, xie.baoyou, han.fei,
	tang.qiang007

We get 1 warning when building kernel with W=1:
drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c:1557:6: warning: no previous prototype for 'rtl8192eu_power_off' [-Wmissing-prototypes]

In fact, this function is only used in the file in which it is
declared and don't need a declaration, but can be made static.
So this patch marks this function with 'static'.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
---
 drivers/net/dsa/mv88e6xxx/chip.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
index 883fd98..4d975f0 100644
--- a/drivers/net/dsa/mv88e6xxx/chip.c
+++ b/drivers/net/dsa/mv88e6xxx/chip.c
@@ -2701,7 +2701,7 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
 	return mv88e6xxx_port_write(chip, port, PORT_DEFAULT_VLAN, 0x0000);
 }
 
-int mv88e6xxx_g1_set_switch_mac(struct mv88e6xxx_chip *chip, u8 *addr)
+static int mv88e6xxx_g1_set_switch_mac(struct mv88e6xxx_chip *chip, u8 *addr)
 {
 	int err;
 
-- 
2.7.4

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

* Re: [PATCH] rtl8xxxu: mark symbol static where possible
  2016-10-26  9:32 [PATCH] rtl8xxxu: mark symbol static where possible Baoyou Xie
@ 2016-10-26 12:37 ` Jakub Sitnicki
  2016-10-26 15:56   ` David Miller
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Sitnicki @ 2016-10-26 12:37 UTC (permalink / raw)
  To: Baoyou Xie
  Cc: andrew, vivien.didelot, f.fainelli, netdev, linux-kernel, arnd,
	xie.baoyou, han.fei, tang.qiang007

On Wed, Oct 26, 2016 at 09:32 AM GMT, Baoyou Xie wrote:
> We get 1 warning when building kernel with W=1:
> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c:1557:6: warning: no previous prototype for 'rtl8192eu_power_off' [-Wmissing-prototypes]
>
> In fact, this function is only used in the file in which it is
> declared and don't need a declaration, but can be made static.
> So this patch marks this function with 'static'.
>
> Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
> ---
>  drivers/net/dsa/mv88e6xxx/chip.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
> index 883fd98..4d975f0 100644
> --- a/drivers/net/dsa/mv88e6xxx/chip.c
> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
> @@ -2701,7 +2701,7 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
>  	return mv88e6xxx_port_write(chip, port, PORT_DEFAULT_VLAN, 0x0000);
>  }
>  
> -int mv88e6xxx_g1_set_switch_mac(struct mv88e6xxx_chip *chip, u8 *addr)
> +static int mv88e6xxx_g1_set_switch_mac(struct mv88e6xxx_chip *chip, u8 *addr)
>  {
>  	int err;

Probably a mix-up - your patch doesn't match the description.

Thanks,
Jakub

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

* Re: [PATCH] rtl8xxxu: mark symbol static where possible
  2016-10-26 12:37 ` Jakub Sitnicki
@ 2016-10-26 15:56   ` David Miller
  0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2016-10-26 15:56 UTC (permalink / raw)
  To: jkbs
  Cc: baoyou.xie, andrew, vivien.didelot, f.fainelli, netdev,
	linux-kernel, arnd, xie.baoyou, han.fei, tang.qiang007

From: Jakub Sitnicki <jkbs@redhat.com>
Date: Wed, 26 Oct 2016 14:37:15 +0200

> On Wed, Oct 26, 2016 at 09:32 AM GMT, Baoyou Xie wrote:
>> We get 1 warning when building kernel with W=1:
>> drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c:1557:6: warning: no previous prototype for 'rtl8192eu_power_off' [-Wmissing-prototypes]
>>
>> In fact, this function is only used in the file in which it is
>> declared and don't need a declaration, but can be made static.
>> So this patch marks this function with 'static'.
>>
>> Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
>> ---
>>  drivers/net/dsa/mv88e6xxx/chip.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
>> index 883fd98..4d975f0 100644
>> --- a/drivers/net/dsa/mv88e6xxx/chip.c
>> +++ b/drivers/net/dsa/mv88e6xxx/chip.c
>> @@ -2701,7 +2701,7 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
>>  	return mv88e6xxx_port_write(chip, port, PORT_DEFAULT_VLAN, 0x0000);
>>  }
>>  
>> -int mv88e6xxx_g1_set_switch_mac(struct mv88e6xxx_chip *chip, u8 *addr)
>> +static int mv88e6xxx_g1_set_switch_mac(struct mv88e6xxx_chip *chip, u8 *addr)
>>  {
>>  	int err;
> 
> Probably a mix-up - your patch doesn't match the description.

Agreed, please fix your subject line and commit message.

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

end of thread, other threads:[~2016-10-26 15:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-26  9:32 [PATCH] rtl8xxxu: mark symbol static where possible Baoyou Xie
2016-10-26 12:37 ` Jakub Sitnicki
2016-10-26 15:56   ` David Miller

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).