linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] ibmveth: fix kobj_to_dev.cocci warnings
@ 2021-05-19  2:28 YueHaibing
  2021-05-19  5:20 ` Lijun Pan
  2021-05-19 19:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: YueHaibing @ 2021-05-19  2:28 UTC (permalink / raw)
  To: benh, paulus, cforno12, davem, kuba, dwilder
  Cc: netdev, YueHaibing, linuxppc-dev, linux-kernel

Use kobj_to_dev() instead of container_of()

Generated by: scripts/coccinelle/api/kobj_to_dev.cocci

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/net/ethernet/ibm/ibmveth.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
index 7fea9ae60f13..bc67a7ee872b 100644
--- a/drivers/net/ethernet/ibm/ibmveth.c
+++ b/drivers/net/ethernet/ibm/ibmveth.c
@@ -1799,8 +1799,7 @@ static ssize_t veth_pool_store(struct kobject *kobj, struct attribute *attr,
 	struct ibmveth_buff_pool *pool = container_of(kobj,
 						      struct ibmveth_buff_pool,
 						      kobj);
-	struct net_device *netdev = dev_get_drvdata(
-	    container_of(kobj->parent, struct device, kobj));
+	struct net_device *netdev = dev_get_drvdata(kobj_to_dev(kobj->parent));
 	struct ibmveth_adapter *adapter = netdev_priv(netdev);
 	long value = simple_strtol(buf, NULL, 10);
 	long rc;
-- 
2.17.1


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

* Re: [PATCH net-next] ibmveth: fix kobj_to_dev.cocci warnings
  2021-05-19  2:28 [PATCH net-next] ibmveth: fix kobj_to_dev.cocci warnings YueHaibing
@ 2021-05-19  5:20 ` Lijun Pan
  2021-05-19 19:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Lijun Pan @ 2021-05-19  5:20 UTC (permalink / raw)
  To: YueHaibing
  Cc: Cristobal Forno, dwilder, linux-kernel, paulus, netdev,
	Jakub Kicinski, linuxppc-dev, David Miller



> On May 18, 2021, at 9:28 PM, YueHaibing <yuehaibing@huawei.com> wrote:
> 
> Use kobj_to_dev() instead of container_of()
> 
> Generated by: scripts/coccinelle/api/kobj_to_dev.cocci
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---

Acked-by: Lijun Pan <lijunp213@gmail.com>


> drivers/net/ethernet/ibm/ibmveth.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
> index 7fea9ae60f13..bc67a7ee872b 100644
> --- a/drivers/net/ethernet/ibm/ibmveth.c
> +++ b/drivers/net/ethernet/ibm/ibmveth.c
> @@ -1799,8 +1799,7 @@ static ssize_t veth_pool_store(struct kobject *kobj, struct attribute *attr,
> 	struct ibmveth_buff_pool *pool = container_of(kobj,
> 						      struct ibmveth_buff_pool,
> 						      kobj);
> -	struct net_device *netdev = dev_get_drvdata(
> -	    container_of(kobj->parent, struct device, kobj));
> +	struct net_device *netdev = dev_get_drvdata(kobj_to_dev(kobj->parent));
> 	struct ibmveth_adapter *adapter = netdev_priv(netdev);
> 	long value = simple_strtol(buf, NULL, 10);
> 	long rc;
> -- 
> 2.17.1
> 


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

* Re: [PATCH net-next] ibmveth: fix kobj_to_dev.cocci warnings
  2021-05-19  2:28 [PATCH net-next] ibmveth: fix kobj_to_dev.cocci warnings YueHaibing
  2021-05-19  5:20 ` Lijun Pan
@ 2021-05-19 19:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-05-19 19:10 UTC (permalink / raw)
  To: YueHaibing
  Cc: cforno12, dwilder, linux-kernel, paulus, netdev, kuba,
	linuxppc-dev, davem

Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Wed, 19 May 2021 10:28:49 +0800 you wrote:
> Use kobj_to_dev() instead of container_of()
> 
> Generated by: scripts/coccinelle/api/kobj_to_dev.cocci
> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/net/ethernet/ibm/ibmveth.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Here is the summary with links:
  - [net-next] ibmveth: fix kobj_to_dev.cocci warnings
    https://git.kernel.org/netdev/net-next/c/1756055de284

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2021-05-19 19:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-19  2:28 [PATCH net-next] ibmveth: fix kobj_to_dev.cocci warnings YueHaibing
2021-05-19  5:20 ` Lijun Pan
2021-05-19 19:10 ` patchwork-bot+netdevbpf

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