From: Guenter Roeck <linux@roeck-us.net>
To: YueHaibing <yuehaibing@huawei.com>
Cc: Luca Tettamanti <kronos.it@gmail.com>,
Jean Delvare <jdelvare@suse.com>,
linux-hwmon@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH -next] hwmon: Fix debugfs_simple_attr.cocci warnings
Date: Wed, 12 Dec 2018 06:45:09 -0800 [thread overview]
Message-ID: <20181212144509.GA7173@roeck-us.net> (raw)
In-Reply-To: <1544603796-173016-1-git-send-email-yuehaibing@huawei.com>
On Wed, Dec 12, 2018 at 08:36:36AM +0000, YueHaibing wrote:
> Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE
> for debugfs files.
>
> Semantic patch information:
> Rationale: DEFINE_SIMPLE_ATTRIBUTE + debugfs_create_file()
> imposes some significant overhead as compared to
> DEFINE_DEBUGFS_ATTRIBUTE + debugfs_create_file_unsafe().
>
> Generated by: scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci
>
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Applied. In future patches, please refer to the affected driver in the
subject line.
Thanks,
Guenter
> ---
> drivers/hwmon/asus_atk0110.c | 10 ++++------
> 1 file changed, 4 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/hwmon/asus_atk0110.c b/drivers/hwmon/asus_atk0110.c
> index a5638d1..22be78c 100644
> --- a/drivers/hwmon/asus_atk0110.c
> +++ b/drivers/hwmon/asus_atk0110.c
> @@ -681,10 +681,8 @@ static int atk_debugfs_gitm_get(void *p, u64 *val)
> return err;
> }
>
> -DEFINE_SIMPLE_ATTRIBUTE(atk_debugfs_gitm,
> - atk_debugfs_gitm_get,
> - NULL,
> - "0x%08llx\n");
> +DEFINE_DEBUGFS_ATTRIBUTE(atk_debugfs_gitm, atk_debugfs_gitm_get, NULL,
> + "0x%08llx\n");
>
> static int atk_acpi_print(char *buf, size_t sz, union acpi_object *obj)
> {
> @@ -803,8 +801,8 @@ static void atk_debugfs_init(struct atk_data *data)
> if (!f || IS_ERR(f))
> goto cleanup;
>
> - f = debugfs_create_file("gitm", 0400, d, data,
> - &atk_debugfs_gitm);
> + f = debugfs_create_file_unsafe("gitm", 0400, d, data,
> + &atk_debugfs_gitm);
> if (!f || IS_ERR(f))
> goto cleanup;
>
prev parent reply other threads:[~2018-12-12 14:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-12 8:36 [PATCH -next] hwmon: Fix debugfs_simple_attr.cocci warnings YueHaibing
2018-12-12 14:45 ` Guenter Roeck [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20181212144509.GA7173@roeck-us.net \
--to=linux@roeck-us.net \
--cc=jdelvare@suse.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=kronos.it@gmail.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=yuehaibing@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).