Message ID | 20230105193039.287677-2-mcanal@igalia.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> 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 <rfc822;tmhikaru@gmail.com> + 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; 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?= <mcanal@igalia.com> To: Stephen Rothwell <sfr@canb.auug.org.au>, Jani Nikula <jani.nikula@linux.intel.com>, Maxime Ripard <mripard@kernel.org>, Maarten Lankhorst <maarten.lankhorst@linux.intel.com>, Thomas Zimmermann <tzimmermann@suse.de>, David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch> Cc: Melissa Wen <mwen@igalia.com>, =?utf-8?q?Andr=C3=A9_Almeida?= <andrealmeid@igalia.com>, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, =?utf-8?q?Ma?= =?utf-8?q?=C3=ADra_Canal?= <mcanal@igalia.com> 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: <linux-kernel.vger.kernel.org> 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?= |
Series |
[1/2] drm/debugfs: use octal permissions instead of symbolic permissions
|
|
Commit Message
Maíra Canal
Jan. 5, 2023, 7:30 p.m. UTC
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 <sfr@canb.auug.org.au>
Signed-off-by: Maíra Canal <mcanal@igalia.com>
---
include/drm/drm_debugfs.h | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
Comments
On Thu, Jan 05, 2023 at 04:30:39PM -0300, Maíra Canal wrote: > 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 <sfr@canb.auug.org.au> > Signed-off-by: Maíra Canal <mcanal@igalia.com> > --- > 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. So this is a bit late, but why don't we pass that drm_debugfs_entry as an explicit parameter? Or maybe just the struct drm_device, because that and the void *data is really all there is to pass along. Would give us more type-safety, which really is the main reason for having drm-specific debugfs functions. Either way, on the series: Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> > + */ > 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; > }; > > -- > 2.39.0 >
On 1/6/23 17:19, Daniel Vetter wrote: > On Thu, Jan 05, 2023 at 04:30:39PM -0300, Maíra Canal wrote: >> 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 <sfr@canb.auug.org.au> >> Signed-off-by: Maíra Canal <mcanal@igalia.com> >> --- >> 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. > > So this is a bit late, but why don't we pass that drm_debugfs_entry as an > explicit parameter? Or maybe just the struct drm_device, because that and > the void *data is really all there is to pass along. Would give us more > type-safety, which really is the main reason for having drm-specific > debugfs functions. It seems like a better idea to pass the drm_debugfs_entry as an explicit parameter. I can work on it, but I guess it is a better idea to finish the conversion of all drm_debugfs_create_files() to drm_debugfs_add_files() and then perform the change in the show() signature. Best Regards, - Maíra Canal > > Either way, on the series: Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> > >> + */ >> 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; >> }; >> >> -- >> 2.39.0 >> >
On 1/5/23 16:30, Maíra Canal wrote: > 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 <sfr@canb.auug.org.au> > Signed-off-by: Maíra Canal <mcanal@igalia.com> Applied series to drm-misc-next. Best Regards, - 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; > }; >
On Mon, Jan 09, 2023 at 08:28:20AM -0300, Maíra Canal wrote: > On 1/6/23 17:19, Daniel Vetter wrote: > > On Thu, Jan 05, 2023 at 04:30:39PM -0300, Maíra Canal wrote: > > > 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 <sfr@canb.auug.org.au> > > > Signed-off-by: Maíra Canal <mcanal@igalia.com> > > > --- > > > 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. > > > > So this is a bit late, but why don't we pass that drm_debugfs_entry as an > > explicit parameter? Or maybe just the struct drm_device, because that and > > the void *data is really all there is to pass along. Would give us more > > type-safety, which really is the main reason for having drm-specific > > debugfs functions. > > It seems like a better idea to pass the drm_debugfs_entry as an explicit > parameter. I can work on it, but I guess it is a better idea to finish > the conversion of all drm_debugfs_create_files() to drm_debugfs_add_files() > and then perform the change in the show() signature. So drm_debugfs_entry still feels like a bit too high level, do callers really need that? They get the void * and I guess need the struct drm_device * This really starts to matter more when we also roll this out for connector/crtc, then you can give them directly a pointer to that. And the drm_debugfs_entry thing becomes an implementation detail entirely. Or do I miss something? Also yes we can do that later on, it shouldn't be too annyoing to roll out. -Daniel > > Best Regards, > - Maíra Canal > > > > > Either way, on the series: Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> > > > > > + */ > > > 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; > > > }; > > > -- > > > 2.39.0 > > > > >
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; };