summaryrefslogtreecommitdiff
path: root/disk
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2017-09-16 14:10:41 +0900
committerTom Rini <trini@konsulko.com>2017-10-04 11:59:44 -0400
commit9b643e312d528f291966c1f30b0d90bf3b1d43dc (patch)
tree35e3780c0aabb8af73ce19a60bb8973b3f2479cd /disk
parentb44b30260ffa3dc82f4bb98b022483bb09e95353 (diff)
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: // <smpl> @@@@ -error +pr_err (...) // </smpl> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org> [trini: Re-run Coccinelle] Signed-off-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'disk')
-rw-r--r--disk/part_efi.c10
1 files changed, 5 insertions, 5 deletions
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;