platform-driver-x86.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] platform/x86: Switch to using the new API kobj_to_dev()
@ 2021-02-22  7:00 Yang Li
  2021-03-04 13:33 ` Hans de Goede
  0 siblings, 1 reply; 2+ messages in thread
From: Yang Li @ 2021-02-22  7:00 UTC (permalink / raw)
  To: ike.pan; +Cc: hdegoede, mgross, platform-driver-x86, linux-kernel, Yang Li

fixed the following coccicheck:
./drivers/platform/x86/ideapad-laptop.c:523:60-61: WARNING opportunity
for kobj_to_dev()

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 drivers/platform/x86/ideapad-laptop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index 5b81baf..d6ca4f0 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -520,7 +520,7 @@ static umode_t ideapad_is_visible(struct kobject *kobj,
 				 struct attribute *attr,
 				 int idx)
 {
-	struct device *dev = container_of(kobj, struct device, kobj);
+	struct device *dev = kobj_to_dev(kobj);
 	struct ideapad_private *priv = dev_get_drvdata(dev);
 	bool supported;
 
-- 
1.8.3.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] platform/x86: Switch to using the new API kobj_to_dev()
  2021-02-22  7:00 [PATCH] platform/x86: Switch to using the new API kobj_to_dev() Yang Li
@ 2021-03-04 13:33 ` Hans de Goede
  0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2021-03-04 13:33 UTC (permalink / raw)
  To: Yang Li, ike.pan; +Cc: mgross, platform-driver-x86, linux-kernel

Hi,

On 2/22/21 8:00 AM, Yang Li wrote:
> fixed the following coccicheck:
> ./drivers/platform/x86/ideapad-laptop.c:523:60-61: WARNING opportunity
> for kobj_to_dev()
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>

Patch does not apply, please resend it rebased on the latest pdx86/for-next branch:

https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=for-next

Regards,

Hans

> ---
>  drivers/platform/x86/ideapad-laptop.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
> index 5b81baf..d6ca4f0 100644
> --- a/drivers/platform/x86/ideapad-laptop.c
> +++ b/drivers/platform/x86/ideapad-laptop.c
> @@ -520,7 +520,7 @@ static umode_t ideapad_is_visible(struct kobject *kobj,
>  				 struct attribute *attr,
>  				 int idx)
>  {
> -	struct device *dev = container_of(kobj, struct device, kobj);
> +	struct device *dev = kobj_to_dev(kobj);
>  	struct ideapad_private *priv = dev_get_drvdata(dev);
>  	bool supported;
>  
> 


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-03-04 13:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-22  7:00 [PATCH] platform/x86: Switch to using the new API kobj_to_dev() Yang Li
2021-03-04 13:33 ` 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;
as well as URLs for NNTP newsgroup(s).