1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-09-01 16:52:14 +02:00

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>
This commit is contained in:
Masahiro Yamada
2017-09-16 14:10:41 +09:00
committed by Tom Rini
parent b44b30260f
commit 9b643e312d
128 changed files with 560 additions and 560 deletions

View File

@@ -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;