Message ID | 1613974222-45256-1-git-send-email-yang.lee@linux.alibaba.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | ndtest: Switch to using the new API kobj_to_dev() | expand |
diff --git a/tools/testing/nvdimm/test/ndtest.c b/tools/testing/nvdimm/test/ndtest.c index 6862915..004a36f 100644 --- a/tools/testing/nvdimm/test/ndtest.c +++ b/tools/testing/nvdimm/test/ndtest.c @@ -782,7 +782,7 @@ static ssize_t format1_show(struct device *dev, struct device_attribute *attr, 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);
fixed the following coccicheck: ./tools/testing/nvdimm/test/ndtest.c:785:60-61: WARNING opportunity for kobj_to_dev() Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> --- tools/testing/nvdimm/test/ndtest.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)