public inbox for util-linux@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] libfdisk: gpt: avoid unnecessary pmbr check
@ 2013-09-22  3:45 Davidlohr Bueso
  2013-09-22  3:45 ` [PATCH 2/3] libfdisk: gpt: do not assume first pt record is always pmbr Davidlohr Bueso
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Davidlohr Bueso @ 2013-09-22  3:45 UTC (permalink / raw)
  To: Karel Zak; +Cc: util-linux, Davidlohr Bueso

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 <davidlohr@hp.com>
---
 libfdisk/src/gpt.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libfdisk/src/gpt.c b/libfdisk/src/gpt.c
index b929b84..2a6284a 100644
--- a/libfdisk/src/gpt.c
+++ b/libfdisk/src/gpt.c
@@ -503,9 +503,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))
-- 
1.7.11.7

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-09-25  9:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-22  3:45 [PATCH 1/3] libfdisk: gpt: avoid unnecessary pmbr check Davidlohr Bueso
2013-09-22  3:45 ` [PATCH 2/3] libfdisk: gpt: do not assume first pt record is always pmbr Davidlohr Bueso
2013-09-25  9:26   ` Karel Zak
2013-09-22  3:45 ` [PATCH 3/3] libfdisk: gpt: loosen check fot pmbr size in lba Davidlohr Bueso
2013-09-25  9:27   ` Karel Zak
2013-09-25  9:25 ` [PATCH 1/3] libfdisk: gpt: avoid unnecessary pmbr check Karel Zak

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox