[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPDyKFogU2BT1vmcovrGvNEOtS+cxWwM09foMfN3bOPXEhhT3g@mail.gmail.com>
Date: Thu, 23 Apr 2020 13:17:16 +0200
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Zou Wei <zou_wei@...wei.com>
Cc: "linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH -next] mmc: core: Use DEFINE_DEBUGFS_ATTRIBUTE instead of DEFINE_SIMPLE_ATTRIBUTE
On Thu, 23 Apr 2020 at 11:09, Zou Wei <zou_wei@...wei.com> wrote:
>
> Fixes coccicheck warning:
>
> drivers/mmc/core/debugfs.c:222:0-23: WARNING: mmc_clock_fops should be
> defined with DEFINE_DEBUGFS_ATTRIBUTE
>
> Use DEFINE_DEBUGFS_ATTRIBUTE rather than DEFINE_SIMPLE_ATTRIBUTE
> for debugfs files
>
> Fixes: 703aae3d09a4b ("mmc: add a file to debugfs for changing host clock at runtime")
> Fixes: a04c50aaa916f ("mmc: core: no need to check return value of debugfs_create functions")
> Reported-by: Hulk Robot <hulkci@...wei.com>
> Signed-off-by: Zou Wei <zou_wei@...wei.com>
> ---
> drivers/mmc/core/debugfs.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mmc/core/debugfs.c b/drivers/mmc/core/debugfs.c
> index 09e0c76..9ec84c8 100644
> --- a/drivers/mmc/core/debugfs.c
> +++ b/drivers/mmc/core/debugfs.c
> @@ -219,7 +219,7 @@ static int mmc_clock_opt_set(void *data, u64 val)
> return 0;
> }
>
> -DEFINE_SIMPLE_ATTRIBUTE(mmc_clock_fops, mmc_clock_opt_get, mmc_clock_opt_set,
> +DEFINE_DEBUGFS_ATTRIBUTE(mmc_clock_fops, mmc_clock_opt_get, mmc_clock_opt_set,
> "%llu\n");
>
> void mmc_add_host_debugfs(struct mmc_host *host)
> @@ -232,8 +232,8 @@ void mmc_add_host_debugfs(struct mmc_host *host)
> debugfs_create_file("ios", S_IRUSR, root, host, &mmc_ios_fops);
> debugfs_create_x32("caps", S_IRUSR, root, &host->caps);
> debugfs_create_x32("caps2", S_IRUSR, root, &host->caps2);
> - debugfs_create_file("clock", S_IRUSR | S_IWUSR, root, host,
> - &mmc_clock_fops);
> + debugfs_create_file_unsafe("clock", S_IRUSR | S_IWUSR, root, host,
> + &mmc_clock_fops);
Apologize for my ignorance, but why convert to the *_unsafe option for
this one, but not for the others?
[...]
Kind regards
Uffe
Powered by blists - more mailing lists