lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200522132251.GA221470@roeck-us.net>
Date:   Fri, 22 May 2020 06:22:51 -0700
From:   Guenter Roeck <linux@...ck-us.net>
To:     zhenghaili <hailizheng1993@...il.com>
Cc:     jdelvare@...e.com, linux-hwmon@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        hailizheng <haili.zheng@...ercore.com.cn>
Subject: Re: [PATCH] drivers/hwmon/nct7802: Replace container_of() API

On Tue, May 19, 2020 at 08:25:19AM -0400, zhenghaili wrote:
> From: hailizheng <haili.zheng@...ercore.com.cn>
> 
> Replace container_of() API with kobj_to_dev().
> 
> Signed-off-by: hailizheng <haili.zheng@...ercore.com.cn>

Applied.

Thanks,
Guenter

> ---
>  drivers/hwmon/nct7802.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/hwmon/nct7802.c b/drivers/hwmon/nct7802.c
> index 2e97e56..570df8e 100644
> --- a/drivers/hwmon/nct7802.c
> +++ b/drivers/hwmon/nct7802.c
> @@ -679,7 +679,7 @@ static struct attribute *nct7802_temp_attrs[] = {
>  static umode_t nct7802_temp_is_visible(struct kobject *kobj,
>  				       struct attribute *attr, int index)
>  {
> -	struct device *dev = container_of(kobj, struct device, kobj);
> +	struct device *dev = kobj_to_dev(kobj);
>  	struct nct7802_data *data = dev_get_drvdata(dev);
>  	unsigned int reg;
>  	int err;
> @@ -778,7 +778,7 @@ static struct attribute *nct7802_in_attrs[] = {
>  static umode_t nct7802_in_is_visible(struct kobject *kobj,
>  				     struct attribute *attr, int index)
>  {
> -	struct device *dev = container_of(kobj, struct device, kobj);
> +	struct device *dev = kobj_to_dev(kobj);
>  	struct nct7802_data *data = dev_get_drvdata(dev);
>  	unsigned int reg;
>  	int err;
> @@ -853,7 +853,7 @@ static struct attribute *nct7802_fan_attrs[] = {
>  static umode_t nct7802_fan_is_visible(struct kobject *kobj,
>  				      struct attribute *attr, int index)
>  {
> -	struct device *dev = container_of(kobj, struct device, kobj);
> +	struct device *dev = kobj_to_dev(kobj);
>  	struct nct7802_data *data = dev_get_drvdata(dev);
>  	int fan = index / 4;	/* 4 attributes per fan */
>  	unsigned int reg;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ