All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] ibmveth: fix kobj_to_dev.cocci warnings
@ 2021-05-19  2:28 ` YueHaibing
  0 siblings, 0 replies; 6+ messages in thread
From: YueHaibing @ 2021-05-19  2:28 UTC (permalink / raw)
  To: benh, paulus, cforno12, davem, kuba, dwilder
  Cc: linuxppc-dev, netdev, linux-kernel, YueHaibing

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] 6+ messages in thread

* [PATCH net-next] ibmveth: fix kobj_to_dev.cocci warnings
@ 2021-05-19  2:28 ` YueHaibing
  0 siblings, 0 replies; 6+ 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] 6+ messages in thread

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



> 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] 6+ messages in thread

* Re: [PATCH net-next] ibmveth: fix kobj_to_dev.cocci warnings
@ 2021-05-19  5:20   ` Lijun Pan
  0 siblings, 0 replies; 6+ 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] 6+ messages in thread

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

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] 6+ messages in thread

* Re: [PATCH net-next] ibmveth: fix kobj_to_dev.cocci warnings
@ 2021-05-19 19:10   ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 6+ 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] 6+ messages in thread

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

Thread overview: 6+ 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  2:28 ` YueHaibing
2021-05-19  5:20 ` Lijun Pan
2021-05-19  5:20   ` Lijun Pan
2021-05-19 19:10 ` patchwork-bot+netdevbpf
2021-05-19 19:10   ` patchwork-bot+netdevbpf

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.