Commit d9916962 authored by Thomas Gleixner's avatar Thomas Gleixner Committed by Linus Torvalds

fs/partitions/efi: convert to pr_debug

convert the local Dprintk() compile time debug printk wrappers to the
generic pr_debug() wrapper.
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Cc: Matt Domsch <Matt_Domsch@dell.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 04ebd4ae
...@@ -95,13 +95,6 @@ ...@@ -95,13 +95,6 @@
#include "check.h" #include "check.h"
#include "efi.h" #include "efi.h"
#undef EFI_DEBUG
#ifdef EFI_DEBUG
#define Dprintk(x...) printk(KERN_DEBUG x)
#else
#define Dprintk(x...)
#endif
/* This allows a kernel command line option 'gpt' to override /* This allows a kernel command line option 'gpt' to override
* the test for invalid PMBR. Not __initdata because reloading * the test for invalid PMBR. Not __initdata because reloading
* the partition tables happens after init too. * the partition tables happens after init too.
...@@ -305,10 +298,10 @@ is_gpt_valid(struct block_device *bdev, u64 lba, ...@@ -305,10 +298,10 @@ is_gpt_valid(struct block_device *bdev, u64 lba,
/* Check the GUID Partition Table signature */ /* Check the GUID Partition Table signature */
if (le64_to_cpu((*gpt)->signature) != GPT_HEADER_SIGNATURE) { if (le64_to_cpu((*gpt)->signature) != GPT_HEADER_SIGNATURE) {
Dprintk("GUID Partition Table Header signature is wrong:" pr_debug("GUID Partition Table Header signature is wrong:"
"%lld != %lld\n", "%lld != %lld\n",
(unsigned long long)le64_to_cpu((*gpt)->signature), (unsigned long long)le64_to_cpu((*gpt)->signature),
(unsigned long long)GPT_HEADER_SIGNATURE); (unsigned long long)GPT_HEADER_SIGNATURE);
goto fail; goto fail;
} }
...@@ -318,9 +311,8 @@ is_gpt_valid(struct block_device *bdev, u64 lba, ...@@ -318,9 +311,8 @@ is_gpt_valid(struct block_device *bdev, u64 lba,
crc = efi_crc32((const unsigned char *) (*gpt), le32_to_cpu((*gpt)->header_size)); crc = efi_crc32((const unsigned char *) (*gpt), le32_to_cpu((*gpt)->header_size));
if (crc != origcrc) { if (crc != origcrc) {
Dprintk pr_debug("GUID Partition Table Header CRC is wrong: %x != %x\n",
("GUID Partition Table Header CRC is wrong: %x != %x\n", crc, origcrc);
crc, origcrc);
goto fail; goto fail;
} }
(*gpt)->header_crc32 = cpu_to_le32(origcrc); (*gpt)->header_crc32 = cpu_to_le32(origcrc);
...@@ -328,9 +320,9 @@ is_gpt_valid(struct block_device *bdev, u64 lba, ...@@ -328,9 +320,9 @@ is_gpt_valid(struct block_device *bdev, u64 lba,
/* Check that the my_lba entry points to the LBA that contains /* Check that the my_lba entry points to the LBA that contains
* the GUID Partition Table */ * the GUID Partition Table */
if (le64_to_cpu((*gpt)->my_lba) != lba) { if (le64_to_cpu((*gpt)->my_lba) != lba) {
Dprintk("GPT my_lba incorrect: %lld != %lld\n", pr_debug("GPT my_lba incorrect: %lld != %lld\n",
(unsigned long long)le64_to_cpu((*gpt)->my_lba), (unsigned long long)le64_to_cpu((*gpt)->my_lba),
(unsigned long long)lba); (unsigned long long)lba);
goto fail; goto fail;
} }
...@@ -339,15 +331,15 @@ is_gpt_valid(struct block_device *bdev, u64 lba, ...@@ -339,15 +331,15 @@ is_gpt_valid(struct block_device *bdev, u64 lba,
*/ */
lastlba = last_lba(bdev); lastlba = last_lba(bdev);
if (le64_to_cpu((*gpt)->first_usable_lba) > lastlba) { if (le64_to_cpu((*gpt)->first_usable_lba) > lastlba) {
Dprintk("GPT: first_usable_lba incorrect: %lld > %lld\n", pr_debug("GPT: first_usable_lba incorrect: %lld > %lld\n",
(unsigned long long)le64_to_cpu((*gpt)->first_usable_lba), (unsigned long long)le64_to_cpu((*gpt)->first_usable_lba),
(unsigned long long)lastlba); (unsigned long long)lastlba);
goto fail; goto fail;
} }
if (le64_to_cpu((*gpt)->last_usable_lba) > lastlba) { if (le64_to_cpu((*gpt)->last_usable_lba) > lastlba) {
Dprintk("GPT: last_usable_lba incorrect: %lld > %lld\n", pr_debug("GPT: last_usable_lba incorrect: %lld > %lld\n",
(unsigned long long)le64_to_cpu((*gpt)->last_usable_lba), (unsigned long long)le64_to_cpu((*gpt)->last_usable_lba),
(unsigned long long)lastlba); (unsigned long long)lastlba);
goto fail; goto fail;
} }
...@@ -360,7 +352,7 @@ is_gpt_valid(struct block_device *bdev, u64 lba, ...@@ -360,7 +352,7 @@ is_gpt_valid(struct block_device *bdev, u64 lba,
le32_to_cpu((*gpt)->sizeof_partition_entry)); le32_to_cpu((*gpt)->sizeof_partition_entry));
if (crc != le32_to_cpu((*gpt)->partition_entry_array_crc32)) { if (crc != le32_to_cpu((*gpt)->partition_entry_array_crc32)) {
Dprintk("GUID Partitition Entry Array CRC check failed.\n"); pr_debug("GUID Partitition Entry Array CRC check failed.\n");
goto fail_ptes; goto fail_ptes;
} }
...@@ -616,7 +608,7 @@ efi_partition(struct parsed_partitions *state, struct block_device *bdev) ...@@ -616,7 +608,7 @@ efi_partition(struct parsed_partitions *state, struct block_device *bdev)
return 0; return 0;
} }
Dprintk("GUID Partition Table is valid! Yea!\n"); pr_debug("GUID Partition Table is valid! Yea!\n");
for (i = 0; i < le32_to_cpu(gpt->num_partition_entries) && i < state->limit-1; i++) { for (i = 0; i < le32_to_cpu(gpt->num_partition_entries) && i < state->limit-1; i++) {
if (!is_pte_valid(&ptes[i], last_lba(bdev))) if (!is_pte_valid(&ptes[i], last_lba(bdev)))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment