From: "Guido Günther" <guido.gunther@puri.sm>
To: Deepak R Varma <mh12gx2825@gmail.com>
Cc: Ondrej Jirman <megous@megous.com>,
Purism Kernel Team <kernel@puri.sm>,
David Airlie <airlied@linux.ie>,
daniel.vetter@ffwll.ch, linux-kernel@vger.kernel.org,
dri-devel@lists.freedesktop.org, melissa.srw@gmail.com,
outreachy-kernel@googlegroups.com,
Thierry Reding <thierry.reding@gmail.com>,
Sam Ravnborg <sam@ravnborg.org>
Subject: Re: [PATCH] drm/panel: st7703: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe()
Date: Sun, 1 Nov 2020 17:02:47 +0100 [thread overview]
Message-ID: <20201101160247.GA3193@bogon.m.sigxcpu.org> (raw)
In-Reply-To: <20201030033150.GA275009@my--box>
Hi,
On Fri, Oct 30, 2020 at 09:01:50AM +0530, Deepak R Varma wrote:
> Using DEFINE_DEBUGFS_ATTRIBUTE macro with debugfs_create_file_unsafe()
> function in place of the debugfs_create_file() function will make the
> file operation struct "reset" aware of the file's lifetime. Additional
> details here: https://lists.archive.carbon60.com/linux/kernel/2369498
>
> Issue reported by Coccinelle script:
> scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci
>
> Signed-off-by: Deepak R Varma <mh12gx2825@gmail.com>
Reviewed-by: Guido Günther <agx@sigxcpu.org>
Cheers,
-- Guido
> ---
> Please Note: This is a Outreachy project task patch.
>
> drivers/gpu/drm/panel/panel-sitronix-st7703.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-sitronix-st7703.c b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> index c22e7c49e077..89b71d4f810d 100644
> --- a/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> +++ b/drivers/gpu/drm/panel/panel-sitronix-st7703.c
> @@ -502,15 +502,14 @@ static int allpixelson_set(void *data, u64 val)
> return 0;
> }
>
> -DEFINE_SIMPLE_ATTRIBUTE(allpixelson_fops, NULL,
> - allpixelson_set, "%llu\n");
> +DEFINE_DEBUGFS_ATTRIBUTE(allpixelson_fops, NULL, allpixelson_set, "%llu\n");
>
> static void st7703_debugfs_init(struct st7703 *ctx)
> {
> ctx->debugfs = debugfs_create_dir(DRV_NAME, NULL);
>
> - debugfs_create_file("allpixelson", 0600, ctx->debugfs, ctx,
> - &allpixelson_fops);
> + debugfs_create_file_unsafe("allpixelson", 0600, ctx->debugfs, ctx,
> + &allpixelson_fops);
> }
>
> static void st7703_debugfs_remove(struct st7703 *ctx)
> --
> 2.25.1
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2020-11-01 16:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-30 3:31 [PATCH] drm/panel: st7703: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe() Deepak R Varma
2020-11-01 9:22 ` Sam Ravnborg
2020-11-01 16:02 ` Guido Günther [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=20201101160247.GA3193@bogon.m.sigxcpu.org \
--to=guido.gunther@puri.sm \
--cc=airlied@linux.ie \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=kernel@puri.sm \
--cc=linux-kernel@vger.kernel.org \
--cc=megous@megous.com \
--cc=melissa.srw@gmail.com \
--cc=mh12gx2825@gmail.com \
--cc=outreachy-kernel@googlegroups.com \
--cc=sam@ravnborg.org \
--cc=thierry.reding@gmail.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