[linux-next,v2] iavf: Replace __FUNCTION__ with __func__

Message ID 20221018015204.371685-1-ye.xingchen@zte.com.cn
State New
Headers
Series [linux-next,v2] iavf: Replace __FUNCTION__ with __func__ |

Commit Message

ye xingchen Oct. 18, 2022, 1:52 a.m. UTC
  From: ye xingchen <ye.xingchen@zte.com.cn>

__FUNCTION__ exists only for backwards compatibility reasons with old
gcc versions. Replace it with __func__.

Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
---
v1 -> v2
Fix the message up to use ("message in %s\n", __func__)
 drivers/net/ethernet/intel/iavf/iavf_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Jacob Keller Oct. 18, 2022, 7:43 p.m. UTC | #1
> -----Original Message-----
> From: yexingchen116@gmail.com <yexingchen116@gmail.com>
> Sent: Monday, October 17, 2022 6:52 PM
> To: Brandeburg, Jesse <jesse.brandeburg@intel.com>
> Cc: Nguyen, Anthony L <anthony.l.nguyen@intel.com>; davem@davemloft.net;
> edumazet@google.com; kuba@kernel.org; pabeni@redhat.com; Keller, Jacob E
> <jacob.e.keller@intel.com>; joe@perches.com; intel-wired-lan@lists.osuosl.org;
> netdev@vger.kernel.org; linux-kernel@vger.kernel.org; ye xingchen
> <ye.xingchen@zte.com.cn>
> Subject: [PATCH linux-next v2] iavf: Replace __FUNCTION__ with __func__
> 
> From: ye xingchen <ye.xingchen@zte.com.cn>
> 
> __FUNCTION__ exists only for backwards compatibility reasons with old
> gcc versions. Replace it with __func__.
> 
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
> Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>

Thanks for cleaning this up!

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

> ---
> v1 -> v2
> Fix the message up to use ("message in %s\n", __func__)
>  drivers/net/ethernet/intel/iavf/iavf_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c
> b/drivers/net/ethernet/intel/iavf/iavf_main.c
> index 3fc572341781..efa2692af577 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_main.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
> @@ -4820,7 +4820,7 @@ static void iavf_shutdown(struct pci_dev *pdev)
>  		iavf_close(netdev);
> 
>  	if (iavf_lock_timeout(&adapter->crit_lock, 5000))
> -		dev_warn(&adapter->pdev->dev, "failed to acquire crit_lock in
> %s\n", __FUNCTION__);
> +		dev_warn(&adapter->pdev->dev, "%s: failed to acquire
> crit_lock\n", __func__);
>  	/* Prevent the watchdog from running. */
>  	iavf_change_state(adapter, __IAVF_REMOVE);
>  	adapter->aq_required = 0;
> --
> 2.25.1
  
Jankowski, Konrad0 Oct. 27, 2022, 6:17 a.m. UTC | #2
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@osuosl.org> On Behalf Of
> yexingchen116@gmail.com
> Sent: Tuesday, October 18, 2022 3:52 AM
> To: Brandeburg, Jesse <jesse.brandeburg@intel.com>
> Cc: intel-wired-lan@lists.osuosl.org; linux-kernel@vger.kernel.org;
> joe@perches.com; edumazet@google.com; ye xingchen
> <ye.xingchen@zte.com.cn>; netdev@vger.kernel.org; kuba@kernel.org;
> pabeni@redhat.com; davem@davemloft.net
> Subject: [Intel-wired-lan] [PATCH linux-next v2] iavf: Replace __FUNCTION__ with
> __func__
> 
> From: ye xingchen <ye.xingchen@zte.com.cn>
> 
> __FUNCTION__ exists only for backwards compatibility reasons with old gcc
> versions. Replace it with __func__.
> 
> Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
> Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
> ---
> v1 -> v2
> Fix the message up to use ("message in %s\n", __func__)
> drivers/net/ethernet/intel/iavf/iavf_main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c
> b/drivers/net/ethernet/intel/iavf/iavf_main.c
> index 3fc572341781..efa2692af577 100644
> --- a/drivers/net/ethernet/intel/iavf/iavf_main.c
> +++ b/drivers/net/ethernet/intel/iavf/iavf_main.c

Tested-by: Konrad Jankowski <konrad0.jankowski@intel.com>
  

Patch

diff --git a/drivers/net/ethernet/intel/iavf/iavf_main.c
b/drivers/net/ethernet/intel/iavf/iavf_main.c
index 3fc572341781..efa2692af577 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_main.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_main.c
@@ -4820,7 +4820,7 @@  static void iavf_shutdown(struct pci_dev *pdev)
 		iavf_close(netdev);
 
 	if (iavf_lock_timeout(&adapter->crit_lock, 5000))
-		dev_warn(&adapter->pdev->dev, "failed to acquire crit_lock in %s\n", __FUNCTION__);
+		dev_warn(&adapter->pdev->dev, "%s: failed to acquire crit_lock\n", __func__);
 	/* Prevent the watchdog from running. */
 	iavf_change_state(adapter, __IAVF_REMOVE);
 	adapter->aq_required = 0;