* [PATCH] asus-laptop: fix kobj_to_dev.cocci warnings
@ 2021-03-17 12:00 Julia Lawall
2021-03-23 20:00 ` Hans de Goede
0 siblings, 1 reply; 2+ messages in thread
From: Julia Lawall @ 2021-03-17 12:00 UTC (permalink / raw)
To: Corentin Chary, Darren Hart, Andy Shevchenko, acpi4asus-user
Cc: platform-driver-x86, linux-kernel, kbuild-all, Denis Efremov
From: kernel test robot <lkp@intel.com>
Use kobj_to_dev() instead of container_of()
Generated by: scripts/coccinelle/api/kobj_to_dev.cocci
CC: Denis Efremov <efremov@linux.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: kernel test robot <lkp@intel.com>
Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
---
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
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 = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct asus_laptop *asus = dev_get_drvdata(dev);
acpi_handle handle = asus->handle;
bool supported;
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] asus-laptop: fix kobj_to_dev.cocci warnings
2021-03-17 12:00 [PATCH] asus-laptop: fix kobj_to_dev.cocci warnings Julia Lawall
@ 2021-03-23 20:00 ` Hans de Goede
0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2021-03-23 20:00 UTC (permalink / raw)
To: Julia Lawall, Corentin Chary, Darren Hart, Andy Shevchenko,
acpi4asus-user
Cc: platform-driver-x86, linux-kernel, kbuild-all, Denis Efremov
Hi,
On 3/17/21 1:00 PM, Julia Lawall wrote:
> From: kernel test robot <lkp@intel.com>
>
> Use kobj_to_dev() instead of container_of()
>
> Generated by: scripts/coccinelle/api/kobj_to_dev.cocci
>
> CC: Denis Efremov <efremov@linux.com>
> Reported-by: kernel test robot <lkp@intel.com>
> Signed-off-by: kernel test robot <lkp@intel.com>
> Signed-off-by: Julia Lawall <julia.lawall@inria.fr>
Thank you for your patch, I've applied this patch to my review-hans
branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans
Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.
Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.
Regards,
Hans
> ---
>
> 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
>
> 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 = container_of(kobj, struct device, kobj);
> + struct device *dev = kobj_to_dev(kobj);
> struct asus_laptop *asus = dev_get_drvdata(dev);
> acpi_handle handle = asus->handle;
> bool supported;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-03-23 20:01 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-17 12:00 [PATCH] asus-laptop: fix kobj_to_dev.cocci warnings Julia Lawall
2021-03-23 20:00 ` Hans de Goede
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®