From 00e354ee5bd9a6c94a9a10f39bd2d7dd3607fd98 Mon Sep 17 00:00:00 2001 From: Andrey Borzenkov Date: Sat, 6 Sep 2008 12:40:21 +0400 Subject: [PATCH] --- yaml --- r: 113380 b: refs/heads/master c: 464f04c9e9b3b1c4f5ffb89c51d8ba2a2034c846 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/arch/x86/boot/edd.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 6d3623fd9df7..b3ea646d3543 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d2f37384fc9957ad0162d5285a5660f0a86ef243 +refs/heads/master: 464f04c9e9b3b1c4f5ffb89c51d8ba2a2034c846 diff --git a/trunk/arch/x86/boot/edd.c b/trunk/arch/x86/boot/edd.c index d93cbc6464d0..bf4ae6ff518e 100644 --- a/trunk/arch/x86/boot/edd.c +++ b/trunk/arch/x86/boot/edd.c @@ -32,7 +32,9 @@ static int read_mbr(u8 devno, void *buf) : "+a" (ax), "+c" (cx), "+d" (dx), "+b" (bx) : : "esi", "edi", "memory"); - return -(u8)ax; /* 0 or -1 */ + /* Some BIOSes do not set carry flag on error but still return + * error in AH. The condition below is expected to catch both */ + return -!!ax; /* 0 or -1 */ } static u32 read_mbr_sig(u8 devno, struct edd_info *ei, u32 *mbrsig)