lkml.org 
[lkml]   [2022]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH linux-next] iavf: Replace __FUNCTION__ with __func__
From
Date
On Tue, 2022-10-11 at 14:46 -0700, Jesse Brandeburg wrote:
> On 10/11/2022 4:16 AM, yexingchen116@gmail.com wrote:
> > __FUNCTION__ exists only for backwards compatibility reasons with old
> > gcc versions. Replace it with __func__.
[]
> > diff --git 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, "failed to acquire crit_lock in %s\n", __func__);

Trivia: I suggest

dev_warn(&adapter->pdev->dev, "%s: failed to acquire crit_lock\n", __func__);

As almost all printed uses of __func__ use a form like

<printk_variant>("%s: message\n", __func__);

not

<printk_variant>("message in %s\n", __func__);

\
 
 \ /
  Last update: 2022-10-14 17:11    [W:0.063 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site