@@ -482,88 +482,81 @@ compare_gpts(gpt_header *pgpt, gpt_header *agpt, u64 lastlba)
482482 if (!pgpt || !agpt )
483483 return ;
484484 if (le64_to_cpu (pgpt -> my_lba ) != le64_to_cpu (agpt -> alternate_lba )) {
485- printk (KERN_WARNING
486- "GPT:Primary header LBA != Alt. header alternate_lba\n" );
487- printk (KERN_WARNING "GPT:%lld != %lld\n" ,
485+ pr_warn ("GPT:Primary header LBA != Alt. header alternate_lba\n" );
486+ pr_warn ("GPT:%lld != %lld\n" ,
488487 (unsigned long long )le64_to_cpu (pgpt -> my_lba ),
489488 (unsigned long long )le64_to_cpu (agpt -> alternate_lba ));
490489 error_found ++ ;
491490 }
492491 if (le64_to_cpu (pgpt -> alternate_lba ) != le64_to_cpu (agpt -> my_lba )) {
493- printk (KERN_WARNING
494- "GPT:Primary header alternate_lba != Alt. header my_lba\n" );
495- printk (KERN_WARNING "GPT:%lld != %lld\n" ,
492+ pr_warn ("GPT:Primary header alternate_lba != Alt. header my_lba\n" );
493+ pr_warn ("GPT:%lld != %lld\n" ,
496494 (unsigned long long )le64_to_cpu (pgpt -> alternate_lba ),
497495 (unsigned long long )le64_to_cpu (agpt -> my_lba ));
498496 error_found ++ ;
499497 }
500498 if (le64_to_cpu (pgpt -> first_usable_lba ) !=
501499 le64_to_cpu (agpt -> first_usable_lba )) {
502- printk ( KERN_WARNING "GPT:first_usable_lbas don't match.\n" );
503- printk ( KERN_WARNING "GPT:%lld != %lld\n" ,
500+ pr_warn ( "GPT:first_usable_lbas don't match.\n" );
501+ pr_warn ( "GPT:%lld != %lld\n" ,
504502 (unsigned long long )le64_to_cpu (pgpt -> first_usable_lba ),
505503 (unsigned long long )le64_to_cpu (agpt -> first_usable_lba ));
506504 error_found ++ ;
507505 }
508506 if (le64_to_cpu (pgpt -> last_usable_lba ) !=
509507 le64_to_cpu (agpt -> last_usable_lba )) {
510- printk ( KERN_WARNING "GPT:last_usable_lbas don't match.\n" );
511- printk ( KERN_WARNING "GPT:%lld != %lld\n" ,
508+ pr_warn ( "GPT:last_usable_lbas don't match.\n" );
509+ pr_warn ( "GPT:%lld != %lld\n" ,
512510 (unsigned long long )le64_to_cpu (pgpt -> last_usable_lba ),
513511 (unsigned long long )le64_to_cpu (agpt -> last_usable_lba ));
514512 error_found ++ ;
515513 }
516514 if (efi_guidcmp (pgpt -> disk_guid , agpt -> disk_guid )) {
517- printk ( KERN_WARNING "GPT:disk_guids don't match.\n" );
515+ pr_warn ( "GPT:disk_guids don't match.\n" );
518516 error_found ++ ;
519517 }
520518 if (le32_to_cpu (pgpt -> num_partition_entries ) !=
521519 le32_to_cpu (agpt -> num_partition_entries )) {
522- printk ( KERN_WARNING "GPT:num_partition_entries don't match: "
520+ pr_warn ( "GPT:num_partition_entries don't match: "
523521 "0x%x != 0x%x\n" ,
524522 le32_to_cpu (pgpt -> num_partition_entries ),
525523 le32_to_cpu (agpt -> num_partition_entries ));
526524 error_found ++ ;
527525 }
528526 if (le32_to_cpu (pgpt -> sizeof_partition_entry ) !=
529527 le32_to_cpu (agpt -> sizeof_partition_entry )) {
530- printk (KERN_WARNING
531- "GPT:sizeof_partition_entry values don't match: "
528+ pr_warn ("GPT:sizeof_partition_entry values don't match: "
532529 "0x%x != 0x%x\n" ,
533530 le32_to_cpu (pgpt -> sizeof_partition_entry ),
534531 le32_to_cpu (agpt -> sizeof_partition_entry ));
535532 error_found ++ ;
536533 }
537534 if (le32_to_cpu (pgpt -> partition_entry_array_crc32 ) !=
538535 le32_to_cpu (agpt -> partition_entry_array_crc32 )) {
539- printk (KERN_WARNING
540- "GPT:partition_entry_array_crc32 values don't match: "
536+ pr_warn ("GPT:partition_entry_array_crc32 values don't match: "
541537 "0x%x != 0x%x\n" ,
542538 le32_to_cpu (pgpt -> partition_entry_array_crc32 ),
543539 le32_to_cpu (agpt -> partition_entry_array_crc32 ));
544540 error_found ++ ;
545541 }
546542 if (le64_to_cpu (pgpt -> alternate_lba ) != lastlba ) {
547- printk (KERN_WARNING
548- "GPT:Primary header thinks Alt. header is not at the end of the disk.\n" );
549- printk (KERN_WARNING "GPT:%lld != %lld\n" ,
543+ pr_warn ("GPT:Primary header thinks Alt. header is not at the end of the disk.\n" );
544+ pr_warn ("GPT:%lld != %lld\n" ,
550545 (unsigned long long )le64_to_cpu (pgpt -> alternate_lba ),
551546 (unsigned long long )lastlba );
552547 error_found ++ ;
553548 }
554549
555550 if (le64_to_cpu (agpt -> my_lba ) != lastlba ) {
556- printk (KERN_WARNING
557- "GPT:Alternate GPT header not at the end of the disk.\n" );
558- printk (KERN_WARNING "GPT:%lld != %lld\n" ,
551+ pr_warn ("GPT:Alternate GPT header not at the end of the disk.\n" );
552+ pr_warn ("GPT:%lld != %lld\n" ,
559553 (unsigned long long )le64_to_cpu (agpt -> my_lba ),
560554 (unsigned long long )lastlba );
561555 error_found ++ ;
562556 }
563557
564558 if (error_found )
565- printk (KERN_WARNING
566- "GPT: Use GNU Parted to correct GPT errors.\n" );
559+ pr_warn ("GPT: Use GNU Parted to correct GPT errors.\n" );
567560 return ;
568561}
569562
@@ -636,15 +629,15 @@ static int find_valid_gpt(struct parsed_partitions *state, gpt_header **gpt,
636629 kfree (agpt );
637630 kfree (aptes );
638631 if (!good_agpt )
639- printk ( KERN_WARNING "Alternate GPT is invalid, using primary GPT.\n" );
632+ pr_warn ( "Alternate GPT is invalid, using primary GPT.\n" );
640633 return 1 ;
641634 }
642635 else if (good_agpt ) {
643636 * gpt = agpt ;
644637 * ptes = aptes ;
645638 kfree (pgpt );
646639 kfree (pptes );
647- printk ( KERN_WARNING "Primary GPT is invalid, using alternate GPT.\n" );
640+ pr_warn ( "Primary GPT is invalid, using alternate GPT.\n" );
648641 return 1 ;
649642 }
650643
0 commit comments