mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hui Zhu <teawater@gmail.com>
To: "Andrew Morton" <akpm@linux-foundation.org>,
	"Arjan van de Ven" <arjan@linux.intel.com>,
	"Sam Ravnborg" <sam@ravnborg.org>,
	"Ozan Çaglayan" <ozan@pardus.org.tr>,
	"Matthew Wilcox" <willy@linux.intel.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] Change hex to Math::BigInt->from_hex in markup_oops.pl
Date: Sun, 17 Jan 2010 21:36:58 +0800	[thread overview]
Message-ID: <daef60381001170536s79551f0drb573181d18db6369@mail.gmail.com> (raw)

The hex cannot work well in x86 to parse the oops message for x8664.
So this patch change it.

Thanks,
Hui

Signed-off-by: Hui Zhu <teawater@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Arjan van de Ven <arjan@linux.intel.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Ozan Çaglayan <ozan@pardus.org.tr>
Cc: Matthew Wilcox <willy@linux.intel.com>

---
 scripts/markup_oops.pl |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/scripts/markup_oops.pl
+++ b/scripts/markup_oops.pl
@@ -196,7 +196,7 @@ if ($module ne "") {
 	while (<FILE>) {
 		if ($_ =~ /^([0-9a-f]+) \<$function\>\:/) {
 			my $fu = $1;
-			$vmaoffset = hex($target) - hex($fu) - hex($func_offset);
+			$vmaoffset = Math::BigInt->from_hex("0x$target") -
Math::BigInt->from_hex("0x$fu") -
Math::BigInt->from_hex("0x$func_offset");
 		}
 	}
 	close(FILE);
@@ -212,7 +212,7 @@ sub InRange {
 	my ($address, $target) = @_;
 	my $ad = "0x".$address;
 	my $ta = "0x".$target;
-	my $delta = hex($ad) - hex($ta);
+	my $delta = Math::BigInt->from_hex($ad) - Math::BigInt->from_hex($ta);

 	if (($delta > -4096) && ($delta < 4096)) {
 		return 1;

             reply	other threads:[~2010-01-17 13:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-17 13:36 Hui Zhu [this message]
2010-01-25 14:39 ` Hui Zhu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=daef60381001170536s79551f0drb573181d18db6369@mail.gmail.com \
    --to=teawater@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ozan@pardus.org.tr \
    --cc=sam@ravnborg.org \
    --cc=willy@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®