* [PATCH] scripts: kernel-doc: Check existence of FILE arg
@ 2022-02-23 6:07 Akira Yokosawa
2022-02-23 13:47 ` Tomasz Warniełło
0 siblings, 1 reply; 5+ messages in thread
From: Akira Yokosawa @ 2022-02-23 6:07 UTC (permalink / raw)
To: Jonathan Corbet; +Cc: Randy Dunlap, linux-doc, linux-kernel, Akira Yokosawa
Subject: [PATCH] scripts: kernel-doc: Check existence of FILE arg
Currently, when no FILE argument is given following switches such
as -man, -rst, and -none, kernel-doc ends up in the error of (long
msg from perl folded):
Use of uninitialized value $ARGV[0] in pattern match (m//)
at ./scripts/kernel-doc line 438.
Fix this by adding an existence check at the bottom of the while
loop parsing command switches and call usage() if there remains
no argument.
While at it, fix inconsistent indent by spaces in the previous
block.
Signed-off-by: Akira Yokosawa <akiyks@gmail.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Randy Dunlap <rdunlap@infradead.org>
Cc: linux-doc@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
---
Hi Jon,
I noticed this minor issue while reviewing Tomasz's patch series.
This patch is relative to docs-next as of 2022.02.22.
Thanks, Akira
--
scripts/kernel-doc | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/scripts/kernel-doc b/scripts/kernel-doc
index 3106b7536b89..faefe2977f0e 100755
--- a/scripts/kernel-doc
+++ b/scripts/kernel-doc
@@ -494,7 +494,11 @@ while ($ARGV[0] =~ m/^--?(.*)/) {
}
} else {
# Unknown argument
- usage();
+ usage();
+ }
+ if ($#ARGV < 0){
+ print "No FILE!\n";
+ usage();
}
}
base-commit: b62ef3a1cca0553613adce16515f3640400725b4
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] scripts: kernel-doc: Check existence of FILE arg
2022-02-23 6:07 [PATCH] scripts: kernel-doc: Check existence of FILE arg Akira Yokosawa
@ 2022-02-23 13:47 ` Tomasz Warniełło
2022-02-23 13:59 ` Akira Yokosawa
0 siblings, 1 reply; 5+ messages in thread
From: Tomasz Warniełło @ 2022-02-23 13:47 UTC (permalink / raw)
To: Akira Yokosawa
Cc: Jonathan Corbet, Randy Dunlap, linux-doc, linux-kernel,
tomasz.warniello
On Wed, 23 Feb 2022 15:07:30 +0900
Akira Yokosawa <akiyks@gmail.com> wrote:
> Currently, when no FILE argument is given following switches such
> as -man, -rst, and -none, kernel-doc ends up in the error of (long
> msg from perl folded):
>
> Use of uninitialized value $ARGV[0] in pattern match (m//)
> at ./scripts/kernel-doc line 438.
It's a warning not an error.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scripts: kernel-doc: Check existence of FILE arg
2022-02-23 13:47 ` Tomasz Warniełło
@ 2022-02-23 13:59 ` Akira Yokosawa
2022-02-23 14:17 ` Tomasz Warniełło
0 siblings, 1 reply; 5+ messages in thread
From: Akira Yokosawa @ 2022-02-23 13:59 UTC (permalink / raw)
To: Tomasz Warniełło
Cc: Jonathan Corbet, Randy Dunlap, linux-doc, linux-kernel,
Akira Yokosawa
On Wed, 23 Feb 2022 14:47:13 +0100,
Tomasz Warniełło wrote:
> On Wed, 23 Feb 2022 15:07:30 +0900
> Akira Yokosawa <akiyks@gmail.com> wrote:
>
>> Currently, when no FILE argument is given following switches such
>> as -man, -rst, and -none, kernel-doc ends up in the error of (long
>> msg from perl folded):
>>
>> Use of uninitialized value $ARGV[0] in pattern match (m//)
>> at ./scripts/kernel-doc line 438.
>
> It's a warning not an error.
Good catch!
Will amend in v2 with proper attribution.
Thanks Akira
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scripts: kernel-doc: Check existence of FILE arg
2022-02-23 13:59 ` Akira Yokosawa
@ 2022-02-23 14:17 ` Tomasz Warniełło
2022-02-23 14:36 ` Jonathan Corbet
0 siblings, 1 reply; 5+ messages in thread
From: Tomasz Warniełło @ 2022-02-23 14:17 UTC (permalink / raw)
To: Akira Yokosawa; +Cc: Jonathan Corbet, Randy Dunlap, linux-doc, linux-kernel
On Wed, 23 Feb 2022 22:59:01 +0900
Akira Yokosawa <akiyks@gmail.com> wrote:
> On Wed, 23 Feb 2022 14:47:13 +0100,
> Tomasz Warniełło wrote:
> > On Wed, 23 Feb 2022 15:07:30 +0900
> > Akira Yokosawa <akiyks@gmail.com> wrote:
> >
> >> Currently, when no FILE argument is given following switches such
> >> as -man, -rst, and -none, kernel-doc ends up in the error of (long
> >> msg from perl folded):
> >>
> >> Use of uninitialized value $ARGV[0] in pattern match (m//)
> >> at ./scripts/kernel-doc line 438.
> >
> > It's a warning not an error.
>
> Good catch!
>
> Will amend in v2 with proper attribution.
>
> Thanks Akira
I'd include this in a series regulating all the CLI syntax - all those
mutual exclusions and arg parsing error handling, etc. At the moment they
exist only in the documentation.
But I'm not sure this is the right moment to do this. Have you seen
my RFC thread? I'd wait until the water stabilises and see the result.
This script may be phased out - how soon, I don't know. Unless you want
to do this purely for sport.
Tomasz
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] scripts: kernel-doc: Check existence of FILE arg
2022-02-23 14:17 ` Tomasz Warniełło
@ 2022-02-23 14:36 ` Jonathan Corbet
0 siblings, 0 replies; 5+ messages in thread
From: Jonathan Corbet @ 2022-02-23 14:36 UTC (permalink / raw)
To: Tomasz Warniełło, Akira Yokosawa
Cc: Randy Dunlap, linux-doc, linux-kernel
Tomasz Warniełło <tomasz.warniello@gmail.com> writes:
> But I'm not sure this is the right moment to do this. Have you seen
> my RFC thread? I'd wait until the water stabilises and see the result.
> This script may be phased out - how soon, I don't know. Unless you want
> to do this purely for sport.
Unless somebody steps up to do the work, I don't see that phasing out
happening any time really soon. I know I'll not be able to find the
time to take on a project like that...so I certainly wouldn't be turning
away improvements to the current script on that basis.
Thanks,
jon
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-02-23 14:36 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-02-23 6:07 [PATCH] scripts: kernel-doc: Check existence of FILE arg Akira Yokosawa
2022-02-23 13:47 ` Tomasz Warniełło
2022-02-23 13:59 ` Akira Yokosawa
2022-02-23 14:17 ` Tomasz Warniełło
2022-02-23 14:36 ` Jonathan Corbet
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox