From: Davidlohr Bueso Date: Sun, 22 Sep 2013 03:45:14 +0000 (-0700) Subject: libfdisk: gpt: avoid unnecessary pmbr check X-Git-Tag: v2.24-rc1~68 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac920fed6cce7ad84e25eeb8df38d8e966c52946;p=thirdparty%2Futil-linux.git libfdisk: gpt: avoid unnecessary pmbr check We only jump to the 'check_hybrid' label when a valid pmbr is detected, so we need not recheck again. Move the label's logic so it doesn't include the check. Signed-off-by: Davidlohr Bueso --- diff --git a/libfdisk/src/gpt.c b/libfdisk/src/gpt.c index 908da99223..155745d260 100644 --- a/libfdisk/src/gpt.c +++ b/libfdisk/src/gpt.c @@ -490,9 +490,10 @@ static int valid_pmbr(struct fdisk_context *cxt) goto check_hybrid; } } -check_hybrid: + if (ret != GPT_MBR_PROTECTIVE) goto done; +check_hybrid: for (i = 0 ; i < 4; i++) { if ((pmbr->partition_record[i].os_type != EFI_PMBR_OSTYPE) && (pmbr->partition_record[i].os_type != 0x00))