From patchwork Thu Jan 5 19:30:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ma=C3=ADra_Canal?= X-Patchwork-Id: 39785 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp465146wrt; Thu, 5 Jan 2023 11:38:21 -0800 (PST) X-Google-Smtp-Source: AMrXdXv322tcoIy9v7jNxMQSa7KZ4pPiAR1/w+QhG/jpjxPQea7L8uJ1rdn0r+I1P+2tkoZfjRzP X-Received: by 2002:a17:906:eda7:b0:7c4:f402:9769 with SMTP id sa7-20020a170906eda700b007c4f4029769mr57696597ejb.76.1672947500869; Thu, 05 Jan 2023 11:38:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672947500; cv=none; d=google.com; s=arc-20160816; b=dUeMyJgTLhe3JUtr7KgCKygFgVHE6cJSLPfhbdbehiR+RbqDN4rgljeT0qTH+avxdO pso+ssZv2qKM7XkUs0LQh/yzZrHH01xhJOhR2T6WhCK4XBk6+aWkxMUf2jg4vprSWnW2 M9Sdg7wOGUMvxJO2DNpzsj4T0paK97IO9wRVj2opeZZF9dvXLZsJqZBlPH2np4lxGF2K DoBe7VctttMMjF/Vdj0L0QVARJCevynxByMbd9Cy/a/fbKguaFJQD3bUoMxjehz11N1/ m3xc/3KuVTJBNy6uiz8il7dOkd4UbVk+yp7YOmR10ETx+6YSo6Wyuq5+XXpR9VabiDik 1huQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=6ng+7yFDWt9LxupRFip41Ax8DmuR3ZIMGl3JGKRkSCM=; b=ZGHAnslGitc7XjcWS14RqNl2NmiQiczvgxCpWGWp3/K2WaJJFo//gt7nw4NB67osgM 8L7xVOo/NWT5+mff1Imx+jQ9s9cTn4ZY+6fNZoeS6fAWxFnss4fl0NuhM5nJN01NcbG3 p3zLyKt5N6fd9w9LD6p02rbRRsfdi3WNx3eyffnk8waHEs/+C7YKXXp/XkbbqLZHN1PN 2aL+4gyCOnU3af6PsLEM3GEtwimY2eDu3Wp+ZSZuY1C3LEZE0rkc+k5u7Qgc+S0yaFpt 958aX81Gi/dCAZSfmc3ZU113LY4eTQ1I3zi/Cy66YR+o2dCugYon5jIdsuHo/jkDHlV/ 8nzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b="IhWo/ViZ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gl1-20020a1709073c8100b0084cbde35b2fsi13260627ejc.465.2023.01.05.11.37.56; Thu, 05 Jan 2023 11:38:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b="IhWo/ViZ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235819AbjAETeD (ORCPT + 99 others); Thu, 5 Jan 2023 14:34:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235922AbjAETde (ORCPT ); Thu, 5 Jan 2023 14:33:34 -0500 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C1252600 for ; Thu, 5 Jan 2023 11:31:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=6ng+7yFDWt9LxupRFip41Ax8DmuR3ZIMGl3JGKRkSCM=; b=IhWo/ViZZotddgwnge91joIdD4 0QJtZLN9QO/xB3TuOerTdBCV+0q+Ka/r6dheIvcSdSucO+ZSAkRZ0mKMiTDkXJ/tQkrg+BMR8H6d4 NCk83lxooSipqYGYT9e/skAoPgW9mn0JriK44nCGuYwjrW04uZtcHUy15JZA9bffX190DdUsnoIGp GPLGaVm/0QgJy837Y7FYfdgaGjqVvLDtboQlLk7iVC9xsIu34VbeelE1JpjqFXNmqXWnUYCptin6K CSl8wzC62l18t5Fc4fkAUUp5BgkvUrcOdSJPyPFq6ZaO+wVorKUbe8Rf1kXy8tx72/wnHpzmF7rNI GAd3OWFQ==; Received: from [187.36.234.139] (helo=bowie..) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1pDVx0-000Kcs-7a; Thu, 05 Jan 2023 20:30:54 +0100 From: =?utf-8?q?Ma=C3=ADra_Canal?= To: Stephen Rothwell , Jani Nikula , Maxime Ripard , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: Melissa Wen , =?utf-8?q?Andr=C3=A9_Almeida?= , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, =?utf-8?q?Ma?= =?utf-8?q?=C3=ADra_Canal?= Subject: [PATCH 1/2] drm/debugfs: use octal permissions instead of symbolic permissions Date: Thu, 5 Jan 2023 16:30:38 -0300 Message-Id: <20230105193039.287677-1-mcanal@igalia.com> X-Mailer: git-send-email 2.39.0 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754212598800331374?= X-GMAIL-MSGID: =?utf-8?q?1754212598800331374?= Currently, debugfs functions are using symbolic macros as permission bits, but checkpatch reinforces permission bits in the octal form, as they are more readable and easier to understand [1]. Therefore, use octal permission bits in all debugfs functions. [1] https://docs.kernel.org/dev-tools/checkpatch.html#permissions Suggested-by: Jani Nikula Signed-off-by: Maíra Canal Reviewed-by: Jani Nikula --- drivers/gpu/drm/drm_debugfs.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c index 5ea237839439..4f643a490dc3 100644 --- a/drivers/gpu/drm/drm_debugfs.c +++ b/drivers/gpu/drm/drm_debugfs.c @@ -207,7 +207,7 @@ void drm_debugfs_create_files(const struct drm_info_list *files, int count, tmp->minor = minor; tmp->dent = debugfs_create_file(files[i].name, - S_IFREG | S_IRUGO, root, tmp, + 0444, root, tmp, &drm_debugfs_fops); tmp->info_ent = &files[i]; @@ -246,7 +246,7 @@ int drm_debugfs_init(struct drm_minor *minor, int minor_id, dev->driver->debugfs_init(minor); list_for_each_entry_safe(entry, tmp, &dev->debugfs_list, list) { - debugfs_create_file(entry->file.name, S_IFREG | S_IRUGO, + debugfs_create_file(entry->file.name, 0444, minor->debugfs_root, entry, &drm_debugfs_entry_fops); list_del(&entry->list); } @@ -263,7 +263,7 @@ void drm_debugfs_late_register(struct drm_device *dev) return; list_for_each_entry_safe(entry, tmp, &dev->debugfs_list, list) { - debugfs_create_file(entry->file.name, S_IFREG | S_IRUGO, + debugfs_create_file(entry->file.name, 0444, minor->debugfs_root, entry, &drm_debugfs_entry_fops); list_del(&entry->list); } @@ -508,15 +508,15 @@ void drm_debugfs_connector_add(struct drm_connector *connector) connector->debugfs_entry = root; /* force */ - debugfs_create_file("force", S_IRUGO | S_IWUSR, root, connector, + debugfs_create_file("force", 0644, root, connector, &drm_connector_fops); /* edid */ - debugfs_create_file("edid_override", S_IRUGO | S_IWUSR, root, connector, + debugfs_create_file("edid_override", 0644, root, connector, &drm_edid_fops); /* vrr range */ - debugfs_create_file("vrr_range", S_IRUGO, root, connector, + debugfs_create_file("vrr_range", 0444, root, connector, &vrr_range_fops); /* max bpc */ From patchwork Thu Jan 5 19:30:39 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Ma=C3=ADra_Canal?= X-Patchwork-Id: 39786 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp465725wrt; Thu, 5 Jan 2023 11:40:10 -0800 (PST) X-Google-Smtp-Source: AMrXdXvurzh4idr758yvyBsabgzHMCr6Ooc7qjUeD3tq91EALzWHjta8ZHpn55+U6L7qXlZPYoTG X-Received: by 2002:a17:906:b00d:b0:7c1:8ba6:6eb3 with SMTP id v13-20020a170906b00d00b007c18ba66eb3mr47206865ejy.35.1672947609960; Thu, 05 Jan 2023 11:40:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672947609; cv=none; d=google.com; s=arc-20160816; b=xZTZGuuEb8yZEJb1cOoIVDbiNoycsT2h38rNRgbZemS3agr6zE/Uv2KlzNMX+CAvMT srOQG1AgK5YqkNHCazKFplHTy2fF0Kdgqw4Ofy/Qy3G10/dde/+izOSIqE0X2md0RsWd IpzgM96RtTrjIzHPPll5SMYGx0aBbx/N4fu/HTjosh65WyUi5JW7/frFRiqizvEzN+Sr m7na4bqStBMxx+aiSnh3yflWsnscAPA3hULs1u3YZ/a9BfNKMNp9rdgf6jW57p2k5FPa UcDV0wgE0rVvZdZZxLKF+ZiJAFH5vRDCaETOFsQ+KmnCbwoMfe8i574lz/haGHYrOz0R hC1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=1HKiKe9373ka0mN6FKm4s+rwzUKEimlYW6GYpQhj2R0=; b=b3r0GrPYC2qKUChzcTkydhYxByBTYhkZZFYWPtV4rrGsYgaPQY0jeUYd/U+YAPAzpX eFxO+hiWaueakP3TRZ7CtDm9PKvihoGtdw4OmncsfaAHOCV3/gXsH45GRrQaXftRjChd 13cAbj6ip65/oPPSLZxUUoJXXbqhgUhKVYntkdPMOMWZHsTlqv3SQo4Jn5AntAgP+v2b GSpAxoxIbbOAz1TGCsG7BY9VxWTmxJpN+WgjF4NMyynkz1azL1Lpvy5HoAzSs+QrLFdy CeAtdU+X6wCtbmQIo0cZBpa2+JkhxFDdcgQEvxDbZXuQ04hE8CktY7ySDcXG7pt8hqlD dLcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=BP1CBMV6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wv1-20020a170907080100b007a7f207a1b9si34696383ejb.664.2023.01.05.11.39.46; Thu, 05 Jan 2023 11:40:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@igalia.com header.s=20170329 header.b=BP1CBMV6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235800AbjAETd4 (ORCPT + 99 others); Thu, 5 Jan 2023 14:33:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235925AbjAETde (ORCPT ); Thu, 5 Jan 2023 14:33:34 -0500 Received: from fanzine2.igalia.com (fanzine2.igalia.com [213.97.179.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C97A5FC2 for ; Thu, 5 Jan 2023 11:31:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=1HKiKe9373ka0mN6FKm4s+rwzUKEimlYW6GYpQhj2R0=; b=BP1CBMV6B67FIuqRybXYKOA2B+ ukIVpCrzPqF55wKxlPxuZVlPMtVL75I18T3ifxC4IVzFi8RB0jd+XwvBnLU9OQOGas67ACHz79RRd WEiLzTZWTiP82i9293zQ3NDHbNo2AQbWYvZ9doknOM2OutUvtqn9RHmCbIpO1tCBHhaSEwq7OP7pK LYYo+C/K+Jg80OTA675SJ2PjIYFaoPql2tZFETHAN8Xybq+cOJKoWuX8o/yhxqFGgx8o0t3dUvjMp bFFaf9yj+kjcg1GnPgR1KP9Hj2a2OeCdm9u3LAEJer6GZy5GYAb8H80gEg/ENEa73QjuVK/SkuqxK 9fSdN8kg==; Received: from [187.36.234.139] (helo=bowie..) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1pDVx4-000Kcs-UY; Thu, 05 Jan 2023 20:30:59 +0100 From: =?utf-8?q?Ma=C3=ADra_Canal?= To: Stephen Rothwell , Jani Nikula , Maxime Ripard , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter Cc: Melissa Wen , =?utf-8?q?Andr=C3=A9_Almeida?= , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, =?utf-8?q?Ma?= =?utf-8?q?=C3=ADra_Canal?= Subject: [PATCH 2/2] drm/debugfs: add descriptions to struct parameters Date: Thu, 5 Jan 2023 16:30:39 -0300 Message-Id: <20230105193039.287677-2-mcanal@igalia.com> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230105193039.287677-1-mcanal@igalia.com> References: <20230105193039.287677-1-mcanal@igalia.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754212713168275418?= X-GMAIL-MSGID: =?utf-8?q?1754212713168275418?= The structs drm_debugfs_info and drm_debugfs_entry don't have descriptions for their parameters, which is causing the following warnings: include/drm/drm_debugfs.h:93: warning: Function parameter or member 'name' not described in 'drm_debugfs_info' include/drm/drm_debugfs.h:93: warning: Function parameter or member 'show' not described in 'drm_debugfs_info' include/drm/drm_debugfs.h:93: warning: Function parameter or member 'driver_features' not described in 'drm_debugfs_info' include/drm/drm_debugfs.h:93: warning: Function parameter or member 'data' not described in 'drm_debugfs_info' include/drm/drm_debugfs.h:105: warning: Function parameter or member 'dev' not described in 'drm_debugfs_entry' include/drm/drm_debugfs.h:105: warning: Function parameter or member 'file' not described in 'drm_debugfs_entry' include/drm/drm_debugfs.h:105: warning: Function parameter or member 'list' not described in 'drm_debugfs_entry' Therefore, fix the warnings by adding descriptions to all struct parameters. Reported-by: Stephen Rothwell Signed-off-by: Maíra Canal --- include/drm/drm_debugfs.h | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/include/drm/drm_debugfs.h b/include/drm/drm_debugfs.h index 53b7297260a5..7616f457ce70 100644 --- a/include/drm/drm_debugfs.h +++ b/include/drm/drm_debugfs.h @@ -86,9 +86,22 @@ struct drm_info_node { * core. */ struct drm_debugfs_info { + /** @name: File name */ const char *name; + + /** + * @show: + * + * Show callback. &seq_file->private will be set to the &struct + * drm_debugfs_entry corresponding to the instance of this info + * on a given &struct drm_device. + */ int (*show)(struct seq_file*, void*); + + /** @driver_features: Required driver features for this entry. */ u32 driver_features; + + /** @data: Driver-private data, should not be device-specific. */ void *data; }; @@ -99,8 +112,13 @@ struct drm_debugfs_info { * drm_debugfs_info on a &struct drm_device. */ struct drm_debugfs_entry { + /** @dev: &struct drm_device for this node. */ struct drm_device *dev; + + /** @file: Template for this node. */ struct drm_debugfs_info file; + + /** @list: Linked list of all device nodes. */ struct list_head list; };