Commit 4c64c30a5c96bb798cbd6097d4996205b5359fa2

Authored by Olaf Hering
Committed by Linus Torvalds
1 parent 04dd08b45b

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>

Showing 1 changed file with 5 additions and 7 deletions Side-by-side Diff

... ... @@ -152,7 +152,7 @@
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,7 +163,6 @@
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 169  
... ... @@ -171,13 +170,13 @@
171 170 * 2) One partition of type 0xEE is found
172 171 */
173 172 static int
174   -is_pmbr_valid(legacy_mbr *mbr, u64 lastlba)
  173 +is_pmbr_valid(legacy_mbr *mbr)
175 174 {
176 175 int i;
177 176 if (!mbr || le16_to_cpu(mbr->signature) != MSDOS_MBR_SIGNATURE)
178 177 return 0;
179 178 for (i = 0; i < 4; i++)
180   - if (pmbr_part_valid(&mbr->partition_record[i], lastlba))
  179 + if (pmbr_part_valid(&mbr->partition_record[i]))
181 180 return 1;
182 181 return 0;
183 182 }
... ... @@ -516,7 +515,7 @@
516 515 int good_pgpt = 0, good_agpt = 0, good_pmbr = 0;
517 516 gpt_header *pgpt = NULL, *agpt = NULL;
518 517 gpt_entry *pptes = NULL, *aptes = NULL;
519   - legacy_mbr *legacymbr = NULL;
  518 + legacy_mbr *legacymbr;
520 519 u64 lastlba;
521 520 if (!bdev || !gpt || !ptes)
522 521 return 0;
523 522  
... ... @@ -528,9 +527,8 @@
528 527 if (legacymbr) {
529 528 read_lba(bdev, 0, (u8 *) legacymbr,
530 529 sizeof (*legacymbr));
531   - good_pmbr = is_pmbr_valid(legacymbr, lastlba);
  530 + good_pmbr = is_pmbr_valid(legacymbr);
532 531 kfree(legacymbr);
533   - legacymbr=NULL;
534 532 }
535 533 if (!good_pmbr)
536 534 goto fail;