Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

markup_oops.pl: minor fixes

1. Fix a little format issue.
2. Check the return of "Getopt::Long::GetOptions". Output usage and
exit if it get error.
3. Change $ARGV[$#ARGV] to $ARGV[0].
4. Change the code which get $modulefile from modinfo. Replace the
pipeline with `modinfo -F filename $module`.
4. Change usage from "Specify the module directory name" to "Specify the
module filename".

Signed-off-by: Hui Zhu <teawater@gmail.com>
Signed-off-by: Michal Marek <mmarek@suse.cz>

authored by

Hui Zhu and committed by
Michal Marek
59dde385 52e13e21

+5 -5
+5 -5
scripts/markup_oops.pl
··· 23 23 # Get options 24 24 Getopt::Long::GetOptions( 25 25 'cross-compile|c=s' => \$cross_compile, 26 - 'module|m=s' => \$modulefile, 26 + 'module|m=s' => \$modulefile, 27 27 'help|h' => \&usage, 28 - ); 29 - my $vmlinux_name = $ARGV[$#ARGV]; 28 + ) || usage (); 29 + my $vmlinux_name = $ARGV[0]; 30 30 if (!defined($vmlinux_name)) { 31 31 my $kerver = `uname -r`; 32 32 chomp($kerver); ··· 193 193 # if it's a module, we need to find the .ko file and calculate a load offset 194 194 if ($module ne "") { 195 195 if ($modulefile eq "") { 196 - my $modulefile = `modinfo $module | grep '^filename:' | awk '{ print \$2 }'`; 196 + $modulefile = `modinfo -F filename $module`; 197 197 chomp($modulefile); 198 198 } 199 199 $filename = $modulefile; ··· 362 362 363 363 OPTION: 364 364 -c, --cross-compile CROSS_COMPILE Specify the prefix used for toolchain. 365 - -m, --module MODULE_DIRNAME Specify the module directory name. 365 + -m, --module MODULE_DIRNAME Specify the module filename. 366 366 -h, --help Help. 367 367 EOT 368 368 exit;