Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp2733907pxx; Sun, 1 Nov 2020 08:06:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJyP+PhYeN7MRNzHqsUKfv1YfZi6HXNyrTtXbZuiRB+7M8qG4br1m4O75rcxOThM7REZK8VW X-Received: by 2002:a05:6402:1691:: with SMTP id a17mr12287030edv.264.1604246818800; Sun, 01 Nov 2020 08:06:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604246818; cv=none; d=google.com; s=arc-20160816; b=wkqQ6ZFjHyDqaiUegvqGV/p7xk7rIUh2lwrJDDmDcedzws4H9H7FMQejTDCtmh2HQ2 6lAnWGIwf7X60CewQqzxNCuJLRx5rH2AZrX/eKpv7l/ksKzEsNyKK5srk6Akb3gQka7w 5CEk+OUQ+ZRcCOIt5DpT77OMP5wKpkV9YszbjqcNLBOjur4yN+D6pv0oK1lhKdHNB4+p Xgc1j0Ji9EOqvCyqLJ52eQ1uKGxYIZl+d62mEhIyz4dxiTAILKeUhwR8v4WY0Cn3qixB RV+FmMOs/r+2oVweAdycIgwavLBvdp+pERbySaONZLUtisVTWNUAxXeARt/cynMVMqO9 KARA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=//f8AvNNc6uYFJLxeQTbxX7On6S99bmBSIKExbGJtX0=; b=SFQZ0OlCUQFqFCraPnfjnCeJ+lDG0BUg5hyrT1nvfyeqv1Zh+O6WvB8AAnk6xRQR8p b+mgJJrIZszFmK9LdvoCjT6wN2eqRiWrA00jc9EOPg/5wXJ3UYLE+uwmJpy5aiK2VN8V SRlim2wGxAt/fAETHL+VykKOp64/GYrw+86/zcJHdBHGTf0iFAgW+5kMLqE+CAMfY960 5duDChO+Hr782Bc/JckUYtLVL9wnld4UkmmL4oh3tAHRRx4sKpoBZIuMkVe7oXscKBht Y4YMrVuTRJGauuYCdq3vXojDG25aClOd/4wx2ZkNA+tH99DnPm45HMFthUZtXu3cMlQ5 Ey+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=puri.sm Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m2si1311070eja.161.2020.11.01.08.06.35; Sun, 01 Nov 2020 08:06:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=puri.sm Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726891AbgKAQCw (ORCPT + 99 others); Sun, 1 Nov 2020 11:02:52 -0500 Received: from honk.sigxcpu.org ([24.134.29.49]:51518 "EHLO honk.sigxcpu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726730AbgKAQCv (ORCPT ); Sun, 1 Nov 2020 11:02:51 -0500 Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id 06A7BFB03; Sun, 1 Nov 2020 17:02:49 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at honk.sigxcpu.org Received: from honk.sigxcpu.org ([127.0.0.1]) by localhost (honk.sigxcpu.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Sz3em8frl4Bd; Sun, 1 Nov 2020 17:02:47 +0100 (CET) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id 22DD74463D; Sun, 1 Nov 2020 17:02:47 +0100 (CET) Date: Sun, 1 Nov 2020 17:02:47 +0100 From: Guido =?iso-8859-1?Q?G=FCnther?= To: Deepak R Varma Cc: outreachy-kernel@googlegroups.com, Purism Kernel Team , Ondrej Jirman , Thierry Reding , Sam Ravnborg , 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: <20201101160247.GA3193@bogon.m.sigxcpu.org> References: <20201030033150.GA275009@my--box> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20201030033150.GA275009@my--box> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 Reviewed-by: Guido G?nther 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 >