From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============7438463032451849901==" MIME-Version: 1.0 From: kernel test robot Subject: [PATCH] cxl/acpi: fix kobj_to_dev.cocci warnings Date: Sat, 08 May 2021 13:45:03 +0800 Message-ID: <20210508054503.GA85847@ded366bab7bf> In-Reply-To: <202105081211.Ds8JuHNU-lkp@intel.com> List-Id: To: kbuild@lists.01.org --===============7438463032451849901== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable CC: kbuild-all(a)lists.01.org In-Reply-To: <162042790793.1202325.13507889482183963289.stgit@dwillia2-de= sk3.amr.corp.intel.com> References: <162042790793.1202325.13507889482183963289.stgit@dwillia2-des= k3.amr.corp.intel.com> TO: Dan Williams TO: linux-cxl(a)vger.kernel.org CC: linux-pci(a)vger.kernel.org CC: linux-kernel(a)vger.kernel.org CC: linux-acpi(a)vger.kernel.org From: kernel test robot drivers/cxl/core.c:88:60-61: WARNING opportunity for kobj_to_dev() Use kobj_to_dev() instead of container_of() Generated by: scripts/coccinelle/api/kobj_to_dev.cocci CC: Dan Williams Reported-by: kernel test robot Signed-off-by: kernel test robot --- url: https://github.com/0day-ci/linux/commits/Dan-Williams/CXL-Port-Enum= eration-and-Plans-for-v5-14/20210508-065317 base: a38fd8748464831584a19438cbb3082b5a2dab15 :::::: branch date: 6 hours ago :::::: commit date: 6 hours ago Please take the patch only if it's a positive warning. Thanks! core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/cxl/core.c +++ b/drivers/cxl/core.c @@ -85,7 +85,7 @@ static struct attribute *cxl_address_spa static umode_t cxl_address_space_visible(struct kobject *kobj, struct attribute *a, int n) { - struct device *dev =3D container_of(kobj, struct device, kobj); + struct device *dev =3D kobj_to_dev(kobj); struct cxl_address_space *space =3D dev_to_address_space(dev); = if (a =3D=3D &dev_attr_supports_pmem.attr && --===============7438463032451849901==--