[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220425105607.3515999-1-chi.minghao@zte.com.cn>
Date: Mon, 25 Apr 2022 10:56:07 +0000
From: cgel.zte@...il.com
To: dan.j.williams@...el.com
Cc: vishal.l.verma@...el.com, dave.jiang@...el.com,
ira.weiny@...el.com, nvdimm@...ts.linux.dev,
linux-kernel@...r.kernel.org, Minghao Chi <chi.minghao@....com.cn>,
Zeal Robot <zealci@....com.cn>
Subject: [PATCH] ndtest: use kobj_to_dev()
From: Minghao Chi <chi.minghao@....com.cn>
Use kobj_to_dev() instead of open-coding it.
Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Minghao Chi <chi.minghao@....com.cn>
---
tools/testing/nvdimm/test/ndtest.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/nvdimm/test/ndtest.c b/tools/testing/nvdimm/test/ndtest.c
index 4d1a947367f9..b32ee76e0c17 100644
--- a/tools/testing/nvdimm/test/ndtest.c
+++ b/tools/testing/nvdimm/test/ndtest.c
@@ -725,7 +725,7 @@ static DEVICE_ATTR_RO(format1);
static umode_t ndtest_nvdimm_attr_visible(struct kobject *kobj,
struct attribute *a, int n)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct nvdimm *nvdimm = to_nvdimm(dev);
struct ndtest_dimm *dimm = nvdimm_provider_data(nvdimm);
--
2.25.1
Powered by blists - more mailing lists