From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============0812061260073008852==" MIME-Version: 1.0 From: kernel test robot Subject: [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings Date: Wed, 17 Mar 2021 06:21:03 +0800 Message-ID: <20210316222103.GA44461@75474912633a> In-Reply-To: <202103170600.9TrdJPXP-lkp@intel.com> List-Id: To: kbuild@lists.01.org --===============0812061260073008852== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable CC: kbuild-all(a)lists.01.org CC: linux-kernel(a)vger.kernel.org TO: Denis Efremov CC: Julia Lawall CC: Corentin Chary CC: Darren Hart CC: Andy Shevchenko CC: acpi4asus-user(a)lists.sourceforge.net CC: platform-driver-x86(a)vger.kernel.org CC: linux-kernel(a)vger.kernel.org From: kernel test robot drivers/platform/x86/asus-laptop.c:1572: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 Fixes: a2fc3718bc22 ("coccinelle: api: add kobj_to_dev.cocci script") CC: Denis Efremov Reported-by: kernel test robot Signed-off-by: kernel test robot --- tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git = master head: 1df27313f50a57497c1faeb6a6ae4ca939c85a7d commit: a2fc3718bc22e85378085568ecc5765fb28cabce coccinelle: api: add kobj_= to_dev.cocci script :::::: branch date: 5 hours ago :::::: commit date: 7 months ago Please take the patch only if it's a positive warning. Thanks! asus-laptop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/platform/x86/asus-laptop.c +++ b/drivers/platform/x86/asus-laptop.c @@ -1569,7 +1569,7 @@ static umode_t asus_sysfs_is_visible(str struct attribute *attr, int idx) { - struct device *dev =3D container_of(kobj, struct device, kobj); + struct device *dev =3D kobj_to_dev(kobj); struct asus_laptop *asus =3D dev_get_drvdata(dev); acpi_handle handle =3D asus->handle; bool supported; --===============0812061260073008852==--