From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 52B5BC55178 for ; Sun, 1 Nov 2020 09:22:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 26632207F7 for ; Sun, 1 Nov 2020 09:22:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726252AbgKAJWX (ORCPT ); Sun, 1 Nov 2020 04:22:23 -0500 Received: from asavdk4.altibox.net ([109.247.116.15]:37468 "EHLO asavdk4.altibox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725936AbgKAJWW (ORCPT ); Sun, 1 Nov 2020 04:22:22 -0500 Received: from ravnborg.org (unknown [188.228.123.71]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by asavdk4.altibox.net (Postfix) with ESMTPS id AAF35804F6; Sun, 1 Nov 2020 10:22:17 +0100 (CET) Date: Sun, 1 Nov 2020 10:22:16 +0100 From: Sam Ravnborg To: Deepak R Varma Cc: outreachy-kernel@googlegroups.com, Guido =?iso-8859-1?Q?G=FCnther?= , Purism Kernel Team , Ondrej Jirman , Thierry Reding , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, melissa.srw@gmail.com, daniel.vetter@ffwll.ch Subject: Re: [PATCH] drm/panel: st7703: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe() Message-ID: <20201101092216.GB1166694@ravnborg.org> References: <20201030033150.GA275009@my--box> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201030033150.GA275009@my--box> X-CMAE-Score: 0 X-CMAE-Analysis: v=2.3 cv=VafZwmh9 c=1 sm=1 tr=0 a=S6zTFyMACwkrwXSdXUNehg==:117 a=S6zTFyMACwkrwXSdXUNehg==:17 a=kj9zAlcOel0A:10 a=S4BYaaioAAAA:8 a=pGLkceISAAAA:8 a=e5mUnYsNAAAA:8 a=P2jyfWBKOuCc-NuxQl4A:9 a=CjuIK1q_8ugA:10 a=NWVoK91CQyQA:10 a=gP6mnyLQ4wGU0PyH625T:22 a=Vxmtnl_E_bksehYqCbjh:22 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Deepak 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 Based on discussions triggered by other patches doing the same replacement I will ignore this patch for now. If the conclusions are that this is indeed the right thing to do then please let us know so we can apply this patch. Thanks, Sam > --- > 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