linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] via/via_irq: use __func__ to replace string function name
@ 2020-11-19  7:29 Bernard Zhao
  2020-11-23 21:42 ` Sam Ravnborg
  0 siblings, 1 reply; 4+ messages in thread
From: Bernard Zhao @ 2020-11-19  7:29 UTC (permalink / raw)
  To: David Airlie, Daniel Vetter, Bernard Zhao, dri-devel, linux-kernel
  Cc: opensource.kernel

This change also fix checkpatch.pl warning:
WARNING: Prefer using '"%s...", __func__' to using
'via_driver_irq_postinstall', this function's name, in a string
+	DRM_DEBUG("via_driver_irq_postinstall\n");

Signed-off-by: Bernard Zhao <bernard@vivo.com>
---
 drivers/gpu/drm/via/via_irq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/via/via_irq.c b/drivers/gpu/drm/via/via_irq.c
index 24cc445169e2..56ce5d4ee24a 100644
--- a/drivers/gpu/drm/via/via_irq.c
+++ b/drivers/gpu/drm/via/via_irq.c
@@ -308,7 +308,7 @@ int via_driver_irq_postinstall(struct drm_device *dev)
 	drm_via_private_t *dev_priv = (drm_via_private_t *) dev->dev_private;
 	u32 status;
 
-	DRM_DEBUG("via_driver_irq_postinstall\n");
+	DRM_DEBUG("fun: %s\n", __func__);
 	if (!dev_priv)
 		return -EINVAL;
 
-- 
2.29.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] via/via_irq: use __func__ to replace string function name
  2020-11-19  7:29 [PATCH] via/via_irq: use __func__ to replace string function name Bernard Zhao
@ 2020-11-23 21:42 ` Sam Ravnborg
  2020-11-23 22:24   ` [RFC PATCH] Add a new "Frozen" status to MAINTAINERS subsystem entries Joe Perches
  0 siblings, 1 reply; 4+ messages in thread
From: Sam Ravnborg @ 2020-11-23 21:42 UTC (permalink / raw)
  To: Bernard Zhao
  Cc: David Airlie, Daniel Vetter, dri-devel, linux-kernel, opensource.kernel

Hi Bernard.

On Wed, Nov 18, 2020 at 11:29:55PM -0800, Bernard Zhao wrote:
> This change also fix checkpatch.pl warning:
> WARNING: Prefer using '"%s...", __func__' to using
> 'via_driver_irq_postinstall', this function's name, in a string
> +	DRM_DEBUG("via_driver_irq_postinstall\n");
> 
> Signed-off-by: Bernard Zhao <bernard@vivo.com>
> ---
>  drivers/gpu/drm/via/via_irq.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/via/via_irq.c b/drivers/gpu/drm/via/via_irq.c
> index 24cc445169e2..56ce5d4ee24a 100644
> --- a/drivers/gpu/drm/via/via_irq.c
> +++ b/drivers/gpu/drm/via/via_irq.c
> @@ -308,7 +308,7 @@ int via_driver_irq_postinstall(struct drm_device *dev)
>  	drm_via_private_t *dev_priv = (drm_via_private_t *) dev->dev_private;
>  	u32 status;
>  
> -	DRM_DEBUG("via_driver_irq_postinstall\n");
> +	DRM_DEBUG("fun: %s\n", __func__);

DRM_DEBUG() will print the name of the calling function so the use of
__func__ here is not relevant.


For this old driver we should try to limit patches to bug fixing and
infrastructure updates.

	Sam

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [RFC PATCH] Add a new "Frozen" status to MAINTAINERS subsystem entries
  2020-11-23 21:42 ` Sam Ravnborg
@ 2020-11-23 22:24   ` Joe Perches
  2020-11-24  6:51     ` Bernard
  0 siblings, 1 reply; 4+ messages in thread
From: Joe Perches @ 2020-11-23 22:24 UTC (permalink / raw)
  To: Sam Ravnborg, Bernard Zhao
  Cc: linux-kernel, Andrew Morton, Linus Torvalds, kernel-janitors, Greg KH

On Mon, 2020-11-23 at 22:42 +0100, Sam Ravnborg wrote:
> For this old driver we should try to limit patches to bug fixing and
> infrastructure updates.

It might be useful to add a new "S:" entry type to these old drivers
as supported/maintained/obsolete may not really be appropriate.

How about something like "S: Frozen" and checkpatch could emit a
message similar to the one for unnecessary changes to obsolete code?

So using the below would emit:

$ ./scripts/checkpatch.pl -f drivers/gpu/drm/via/via_dma.c
WARNING: drivers/gpu/drm/via/via_dma.c is marked as 'frozen' in the MAINTAINERS hierarchy.  No unnecessary modifications please.

Maybe like the below (and fyi there's no additional git lookup overhead as
the initial obsolete check already caches the git result).

---
 MAINTAINERS           | 10 +++++++++-
 scripts/checkpatch.pl | 11 +++++++----
 2 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/MAINTAINERS b/MAINTAINERS
index 5f10105cac6f..6374d29180b8 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -88,7 +88,10 @@ Descriptions of section entries and preferred order
 	   Supported:	Someone is actually paid to look after this.
 	   Maintained:	Someone actually looks after it.
 	   Odd Fixes:	It has a maintainer but they don't have time to do
-			much other than throw the odd patch in. See below..
+			much other than throw the odd patch in.
+	   Frozen:	Old code that should not be modified unless changes
+			are to correct actual defects or API infrastructure.
+			Cleanup/style changes are not generally accepted.
 	   Orphan:	No current maintainer [but maybe you could take the
 			role as you write your new code].
 	   Obsolete:	Old code. Something tagged obsolete generally means
@@ -5718,6 +5721,11 @@ S:	Supported
 T:	git git://anongit.freedesktop.org/drm/drm-misc
 F:	drivers/gpu/drm/udl/
 
+DRM DRIVER FOR VIA
+L:	dri-devel@lists.freedesktop.org
+S:	Frozen
+F:	drivers/gpu/drm/via/
+
 DRM DRIVER FOR VIRTUAL KERNEL MODESETTING (VKMS)
 M:	Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
 M:	Melissa Wen <melissa.srw@gmail.com>
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index fdfd5ec09be6..79321cbfb761 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -902,8 +902,8 @@ sub seed_camelcase_file {
 
 our %maintained_status = ();
 
-sub is_maintained_obsolete {
-	my ($filename) = @_;
+sub is_maintained {
+	my ($filename, $test) = @_;
 
 	return 0 if (!$tree || !(-e "$root/scripts/get_maintainer.pl"));
 
@@ -911,7 +911,7 @@ sub is_maintained_obsolete {
 		$maintained_status{$filename} = `perl $root/scripts/get_maintainer.pl --status --nom --nol --nogit --nogit-fallback -f $filename 2>&1`;
 	}
 
-	return $maintained_status{$filename} =~ /obsolete/i;
+	return $maintained_status{$filename} =~ /$test/i;
 }
 
 sub is_SPDX_License_valid {
@@ -2633,9 +2633,12 @@ sub process {
 		}
 
 		if ($found_file) {
-			if (is_maintained_obsolete($realfile)) {
+			if (is_maintained($realfile, "obsolete")) {
 				WARN("OBSOLETE",
 				     "$realfile is marked as 'obsolete' in the MAINTAINERS hierarchy.  No unnecessary modifications please.\n");
+			} elsif (is_maintained($realfile, "frozen")) {
+				WARN("FROZEN",
+				     "$realfile is marked as 'frozen' in the MAINTAINERS hierarchy.  No unnecessary modifications please.\n");
 			}
 			if ($realfile =~ m@^(?:drivers/net/|net/|drivers/staging/)@) {
 				$check = 1;



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re:[RFC PATCH] Add a new "Frozen" status to MAINTAINERS subsystem entries
  2020-11-23 22:24   ` [RFC PATCH] Add a new "Frozen" status to MAINTAINERS subsystem entries Joe Perches
@ 2020-11-24  6:51     ` Bernard
  0 siblings, 0 replies; 4+ messages in thread
From: Bernard @ 2020-11-24  6:51 UTC (permalink / raw)
  To: Joe Perches
  Cc: Sam Ravnborg, linux-kernel, Andrew Morton, Linus Torvalds,
	kernel-janitors, Greg KH


From: Joe Perches <joe@perches.com>
Date: 2020-11-24 06:24:07
To:  Sam Ravnborg <sam@ravnborg.org>,Bernard Zhao <bernard@vivo.com>
Cc:  linux-kernel@vger.kernel.org,Andrew Morton <akpm@linux-foundation.org>,Linus Torvalds <torvalds@linux-foundation.org>,kernel-janitors <kernel-janitors@vger.kernel.org>,Greg KH <gregkh@linuxfoundation.org>
Subject: [RFC PATCH] Add a new "Frozen" status to MAINTAINERS subsystem entries>On Mon, 2020-11-23 at 22:42 +0100, Sam Ravnborg wrote:
>> For this old driver we should try to limit patches to bug fixing and
>> infrastructure updates.
>
>It might be useful to add a new "S:" entry type to these old drivers
>as supported/maintained/obsolete may not really be appropriate.
>
>How about something like "S: Frozen" and checkpatch could emit a
>message similar to the one for unnecessary changes to obsolete code?
>
>So using the below would emit:
>
>$ ./scripts/checkpatch.pl -f drivers/gpu/drm/via/via_dma.c
>WARNING: drivers/gpu/drm/via/via_dma.c is marked as 'frozen' in the MAINTAINERS hierarchy.  No unnecessary modifications please.
>
>Maybe like the below (and fyi there's no additional git lookup overhead as
>the initial obsolete check already caches the git result).
>
>---
> MAINTAINERS           | 10 +++++++++-
> scripts/checkpatch.pl | 11 +++++++----
> 2 files changed, 16 insertions(+), 5 deletions(-)
>
>diff --git a/MAINTAINERS b/MAINTAINERS
>index 5f10105cac6f..6374d29180b8 100644
>--- a/MAINTAINERS
>+++ b/MAINTAINERS
>@@ -88,7 +88,10 @@ Descriptions of section entries and preferred order
> 	   Supported:	Someone is actually paid to look after this.
> 	   Maintained:	Someone actually looks after it.
> 	   Odd Fixes:	It has a maintainer but they don't have time to do
>-			much other than throw the odd patch in. See below..
>+			much other than throw the odd patch in.
>+	   Frozen:	Old code that should not be modified unless changes
>+			are to correct actual defects or API infrastructure.
>+			Cleanup/style changes are not generally accepted.
> 	   Orphan:	No current maintainer [but maybe you could take the
> 			role as you write your new code].
> 	   Obsolete:	Old code. Something tagged obsolete generally means
>@@ -5718,6 +5721,11 @@ S:	Supported
> T:	git git://anongit.freedesktop.org/drm/drm-misc
> F:	drivers/gpu/drm/udl/
> 
>+DRM DRIVER FOR VIA
>+L:	dri-devel@lists.freedesktop.org
>+S:	Frozen
>+F:	drivers/gpu/drm/via/
>+
> DRM DRIVER FOR VIRTUAL KERNEL MODESETTING (VKMS)
> M:	Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
> M:	Melissa Wen <melissa.srw@gmail.com>
>diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
>index fdfd5ec09be6..79321cbfb761 100755
>--- a/scripts/checkpatch.pl
>+++ b/scripts/checkpatch.pl
>@@ -902,8 +902,8 @@ sub seed_camelcase_file {
> 
> our %maintained_status = ();
> 
>-sub is_maintained_obsolete {
>-	my ($filename) = @_;
>+sub is_maintained {
>+	my ($filename, $test) = @_;
> 
> 	return 0 if (!$tree || !(-e "$root/scripts/get_maintainer.pl"));
> 
>@@ -911,7 +911,7 @@ sub is_maintained_obsolete {
> 		$maintained_status{$filename} = `perl $root/scripts/get_maintainer.pl --status --nom --nol --nogit --nogit-fallback -f $filename 2>&1`;
> 	}
> 
>-	return $maintained_status{$filename} =~ /obsolete/i;
>+	return $maintained_status{$filename} =~ /$test/i;
> }
> 
> sub is_SPDX_License_valid {
>@@ -2633,9 +2633,12 @@ sub process {
> 		}
> 
> 		if ($found_file) {
>-			if (is_maintained_obsolete($realfile)) {
>+			if (is_maintained($realfile, "obsolete")) {
> 				WARN("OBSOLETE",
> 				     "$realfile is marked as 'obsolete' in the MAINTAINERS hierarchy.  No unnecessary modifications please.\n");
>+			} elsif (is_maintained($realfile, "frozen")) {
>+				WARN("FROZEN",
>+				     "$realfile is marked as 'frozen' in the MAINTAINERS hierarchy.  No unnecessary modifications please.\n");
> 			}
> 			if ($realfile =~ m@^(?:drivers/net/|net/|drivers/staging/)@) {
> 				$check = 1;

Hi:

For me, this seems to be a nice idea.
As a  newcomer to the community, maybe I am not sure which drivers are hot and which ones do not need too much attention.
With this patch script, it will give us a better guide.

BR//Bernard
>



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-11-24  6:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-19  7:29 [PATCH] via/via_irq: use __func__ to replace string function name Bernard Zhao
2020-11-23 21:42 ` Sam Ravnborg
2020-11-23 22:24   ` [RFC PATCH] Add a new "Frozen" status to MAINTAINERS subsystem entries Joe Perches
2020-11-24  6:51     ` Bernard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).