From: Lijun Pan <ljp@linux.vnet.ibm.com>
To: YueHaibing <yuehaibing@huawei.com>
Cc: Cristobal Forno <cforno12@linux.ibm.com>,
dwilder@us.ibm.com, linux-kernel@vger.kernel.org,
paulus@samba.org, netdev@vger.kernel.org,
Jakub Kicinski <kuba@kernel.org>,
linuxppc-dev@lists.ozlabs.org, David Miller <davem@davemloft.net>
Subject: Re: [PATCH net-next] ibmveth: fix kobj_to_dev.cocci warnings
Date: Wed, 19 May 2021 00:20:22 -0500 [thread overview]
Message-ID: <276F94E7-2DFB-47EF-91F7-6CDA69A4009F@linux.vnet.ibm.com> (raw)
In-Reply-To: <20210519022849.12752-1-yuehaibing@huawei.com>
> 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
>
next prev parent reply other threads:[~2021-05-19 5:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-19 2:28 [PATCH net-next] ibmveth: fix kobj_to_dev.cocci warnings YueHaibing
2021-05-19 5:20 ` Lijun Pan [this message]
2021-05-19 19:10 ` patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=276F94E7-2DFB-47EF-91F7-6CDA69A4009F@linux.vnet.ibm.com \
--to=ljp@linux.vnet.ibm.com \
--cc=cforno12@linux.ibm.com \
--cc=davem@davemloft.net \
--cc=dwilder@us.ibm.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=netdev@vger.kernel.org \
--cc=paulus@samba.org \
--cc=yuehaibing@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).