From patchwork Fri Oct 30 03:31:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Deepak R Varma X-Patchwork-Id: 11868693 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.3 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 B7761C4742C for ; Fri, 30 Oct 2020 08:24:02 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4C77822248 for ; Fri, 30 Oct 2020 08:24:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="X1UWJ4sP" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4C77822248 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5EEB06E9A9; Fri, 30 Oct 2020 08:23:22 +0000 (UTC) Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by gabe.freedesktop.org (Postfix) with ESMTPS id EE2F7897FB for ; Fri, 30 Oct 2020 03:31:56 +0000 (UTC) Received: by mail-pg1-x544.google.com with SMTP id k9so2345815pgt.9 for ; Thu, 29 Oct 2020 20:31:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition; bh=/T4zGmBDffm929p//CkvLaNebm6nyFAD9zUf2m9Khc4=; b=X1UWJ4sPXdTWBIvP+F+d5R4n1cI/VqlbKPsD5DFU8zgNOzIuU0AC9ZGBu9xoK1nvc9 nLQpLTzbDXu6GLCZo8rs9F21QC1I/ouTPmpeh9aZRrsPJmQsdSz1mmWiVUDlJ2pxCFBQ HsUC+ecXEg0DEsWwh1r1i7yZZrhGSZ3sVXc+21L8sIz1N0MiX+FBnYm9qRkgAol30CU9 gRgT+nzRfWjSCo4tfKtNOWkwE+WpXvnFmyjFz6L8aXVDOX+8DriE1vxyPtxNOs1NbTPq K6vUU6cObxxoRI09vmq3cdOPXcYnXPouUZzw9wcZwy++N2E4Sx1IY1REOHmCj4ER+4Yt K3Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition; bh=/T4zGmBDffm929p//CkvLaNebm6nyFAD9zUf2m9Khc4=; b=BNPjfMxbhjEXoIUOeGfvUF35Gc/ohLv+WW2/qBgfkCM848/TMFpkGxGkPR6lvrM2XF cVKWD5gJi7KCzpUAZXngQn2d01tYehYsOEiJc+JgUcvO9VIQpjr5J0/XaA3gr5qVMrQx BjDNdysb57PROpdN9kwpxkEQhiDWHmiI7DCLk38vHRo2IQa7Sylh3/dWDBlRnTGO1NkM UqTfwNn44Ce/7hXZKqt7Pe5gG5l31z5la32L5KBBGysevXRcPkfDZXGF0tmPYYV79iWD kkGnWWBjGcA43nIAzL8KNHq/6PNjA6Q2MIKkWC5SVpeFCtr+yPHA5wu1RwjrPdD9+6f5 PfPw== X-Gm-Message-State: AOAM5338DsHRFYih3R7ww9ZJ3hCsO8MtFxWnmNpzWiTryNgd1HLupQBT PDxdpQBSD0IuVVq3/L2A2Q/RpwRGoGQ= X-Google-Smtp-Source: ABdhPJxkSyJmnutDKVjlWOgdwKq+ADH5KNQw1TaMs0tFikKarD1tEV+1DKJFm/wnchCxAFJxjRiytg== X-Received: by 2002:a17:90a:ba8d:: with SMTP id t13mr376040pjr.38.1604028716631; Thu, 29 Oct 2020 20:31:56 -0700 (PDT) Received: from my--box ([103.98.79.70]) by smtp.gmail.com with ESMTPSA id b17sm3932152pgb.94.2020.10.29.20.31.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Oct 2020 20:31:56 -0700 (PDT) Date: Fri, 30 Oct 2020 09:01:50 +0530 From: Deepak R Varma To: outreachy-kernel@googlegroups.com, Guido =?iso-8859-1?q?G=FCnther?= , Purism Kernel Team , Ondrej Jirman , Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] drm/panel: st7703: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe() Message-ID: <20201030033150.GA275009@my--box> MIME-Version: 1.0 Content-Disposition: inline X-Mailman-Approved-At: Fri, 30 Oct 2020 08:23:17 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: melissa.srw@gmail.com, daniel.vetter@ffwll.ch, mh12gx2825@gmail.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 --- 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)