From 9b643e312d528f291966c1f30b0d90bf3b1d43dc Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Sat, 16 Sep 2017 14:10:41 +0900 Subject: treewide: replace with error() with pr_err() U-Boot widely uses error() as a bit noisier variant of printf(). This macro causes name conflict with the following line in include/linux/compiler-gcc.h: # define __compiletime_error(message) __attribute__((error(message))) This prevents us from using __compiletime_error(), and makes it difficult to fully sync BUILD_BUG macros with Linux. (Notice Linux's BUILD_BUG_ON_MSG is implemented by using compiletime_assert().) Let's convert error() into now treewide-available pr_err(). Done with the help of Coccinelle, excluing tools/ directory. The semantic patch I used is as follows: // @@@@ -error +pr_err (...) // Signed-off-by: Masahiro Yamada Reviewed-by: Simon Glass [trini: Re-run Coccinelle] Signed-off-by: Tom Rini --- disk/part_efi.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'disk') diff --git a/disk/part_efi.c b/disk/part_efi.c index 208bb14ee8..0abf48733d 100644 --- a/disk/part_efi.c +++ b/disk/part_efi.c @@ -360,7 +360,7 @@ static int set_protective_mbr(struct blk_desc *dev_desc) /* Read MBR to backup boot code if it exists */ if (blk_dread(dev_desc, 0, 1, p_mbr) != 1) { - error("** Can't read from device %d **\n", dev_desc->devnum); + pr_err("** Can't read from device %d **\n", dev_desc->devnum); return -1; } @@ -716,7 +716,7 @@ int gpt_verify_partitions(struct blk_desc *dev_desc, for (i = 0; i < parts; i++) { if (i == gpt_head->num_partition_entries) { - error("More partitions than allowed!\n"); + pr_err("More partitions than allowed!\n"); return -1; } @@ -729,7 +729,7 @@ int gpt_verify_partitions(struct blk_desc *dev_desc, if (strncmp(efi_str, (char *)partitions[i].name, sizeof(partitions->name))) { - error("Partition name: %s does not match %s!\n", + pr_err("Partition name: %s does not match %s!\n", efi_str, (char *)partitions[i].name); return -1; } @@ -746,7 +746,7 @@ int gpt_verify_partitions(struct blk_desc *dev_desc, if ((i == parts - 1) && (partitions[i].size == 0)) continue; - error("Partition %s size: %llu does not match %llu!\n", + pr_err("Partition %s size: %llu does not match %llu!\n", efi_str, (unsigned long long)gpt_part_size, (unsigned long long)partitions[i].size); return -1; @@ -767,7 +767,7 @@ int gpt_verify_partitions(struct blk_desc *dev_desc, (unsigned long long)partitions[i].start); if (le64_to_cpu(gpt_e[i].starting_lba) != partitions[i].start) { - error("Partition %s start: %llu does not match %llu!\n", + pr_err("Partition %s start: %llu does not match %llu!\n", efi_str, le64_to_cpu(gpt_e[i].starting_lba), (unsigned long long)partitions[i].start); return -1; -- cgit v1.2.3