From: Patrick Delaunay Date: Thu, 13 Apr 2017 11:52:42 +0200 Subject: [U-Boot] [PATCH v5 04/16] disk: part: prepare_backup_gpt_header rework In-Reply-To: <1492077174-31148-1-git-send-email-patrick.delaunay@st.com> References: <1492077174-31148-1-git-send-email-patrick.delaunay@st.com> Message-ID: <1492077174-31148-5-git-send-email-patrick.delaunay@st.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de inverse the order of my_lba and alternate_lba values switch value => alternate_lba can be used in partition entry computation Signed-off-by: Patrick Delaunay Reviewed-by: Christophe KERELLO --- Changes in v5: None Changes in v4: None Changes in v3: None Changes in v2: None disk/part_efi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/disk/part_efi.c b/disk/part_efi.c index 60521b3..d5cd161 100644 --- a/disk/part_efi.c +++ b/disk/part_efi.c @@ -161,9 +161,9 @@ static void prepare_backup_gpt_header(gpt_header *gpt_h) uint64_t val; /* recalculate the values for the Backup GPT Header */ - val = le64_to_cpu(gpt_h->my_lba); - gpt_h->my_lba = gpt_h->alternate_lba; - gpt_h->alternate_lba = cpu_to_le64(val); + val = le64_to_cpu(gpt_h->alternate_lba); + gpt_h->alternate_lba = gpt_h->my_lba; + gpt_h->my_lba = cpu_to_le64(val); gpt_h->partition_entry_lba = cpu_to_le64(le64_to_cpu(gpt_h->last_usable_lba) + 1); gpt_h->header_crc32 = 0; -- 1.9.1