* [Intel-wired-lan] [PATCH linux-next] iavf: Replace __FUNCTION__ with __func__
@ 2022-10-11 11:16 yexingchen116
2022-10-11 21:46 ` Jesse Brandeburg
0 siblings, 1 reply; 4+ messages in thread
From: yexingchen116 @ 2022-10-11 11:16 UTC (permalink / raw)
To: anthony.l.nguyen
Cc: netdev, linux-kernel, edumazet, intel-wired-lan, ye xingchen,
kuba, pabeni, davem
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>
---
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..98ab11972f5c 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, "failed to acquire crit_lock in %s\n", __func__);
/* Prevent the watchdog from running. */
iavf_change_state(adapter, __IAVF_REMOVE);
adapter->aq_required = 0;
--
2.25.1
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Intel-wired-lan] [PATCH linux-next] iavf: Replace __FUNCTION__ with __func__
2022-10-11 11:16 [Intel-wired-lan] [PATCH linux-next] iavf: Replace __FUNCTION__ with __func__ yexingchen116
@ 2022-10-11 21:46 ` Jesse Brandeburg
2022-10-14 15:10 ` Joe Perches
0 siblings, 1 reply; 4+ messages in thread
From: Jesse Brandeburg @ 2022-10-11 21:46 UTC (permalink / raw)
To: yexingchen116, anthony.l.nguyen
Cc: netdev, linux-kernel, edumazet, intel-wired-lan, ye xingchen,
kuba, pabeni, davem
On 10/11/2022 4:16 AM, yexingchen116@gmail.com wrote:
> 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>
> ---
> 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..98ab11972f5c 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, "failed to acquire crit_lock in %s\n", __func__);
> /* Prevent the watchdog from running. */
> iavf_change_state(adapter, __IAVF_REMOVE);
> adapter->aq_required = 0;
yeah, how'd that sneak in there? Thanks!
Reviewed-by: Jesse Brandeburg <jesse.brandeburg@intel.com>
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Intel-wired-lan] [PATCH linux-next] iavf: Replace __FUNCTION__ with __func__
2022-10-11 21:46 ` Jesse Brandeburg
@ 2022-10-14 15:10 ` Joe Perches
2022-10-17 22:58 ` Jacob Keller
0 siblings, 1 reply; 4+ messages in thread
From: Joe Perches @ 2022-10-14 15:10 UTC (permalink / raw)
To: Jesse Brandeburg, yexingchen116, anthony.l.nguyen
Cc: netdev, linux-kernel, edumazet, intel-wired-lan, ye xingchen,
kuba, pabeni, davem
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__);
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Intel-wired-lan] [PATCH linux-next] iavf: Replace __FUNCTION__ with __func__
2022-10-14 15:10 ` Joe Perches
@ 2022-10-17 22:58 ` Jacob Keller
0 siblings, 0 replies; 4+ messages in thread
From: Jacob Keller @ 2022-10-17 22:58 UTC (permalink / raw)
To: Joe Perches, Jesse Brandeburg, yexingchen116, anthony.l.nguyen
Cc: netdev, linux-kernel, edumazet, intel-wired-lan, ye xingchen,
kuba, pabeni, davem
On 10/14/2022 8:10 AM, Joe Perches wrote:
> 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__);
>
I agree with Joe. Please fix this message up to use "%s: ...", __func__.
While at it, you might mention this fixes commit 226d528512cf ("iavf:
fix locking of critical sections") which introduced the use of __FUNCTION__.
Thanks,
Jake
_______________________________________________
Intel-wired-lan mailing list
Intel-wired-lan@osuosl.org
https://lists.osuosl.org/mailman/listinfo/intel-wired-lan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-10-17 22:58 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-11 11:16 [Intel-wired-lan] [PATCH linux-next] iavf: Replace __FUNCTION__ with __func__ yexingchen116
2022-10-11 21:46 ` Jesse Brandeburg
2022-10-14 15:10 ` Joe Perches
2022-10-17 22:58 ` Jacob Keller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox