* [PATCH] checkpatch: simplify the output of --list-types
@ 2017-09-04 8:08 Jean Delvare
2017-09-04 15:48 ` Joe Perches
0 siblings, 1 reply; 3+ messages in thread
From: Jean Delvare @ 2017-09-04 8:08 UTC (permalink / raw)
To: Andy Whitcroft, Joe Perches; +Cc: LKML
Drop the header and numbering of types. This format was confusing as
it suggested one could pass the number instead of the type name,
however it did not actually work, and numbering wasn't stable anyway.
Signed-off-by: Jean Delvare <jdelvare@suse.de>
Cc: Andy Whitcroft <apw@canonical.com>
Cc: Joe Perches <joe@perches.com>
---
scripts/checkpatch.pl | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
--- linux-4.13-rc7.orig/scripts/checkpatch.pl 2017-09-04 08:51:13.234841824 +0200
+++ linux-4.13-rc7/scripts/checkpatch.pl 2017-09-04 10:07:11.994427535 +0200
@@ -134,8 +134,6 @@ sub uniq {
sub list_types {
my ($exitcode) = @_;
- my $count = 0;
-
local $/ = undef;
open(my $script, '<', abs_path($P)) or
@@ -150,9 +148,8 @@ sub list_types {
push (@types, $_);
}
@types = sort(uniq(@types));
- print("#\tMessage type\n\n");
foreach my $type (@types) {
- print(++$count . "\t" . $type . "\n");
+ print "$type\n";
}
exit($exitcode);
--
Jean Delvare
SUSE L3 Support
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] checkpatch: simplify the output of --list-types
2017-09-04 8:08 [PATCH] checkpatch: simplify the output of --list-types Jean Delvare
@ 2017-09-04 15:48 ` Joe Perches
2017-09-05 9:37 ` Jean Delvare
0 siblings, 1 reply; 3+ messages in thread
From: Joe Perches @ 2017-09-04 15:48 UTC (permalink / raw)
To: Jean Delvare, Andy Whitcroft; +Cc: LKML, Andrew Morton
On Mon, 2017-09-04 at 10:08 +0200, Jean Delvare wrote:
> Drop the header and numbering of types. This format was confusing as
> it suggested one could pass the number instead of the type name,
> however it did not actually work, and numbering wasn't stable anyway.
<shrug> If it makes you happy.
I suppose a bigger improvement would be to detail
the purpose of each type.
Most are fairly obvious, some like MEMSET are
a bit obscure.
Another defect:
The list also includes types that are commented out.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] checkpatch: simplify the output of --list-types
2017-09-04 15:48 ` Joe Perches
@ 2017-09-05 9:37 ` Jean Delvare
0 siblings, 0 replies; 3+ messages in thread
From: Jean Delvare @ 2017-09-05 9:37 UTC (permalink / raw)
To: Joe Perches; +Cc: Andy Whitcroft, LKML, Andrew Morton
On Mon, 04 Sep 2017 08:48:36 -0700, Joe Perches wrote:
> On Mon, 2017-09-04 at 10:08 +0200, Jean Delvare wrote:
> > Drop the header and numbering of types. This format was confusing as
> > it suggested one could pass the number instead of the type name,
> > however it did not actually work, and numbering wasn't stable anyway.
>
> <shrug> If it makes you happy.
>
> I suppose a bigger improvement would be to detail
> the purpose of each type.
That would be great indeed, however this would require a completely
different approach, as I can't think of a way to automatically extract
this information by just parsing the script.
> Most are fairly obvious, some like MEMSET are
> a bit obscure.
>
> Another defect:
>
> The list also includes types that are commented out.
This could be considered a feature: if they were not listed, the user
would have no idea that they can be commented out.
OTOH I'm not sure why some tests are commented out in the first place,
it doesn't make much sense to me. Either they serve a purpose and they
should be enabled, or there is some kind of issue with them and they
should be either fixed or deleted altogether.
--
Jean Delvare
SUSE L3 Support
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-09-05 9:37 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-04 8:08 [PATCH] checkpatch: simplify the output of --list-types Jean Delvare
2017-09-04 15:48 ` Joe Perches
2017-09-05 9:37 ` Jean Delvare
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox