diff --git a/grub-core/commands/gptprio.c b/grub-core/commands/gptprio.c index ce5840b4e..6b61bb56d 100644 --- a/grub-core/commands/gptprio.c +++ b/grub-core/commands/gptprio.c @@ -91,7 +91,7 @@ grub_find_next (const char *disk_name, if (!gpt) goto done; - if (!(gpt->status & GRUB_GPT_BOTH_VALID)) + if ((gpt->status & GRUB_GPT_BOTH_VALID) != GRUB_GPT_BOTH_VALID) if (grub_gpt_repair (dev->disk, gpt)) goto done; diff --git a/grub-core/lib/gpt.c b/grub-core/lib/gpt.c index c2821b563..4aa6e5f20 100644 --- a/grub-core/lib/gpt.c +++ b/grub-core/lib/gpt.c @@ -593,7 +593,7 @@ grub_gpt_write (grub_disk_t disk, grub_gpt_t gpt) { /* TODO: update/repair protective MBRs too. */ - if (!(gpt->status & GRUB_GPT_BOTH_VALID)) + if ((gpt->status & GRUB_GPT_BOTH_VALID) != GRUB_GPT_BOTH_VALID) return grub_error (GRUB_ERR_BAD_PART_TABLE, "Invalid GPT data"); grub_dprintf ("gpt", "writing primary GPT to %s\n", disk->name);