Skip to content

Commit

Permalink
markup_oops.pl: minor fixes
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
  • Loading branch information
Hui Zhu authored and michal42 committed Feb 5, 2010
1 parent 52e13e2 commit 59dde38
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/markup_oops.pl
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
# Get options
Getopt::Long::GetOptions(
'cross-compile|c=s' => \$cross_compile,
'module|m=s' => \$modulefile,
'module|m=s' => \$modulefile,
'help|h' => \&usage,
);
my $vmlinux_name = $ARGV[$#ARGV];
) || usage ();
my $vmlinux_name = $ARGV[0];
if (!defined($vmlinux_name)) {
my $kerver = `uname -r`;
chomp($kerver);
Expand Down Expand Up @@ -193,7 +193,7 @@ sub process_x86_regs
# if it's a module, we need to find the .ko file and calculate a load offset
if ($module ne "") {
if ($modulefile eq "") {
my $modulefile = `modinfo $module | grep '^filename:' | awk '{ print \$2 }'`;
$modulefile = `modinfo -F filename $module`;
chomp($modulefile);
}
$filename = $modulefile;
Expand Down Expand Up @@ -362,7 +362,7 @@ sub usage {
OPTION:
-c, --cross-compile CROSS_COMPILE Specify the prefix used for toolchain.
-m, --module MODULE_DIRNAME Specify the module directory name.
-m, --module MODULE_DIRNAME Specify the module filename.
-h, --help Help.
EOT
exit;
Expand Down

0 comments on commit 59dde38

Please sign in to comment.