* [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings @ 2020-08-26 20:54 ` Julia Lawall 2020-09-08 11:37 ` Bartlomiej Zolnierkiewicz 0 siblings, 1 reply; 3+ messages in thread From: Julia Lawall @ 2020-08-26 20:54 UTC (permalink / raw) To: Denis Efremov, Bernie Thompson, Bartlomiej Zolnierkiewicz, linux-fbdev, dri-devel, linux-kernel, kbuild-all From: kernel test robot <lkp@intel.com> 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 <efremov@linux.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/jlawall/linux.git for-5.10 head: a2fc3718bc22e85378085568ecc5765fb28cabce commit: a2fc3718bc22e85378085568ecc5765fb28cabce [3/3] coccinelle: api: add kobj_to_dev.cocci script :::::: branch date: 5 days ago :::::: commit date: 5 days ago udlfb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/video/fbdev/udlfb.c +++ b/drivers/video/fbdev/udlfb.c @@ -1457,7 +1457,7 @@ static ssize_t edid_show( struct file *filp, struct kobject *kobj, struct bin_attribute *a, char *buf, loff_t off, size_t count) { - struct device *fbdev = container_of(kobj, struct device, kobj); + struct device *fbdev = kobj_to_dev(kobj); struct fb_info *fb_info = dev_get_drvdata(fbdev); struct dlfb_data *dlfb = fb_info->par; @@ -1479,7 +1479,7 @@ static ssize_t edid_store( struct file *filp, struct kobject *kobj, struct bin_attribute *a, char *src, loff_t src_off, size_t src_size) { - struct device *fbdev = container_of(kobj, struct device, kobj); + struct device *fbdev = kobj_to_dev(kobj); struct fb_info *fb_info = dev_get_drvdata(fbdev); struct dlfb_data *dlfb = fb_info->par; int ret; ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings 2020-08-26 20:54 ` [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings Julia Lawall @ 2020-09-08 11:37 ` Bartlomiej Zolnierkiewicz 0 siblings, 0 replies; 3+ messages in thread From: Bartlomiej Zolnierkiewicz @ 2020-09-08 11:37 UTC (permalink / raw) To: Julia Lawall Cc: linux-fbdev, kbuild-all, Bernie Thompson, dri-devel, linux-kernel, Denis Efremov On 8/26/20 10:54 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 > > Fixes: a2fc3718bc22 ("coccinelle: api: add kobj_to_dev.cocci script") > CC: Denis Efremov <efremov@linux.com> > Signed-off-by: kernel test robot <lkp@intel.com> > Signed-off-by: Julia Lawall <julia.lawall@inria.fr> Applied to drm-misc-next tree, thanks. Best regards, -- Bartlomiej Zolnierkiewicz Samsung R&D Institute Poland Samsung Electronics > --- > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/jlawall/linux.git for-5.10 > head: a2fc3718bc22e85378085568ecc5765fb28cabce > commit: a2fc3718bc22e85378085568ecc5765fb28cabce [3/3] coccinelle: api: add kobj_to_dev.cocci script > :::::: branch date: 5 days ago > :::::: commit date: 5 days ago > > udlfb.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > --- a/drivers/video/fbdev/udlfb.c > +++ b/drivers/video/fbdev/udlfb.c > @@ -1457,7 +1457,7 @@ static ssize_t edid_show( > struct file *filp, > struct kobject *kobj, struct bin_attribute *a, > char *buf, loff_t off, size_t count) { > - struct device *fbdev = container_of(kobj, struct device, kobj); > + struct device *fbdev = kobj_to_dev(kobj); > struct fb_info *fb_info = dev_get_drvdata(fbdev); > struct dlfb_data *dlfb = fb_info->par; > > @@ -1479,7 +1479,7 @@ static ssize_t edid_store( > struct file *filp, > struct kobject *kobj, struct bin_attribute *a, > char *src, loff_t src_off, size_t src_size) { > - struct device *fbdev = container_of(kobj, struct device, kobj); > + struct device *fbdev = kobj_to_dev(kobj); > struct fb_info *fb_info = dev_get_drvdata(fbdev); > struct dlfb_data *dlfb = fb_info->par; > int ret; > ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <13cd8bf4-06f9-04d7-e923-c397c506e8cc@web.de>]
* Re: [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings [not found] <13cd8bf4-06f9-04d7-e923-c397c506e8cc@web.de> @ 2020-08-27 20:05 ` Julia Lawall 0 siblings, 0 replies; 3+ messages in thread From: Julia Lawall @ 2020-08-27 20:05 UTC (permalink / raw) To: Markus Elfring Cc: linux-fbdev, kbuild-all, kernel test robot, Bartlomiej Zolnierkiewicz, kernel-janitors, Bernie Thompson, dri-devel, linux-kernel, Denis Efremov [-- Attachment #1: Type: text/plain, Size: 903 bytes --] On Thu, 27 Aug 2020, Markus Elfring wrote: > > Generated by: scripts/coccinelle/api/kobj_to_dev.cocci > > > > Fixes: a2fc3718bc22 ("coccinelle: api: add kobj_to_dev.cocci script") > > I wonder about such a combination of information. > > I find it reasonable that two function implementations should be adjusted > according to a generated patch. > Thus I imagine that not the mentioned SmPL script is “fixed” > but the affected source file “drivers/video/fbdev/udlfb.c” may be improved. > Will the subject “[PATCH] video: udlfb: Fix kobj_to_dev.cocci warnings” > (or “[PATCH] video: udlfb: Use kobj_to_dev() instead of container_of()”) > be more appropriate for the proposed commit message? It seems that 0-day picks up new semantic patches that are added to trees in kernel.org, but that it's strategy for generating the patch is not ideal. I'll just drop these Fixes lines. julia ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-09-08 11:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20200826205412eucas1p16c748e9d73f4cd924aae1d6386ab450c@eucas1p1.samsung.com>
2020-08-26 20:54 ` [PATCH] coccinelle: api: fix kobj_to_dev.cocci warnings Julia Lawall
2020-09-08 11:37 ` Bartlomiej Zolnierkiewicz
[not found] <13cd8bf4-06f9-04d7-e923-c397c506e8cc@web.de>
2020-08-27 20:05 ` Julia Lawall
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox