* [PATCH] uacce: Use kobj_to_dev() instead of container_of()
@ 2020-08-20 2:16 Tian Tao
2020-08-20 2:52 ` Zhangfei Gao
0 siblings, 1 reply; 2+ messages in thread
From: Tian Tao @ 2020-08-20 2:16 UTC (permalink / raw)
To: zhangfei.gao, wangzhou1, arnd, gregkh, linux-accelerators, linux-kernel
Cc: linuxarm
Use kobj_to_dev() instead of container_of()
Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
Reviewed-by: Zhou Wang <wangzhou1@hisilicon.com>
---
drivers/misc/uacce/uacce.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/uacce/uacce.c b/drivers/misc/uacce/uacce.c
index a5b8dab..a9da7b1 100644
--- a/drivers/misc/uacce/uacce.c
+++ b/drivers/misc/uacce/uacce.c
@@ -370,7 +370,7 @@ static struct attribute *uacce_dev_attrs[] = {
static umode_t uacce_dev_is_visible(struct kobject *kobj,
struct attribute *attr, int n)
{
- struct device *dev = container_of(kobj, struct device, kobj);
+ struct device *dev = kobj_to_dev(kobj);
struct uacce_device *uacce = to_uacce_device(dev);
if (((attr == &dev_attr_region_mmio_size.attr) &&
--
2.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] uacce: Use kobj_to_dev() instead of container_of()
2020-08-20 2:16 [PATCH] uacce: Use kobj_to_dev() instead of container_of() Tian Tao
@ 2020-08-20 2:52 ` Zhangfei Gao
0 siblings, 0 replies; 2+ messages in thread
From: Zhangfei Gao @ 2020-08-20 2:52 UTC (permalink / raw)
To: Tian Tao, wangzhou1, arnd, gregkh, linux-accelerators, linux-kernel
Cc: linuxarm
On 2020/8/20 上午10:16, Tian Tao wrote:
> Use kobj_to_dev() instead of container_of()
>
> Signed-off-by: Tian Tao <tiantao6@hisilicon.com>
> Reviewed-by: Zhou Wang <wangzhou1@hisilicon.com>
Acked-by: Zhangfei Gao <zhangfei.gao@linaro.org>
Thanks
> ---
> drivers/misc/uacce/uacce.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/misc/uacce/uacce.c b/drivers/misc/uacce/uacce.c
> index a5b8dab..a9da7b1 100644
> --- a/drivers/misc/uacce/uacce.c
> +++ b/drivers/misc/uacce/uacce.c
> @@ -370,7 +370,7 @@ static struct attribute *uacce_dev_attrs[] = {
> static umode_t uacce_dev_is_visible(struct kobject *kobj,
> struct attribute *attr, int n)
> {
> - struct device *dev = container_of(kobj, struct device, kobj);
> + struct device *dev = kobj_to_dev(kobj);
> struct uacce_device *uacce = to_uacce_device(dev);
>
> if (((attr == &dev_attr_region_mmio_size.attr) &&
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-08-20 2:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-20 2:16 [PATCH] uacce: Use kobj_to_dev() instead of container_of() Tian Tao
2020-08-20 2:52 ` Zhangfei Gao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).