* [PATCH] ibmveth: Switch to using the new API kobj_to_dev()
@ 2021-02-22 8:02 Yang Li
2021-02-23 23:46 ` Jakub Kicinski
0 siblings, 1 reply; 2+ messages in thread
From: Yang Li @ 2021-02-22 8:02 UTC (permalink / raw)
To: mpe
Cc: benh, paulus, cforno12, davem, kuba, linuxppc-dev, netdev,
linux-kernel, Yang Li
fixed the following coccicheck:
./drivers/net/ethernet/ibm/ibmveth.c:1805:51-52: WARNING opportunity for
kobj_to_dev()
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.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 c3ec9ce..6e9572c 100644
--- a/drivers/net/ethernet/ibm/ibmveth.c
+++ b/drivers/net/ethernet/ibm/ibmveth.c
@@ -1801,8 +1801,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;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ibmveth: Switch to using the new API kobj_to_dev()
2021-02-22 8:02 [PATCH] ibmveth: Switch to using the new API kobj_to_dev() Yang Li
@ 2021-02-23 23:46 ` Jakub Kicinski
0 siblings, 0 replies; 2+ messages in thread
From: Jakub Kicinski @ 2021-02-23 23:46 UTC (permalink / raw)
To: Yang Li
Cc: mpe, benh, paulus, cforno12, davem, linuxppc-dev, netdev, linux-kernel
On Mon, 22 Feb 2021 16:02:21 +0800 Yang Li wrote:
> fixed the following coccicheck:
> ./drivers/net/ethernet/ibm/ibmveth.c:1805:51-52: WARNING opportunity for
> kobj_to_dev()
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
# Form letter - net-next is closed
We have already sent the networking pull request for 5.12 and therefore
net-next is closed for new drivers, features, code refactoring and
optimizations. We are currently accepting bug fixes only.
Please repost when net-next reopens after 5.12-rc1 is cut.
Look out for the announcement on the mailing list or check:
http://vger.kernel.org/~davem/net-next.html
RFC patches sent for review only are obviously welcome at any time.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-02-24 1:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-22 8:02 [PATCH] ibmveth: Switch to using the new API kobj_to_dev() Yang Li
2021-02-23 23:46 ` Jakub Kicinski
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).