All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sfc/ethtool_common: Make some function to static
@ 2020-01-13 11:24 Zhang Xiaoxu
  2020-01-13 12:58 ` Jakub Kicinski
  2020-01-13 13:29 ` Martin Habets
  0 siblings, 2 replies; 5+ messages in thread
From: Zhang Xiaoxu @ 2020-01-13 11:24 UTC (permalink / raw)
  To: linux-net-drivers, ecree, amaftei, davem, mhabets, zhangxiaoxu5; +Cc: netdev

Fix sparse warning:

drivers/net/ethernet/sfc/ethtool_common.c
  warning: symbol 'efx_fill_test' was not declared. Should it be static?
  warning: symbol 'efx_fill_loopback_test' was not declared.
           Should it be static?
  warning: symbol 'efx_describe_per_queue_stats' was not declared.
           Should it be static?

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
---
 drivers/net/ethernet/sfc/ethtool_common.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/drivers/net/ethernet/sfc/ethtool_common.c b/drivers/net/ethernet/sfc/ethtool_common.c
index 3d7f75cc5cf0..b8d281ab6c7a 100644
--- a/drivers/net/ethernet/sfc/ethtool_common.c
+++ b/drivers/net/ethernet/sfc/ethtool_common.c
@@ -147,9 +147,9 @@ void efx_ethtool_get_pauseparam(struct net_device *net_dev,
  *
  * Fill in an individual self-test entry.
  */
-void efx_fill_test(unsigned int test_index, u8 *strings, u64 *data,
-		   int *test, const char *unit_format, int unit_id,
-		   const char *test_format, const char *test_id)
+static void efx_fill_test(unsigned int test_index, u8 *strings, u64 *data,
+			  int *test, const char *unit_format, int unit_id,
+			  const char *test_format, const char *test_id)
 {
 	char unit_str[ETH_GSTRING_LEN], test_str[ETH_GSTRING_LEN];
 
@@ -189,10 +189,11 @@ void efx_fill_test(unsigned int test_index, u8 *strings, u64 *data,
  * Fill in a block of loopback self-test entries.  Return new test
  * index.
  */
-int efx_fill_loopback_test(struct efx_nic *efx,
-			   struct efx_loopback_self_tests *lb_tests,
-			   enum efx_loopback_mode mode,
-			   unsigned int test_index, u8 *strings, u64 *data)
+static int efx_fill_loopback_test(struct efx_nic *efx,
+				  struct efx_loopback_self_tests *lb_tests,
+				  enum efx_loopback_mode mode,
+				  unsigned int test_index,
+				  u8 *strings, u64 *data)
 {
 	struct efx_channel *channel =
 		efx_get_channel(efx, efx->tx_channel_offset);
@@ -293,7 +294,7 @@ int efx_ethtool_fill_self_tests(struct efx_nic *efx,
 	return n;
 }
 
-size_t efx_describe_per_queue_stats(struct efx_nic *efx, u8 *strings)
+static size_t efx_describe_per_queue_stats(struct efx_nic *efx, u8 *strings)
 {
 	size_t n_stats = 0;
 	struct efx_channel *channel;
-- 
2.17.2


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

* Re: [PATCH] sfc/ethtool_common: Make some function to static
  2020-01-13 11:24 [PATCH] sfc/ethtool_common: Make some function to static Zhang Xiaoxu
@ 2020-01-13 12:58 ` Jakub Kicinski
  2020-01-13 13:29   ` Martin Habets
  2020-01-13 13:29 ` Martin Habets
  1 sibling, 1 reply; 5+ messages in thread
From: Jakub Kicinski @ 2020-01-13 12:58 UTC (permalink / raw)
  To: ecree, amaftei; +Cc: Zhang Xiaoxu, linux-net-drivers, davem, mhabets, netdev

On Mon, 13 Jan 2020 19:24:11 +0800, Zhang Xiaoxu wrote:
> Fix sparse warning:
> 
> drivers/net/ethernet/sfc/ethtool_common.c
>   warning: symbol 'efx_fill_test' was not declared. Should it be static?
>   warning: symbol 'efx_fill_loopback_test' was not declared.
>            Should it be static?
>   warning: symbol 'efx_describe_per_queue_stats' was not declared.
>            Should it be static?
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>

Ed, Alex, since you were talking about reusing this code would you
rather add a declaration for these function to a header? Or should 
I apply the current fix?

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

* Re: [PATCH] sfc/ethtool_common: Make some function to static
  2020-01-13 11:24 [PATCH] sfc/ethtool_common: Make some function to static Zhang Xiaoxu
  2020-01-13 12:58 ` Jakub Kicinski
@ 2020-01-13 13:29 ` Martin Habets
  1 sibling, 0 replies; 5+ messages in thread
From: Martin Habets @ 2020-01-13 13:29 UTC (permalink / raw)
  To: Zhang Xiaoxu, linux-net-drivers, ecree, amaftei, davem; +Cc: netdev

On 13/01/2020 11:24, Zhang Xiaoxu wrote:
> Fix sparse warning:
> 
> drivers/net/ethernet/sfc/ethtool_common.c
>   warning: symbol 'efx_fill_test' was not declared. Should it be static?
>   warning: symbol 'efx_fill_loopback_test' was not declared.
>            Should it be static?
>   warning: symbol 'efx_describe_per_queue_stats' was not declared.
>            Should it be static?
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>

Good catch. Thanks!

Reviewed-by: Martin Habets <mhabets@solarflare.com>

> ---
>  drivers/net/ethernet/sfc/ethtool_common.c | 17 +++++++++--------
>  1 file changed, 9 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/net/ethernet/sfc/ethtool_common.c b/drivers/net/ethernet/sfc/ethtool_common.c
> index 3d7f75cc5cf0..b8d281ab6c7a 100644
> --- a/drivers/net/ethernet/sfc/ethtool_common.c
> +++ b/drivers/net/ethernet/sfc/ethtool_common.c
> @@ -147,9 +147,9 @@ void efx_ethtool_get_pauseparam(struct net_device *net_dev,
>   *
>   * Fill in an individual self-test entry.
>   */
> -void efx_fill_test(unsigned int test_index, u8 *strings, u64 *data,
> -		   int *test, const char *unit_format, int unit_id,
> -		   const char *test_format, const char *test_id)
> +static void efx_fill_test(unsigned int test_index, u8 *strings, u64 *data,
> +			  int *test, const char *unit_format, int unit_id,
> +			  const char *test_format, const char *test_id)
>  {
>  	char unit_str[ETH_GSTRING_LEN], test_str[ETH_GSTRING_LEN];
>  
> @@ -189,10 +189,11 @@ void efx_fill_test(unsigned int test_index, u8 *strings, u64 *data,
>   * Fill in a block of loopback self-test entries.  Return new test
>   * index.
>   */
> -int efx_fill_loopback_test(struct efx_nic *efx,
> -			   struct efx_loopback_self_tests *lb_tests,
> -			   enum efx_loopback_mode mode,
> -			   unsigned int test_index, u8 *strings, u64 *data)
> +static int efx_fill_loopback_test(struct efx_nic *efx,
> +				  struct efx_loopback_self_tests *lb_tests,
> +				  enum efx_loopback_mode mode,
> +				  unsigned int test_index,
> +				  u8 *strings, u64 *data)
>  {
>  	struct efx_channel *channel =
>  		efx_get_channel(efx, efx->tx_channel_offset);
> @@ -293,7 +294,7 @@ int efx_ethtool_fill_self_tests(struct efx_nic *efx,
>  	return n;
>  }
>  
> -size_t efx_describe_per_queue_stats(struct efx_nic *efx, u8 *strings)
> +static size_t efx_describe_per_queue_stats(struct efx_nic *efx, u8 *strings)
>  {
>  	size_t n_stats = 0;
>  	struct efx_channel *channel;
> 

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

* Re: [PATCH] sfc/ethtool_common: Make some function to static
  2020-01-13 12:58 ` Jakub Kicinski
@ 2020-01-13 13:29   ` Martin Habets
  2020-01-13 14:03     ` Jakub Kicinski
  0 siblings, 1 reply; 5+ messages in thread
From: Martin Habets @ 2020-01-13 13:29 UTC (permalink / raw)
  To: Jakub Kicinski, ecree, amaftei
  Cc: Zhang Xiaoxu, linux-net-drivers, davem, netdev

Hi Jakub,

The fix is good. Even when we reuse this code these functions can remain static.

Martin

On 13/01/2020 12:58, Jakub Kicinski wrote:
> On Mon, 13 Jan 2020 19:24:11 +0800, Zhang Xiaoxu wrote:
>> Fix sparse warning:
>>
>> drivers/net/ethernet/sfc/ethtool_common.c
>>   warning: symbol 'efx_fill_test' was not declared. Should it be static?
>>   warning: symbol 'efx_fill_loopback_test' was not declared.
>>            Should it be static?
>>   warning: symbol 'efx_describe_per_queue_stats' was not declared.
>>            Should it be static?
>>
>> Reported-by: Hulk Robot <hulkci@huawei.com>
>> Signed-off-by: Zhang Xiaoxu <zhangxiaoxu5@huawei.com>
> 
> Ed, Alex, since you were talking about reusing this code would you
> rather add a declaration for these function to a header? Or should 
> I apply the current fix?
> 

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

* Re: [PATCH] sfc/ethtool_common: Make some function to static
  2020-01-13 13:29   ` Martin Habets
@ 2020-01-13 14:03     ` Jakub Kicinski
  0 siblings, 0 replies; 5+ messages in thread
From: Jakub Kicinski @ 2020-01-13 14:03 UTC (permalink / raw)
  To: Martin Habets
  Cc: ecree, amaftei, Zhang Xiaoxu, linux-net-drivers, davem, netdev

On Mon, 13 Jan 2020 13:29:42 +0000, Martin Habets wrote:
> Hi Jakub,
> 
> The fix is good. Even when we reuse this code these functions can remain static.

Okay then, applied to net-next, thank you!


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

end of thread, other threads:[~2020-01-13 14:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-13 11:24 [PATCH] sfc/ethtool_common: Make some function to static Zhang Xiaoxu
2020-01-13 12:58 ` Jakub Kicinski
2020-01-13 13:29   ` Martin Habets
2020-01-13 14:03     ` Jakub Kicinski
2020-01-13 13:29 ` Martin Habets

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.