diff options
author | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2012-05-16 11:39:56 -0400 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2012-05-20 13:26:00 -0400 |
commit | e2986827d5d0759788d00f3759bcd46fc28f96c5 (patch) | |
tree | f1272cf940e80a0f3ee3e307341a2df0bbad6dbe /drivers/mtd/ubi/io.c | |
parent | 7bf523ae252d654f1fa85c5e8759f221afe1c593 (diff) |
UBI: get rid of dbg_err
This patch removes the 'dbg_err()' macro and we now use 'ubi_err' instead.
The idea of 'dbg_err()' was to compile out some error message to make the
binary a bit smaller - but I think it was a bad idea.
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers/mtd/ubi/io.c')
-rw-r--r-- | drivers/mtd/ubi/io.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c index 6843264840ad..8a83962a940b 100644 --- a/drivers/mtd/ubi/io.c +++ b/drivers/mtd/ubi/io.c | |||
@@ -272,7 +272,7 @@ int ubi_io_write(struct ubi_device *ubi, const void *buf, int pnum, int offset, | |||
272 | } | 272 | } |
273 | 273 | ||
274 | if (ubi_dbg_is_write_failure(ubi)) { | 274 | if (ubi_dbg_is_write_failure(ubi)) { |
275 | dbg_err("cannot write %d bytes to PEB %d:%d " | 275 | ubi_err("cannot write %d bytes to PEB %d:%d " |
276 | "(emulated)", len, pnum, offset); | 276 | "(emulated)", len, pnum, offset); |
277 | dump_stack(); | 277 | dump_stack(); |
278 | return -EIO; | 278 | return -EIO; |
@@ -387,7 +387,7 @@ retry: | |||
387 | return err; | 387 | return err; |
388 | 388 | ||
389 | if (ubi_dbg_is_erase_failure(ubi)) { | 389 | if (ubi_dbg_is_erase_failure(ubi)) { |
390 | dbg_err("cannot erase PEB %d (emulated)", pnum); | 390 | ubi_err("cannot erase PEB %d (emulated)", pnum); |
391 | return -EIO; | 391 | return -EIO; |
392 | } | 392 | } |
393 | 393 | ||
@@ -895,40 +895,40 @@ static int validate_vid_hdr(const struct ubi_device *ubi, | |||
895 | int usable_leb_size = ubi->leb_size - data_pad; | 895 | int usable_leb_size = ubi->leb_size - data_pad; |
896 | 896 | ||
897 | if (copy_flag != 0 && copy_flag != 1) { | 897 | if (copy_flag != 0 && copy_flag != 1) { |
898 | dbg_err("bad copy_flag"); | 898 | ubi_err("bad copy_flag"); |
899 | goto bad; | 899 | goto bad; |
900 | } | 900 | } |
901 | 901 | ||
902 | if (vol_id < 0 || lnum < 0 || data_size < 0 || used_ebs < 0 || | 902 | if (vol_id < 0 || lnum < 0 || data_size < 0 || used_ebs < 0 || |
903 | data_pad < 0) { | 903 | data_pad < 0) { |
904 | dbg_err("negative values"); | 904 | ubi_err("negative values"); |
905 | goto bad; | 905 | goto bad; |
906 | } | 906 | } |
907 | 907 | ||
908 | if (vol_id >= UBI_MAX_VOLUMES && vol_id < UBI_INTERNAL_VOL_START) { | 908 | if (vol_id >= UBI_MAX_VOLUMES && vol_id < UBI_INTERNAL_VOL_START) { |
909 | dbg_err("bad vol_id"); | 909 | ubi_err("bad vol_id"); |
910 | goto bad; | 910 | goto bad; |
911 | } | 911 | } |
912 | 912 | ||
913 | if (vol_id < UBI_INTERNAL_VOL_START && compat != 0) { | 913 | if (vol_id < UBI_INTERNAL_VOL_START && compat != 0) { |
914 | dbg_err("bad compat"); | 914 | ubi_err("bad compat"); |
915 | goto bad; | 915 | goto bad; |
916 | } | 916 | } |
917 | 917 | ||
918 | if (vol_id >= UBI_INTERNAL_VOL_START && compat != UBI_COMPAT_DELETE && | 918 | if (vol_id >= UBI_INTERNAL_VOL_START && compat != UBI_COMPAT_DELETE && |
919 | compat != UBI_COMPAT_RO && compat != UBI_COMPAT_PRESERVE && | 919 | compat != UBI_COMPAT_RO && compat != UBI_COMPAT_PRESERVE && |
920 | compat != UBI_COMPAT_REJECT) { | 920 | compat != UBI_COMPAT_REJECT) { |
921 | dbg_err("bad compat"); | 921 | ubi_err("bad compat"); |
922 | goto bad; | 922 | goto bad; |
923 | } | 923 | } |
924 | 924 | ||
925 | if (vol_type != UBI_VID_DYNAMIC && vol_type != UBI_VID_STATIC) { | 925 | if (vol_type != UBI_VID_DYNAMIC && vol_type != UBI_VID_STATIC) { |
926 | dbg_err("bad vol_type"); | 926 | ubi_err("bad vol_type"); |
927 | goto bad; | 927 | goto bad; |
928 | } | 928 | } |
929 | 929 | ||
930 | if (data_pad >= ubi->leb_size / 2) { | 930 | if (data_pad >= ubi->leb_size / 2) { |
931 | dbg_err("bad data_pad"); | 931 | ubi_err("bad data_pad"); |
932 | goto bad; | 932 | goto bad; |
933 | } | 933 | } |
934 | 934 | ||
@@ -940,45 +940,45 @@ static int validate_vid_hdr(const struct ubi_device *ubi, | |||
940 | * mapped logical eraseblocks. | 940 | * mapped logical eraseblocks. |
941 | */ | 941 | */ |
942 | if (used_ebs == 0) { | 942 | if (used_ebs == 0) { |
943 | dbg_err("zero used_ebs"); | 943 | ubi_err("zero used_ebs"); |
944 | goto bad; | 944 | goto bad; |
945 | } | 945 | } |
946 | if (data_size == 0) { | 946 | if (data_size == 0) { |
947 | dbg_err("zero data_size"); | 947 | ubi_err("zero data_size"); |
948 | goto bad; | 948 | goto bad; |
949 | } | 949 | } |
950 | if (lnum < used_ebs - 1) { | 950 | if (lnum < used_ebs - 1) { |
951 | if (data_size != usable_leb_size) { | 951 | if (data_size != usable_leb_size) { |
952 | dbg_err("bad data_size"); | 952 | ubi_err("bad data_size"); |
953 | goto bad; | 953 | goto bad; |
954 | } | 954 | } |
955 | } else if (lnum == used_ebs - 1) { | 955 | } else if (lnum == used_ebs - 1) { |
956 | if (data_size == 0) { | 956 | if (data_size == 0) { |
957 | dbg_err("bad data_size at last LEB"); | 957 | ubi_err("bad data_size at last LEB"); |
958 | goto bad; | 958 | goto bad; |
959 | } | 959 | } |
960 | } else { | 960 | } else { |
961 | dbg_err("too high lnum"); | 961 | ubi_err("too high lnum"); |
962 | goto bad; | 962 | goto bad; |
963 | } | 963 | } |
964 | } else { | 964 | } else { |
965 | if (copy_flag == 0) { | 965 | if (copy_flag == 0) { |
966 | if (data_crc != 0) { | 966 | if (data_crc != 0) { |
967 | dbg_err("non-zero data CRC"); | 967 | ubi_err("non-zero data CRC"); |
968 | goto bad; | 968 | goto bad; |
969 | } | 969 | } |
970 | if (data_size != 0) { | 970 | if (data_size != 0) { |
971 | dbg_err("non-zero data_size"); | 971 | ubi_err("non-zero data_size"); |
972 | goto bad; | 972 | goto bad; |
973 | } | 973 | } |
974 | } else { | 974 | } else { |
975 | if (data_size == 0) { | 975 | if (data_size == 0) { |
976 | dbg_err("zero data_size of copy"); | 976 | ubi_err("zero data_size of copy"); |
977 | goto bad; | 977 | goto bad; |
978 | } | 978 | } |
979 | } | 979 | } |
980 | if (used_ebs != 0) { | 980 | if (used_ebs != 0) { |
981 | dbg_err("bad used_ebs"); | 981 | ubi_err("bad used_ebs"); |
982 | goto bad; | 982 | goto bad; |
983 | } | 983 | } |
984 | } | 984 | } |