Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

small cleanup in gpt partition handling

Remove unused argument in is_pmbr_valid()
Remove unneeded initialization of local variable legacy_mbr

Signed-off-by: Olaf Hering <olaf@aepfle.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Olaf Hering and committed by
Linus Torvalds
4c64c30a 04dd08b4

+5 -7
+5 -7
fs/partitions/efi.c
··· 152 152 } 153 153 154 154 static inline int 155 - pmbr_part_valid(struct partition *part, u64 lastlba) 155 + pmbr_part_valid(struct partition *part) 156 156 { 157 157 if (part->sys_ind == EFI_PMBR_OSTYPE_EFI_GPT && 158 158 le32_to_cpu(part->start_sect) == 1UL) ··· 163 163 /** 164 164 * is_pmbr_valid(): test Protective MBR for validity 165 165 * @mbr: pointer to a legacy mbr structure 166 - * @lastlba: last_lba for the whole device 167 166 * 168 167 * Description: Returns 1 if PMBR is valid, 0 otherwise. 169 168 * Validity depends on two things: ··· 170 171 * 2) One partition of type 0xEE is found 171 172 */ 172 173 static int 173 - is_pmbr_valid(legacy_mbr *mbr, u64 lastlba) 174 + is_pmbr_valid(legacy_mbr *mbr) 174 175 { 175 176 int i; 176 177 if (!mbr || le16_to_cpu(mbr->signature) != MSDOS_MBR_SIGNATURE) 177 178 return 0; 178 179 for (i = 0; i < 4; i++) 179 - if (pmbr_part_valid(&mbr->partition_record[i], lastlba)) 180 + if (pmbr_part_valid(&mbr->partition_record[i])) 180 181 return 1; 181 182 return 0; 182 183 } ··· 515 516 int good_pgpt = 0, good_agpt = 0, good_pmbr = 0; 516 517 gpt_header *pgpt = NULL, *agpt = NULL; 517 518 gpt_entry *pptes = NULL, *aptes = NULL; 518 - legacy_mbr *legacymbr = NULL; 519 + legacy_mbr *legacymbr; 519 520 u64 lastlba; 520 521 if (!bdev || !gpt || !ptes) 521 522 return 0; ··· 527 528 if (legacymbr) { 528 529 read_lba(bdev, 0, (u8 *) legacymbr, 529 530 sizeof (*legacymbr)); 530 - good_pmbr = is_pmbr_valid(legacymbr, lastlba); 531 + good_pmbr = is_pmbr_valid(legacymbr); 531 532 kfree(legacymbr); 532 - legacymbr=NULL; 533 533 } 534 534 if (!good_pmbr) 535 535 goto fail;