aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/ubi/debug.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-08-27 08:13:05 -0400
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-09-04 02:39:02 -0400
commite28453bbb76c290d67eb28b3ff6875a6519c3998 (patch)
tree71ca0633ec0bd8723af61c2e57922dda7394ebe5 /drivers/mtd/ubi/debug.c
parent049333cecbde11988c49ad4d7861eefbc3534422 (diff)
UBI: use pr_ helper instead of printk
Use 'pr_err()' instead of 'printk(KERN_ERR', etc. Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers/mtd/ubi/debug.c')
-rw-r--r--drivers/mtd/ubi/debug.c149
1 files changed, 71 insertions, 78 deletions
diff --git a/drivers/mtd/ubi/debug.c b/drivers/mtd/ubi/debug.c
index dd97324f3a13..26908a59506b 100644
--- a/drivers/mtd/ubi/debug.c
+++ b/drivers/mtd/ubi/debug.c
@@ -62,21 +62,15 @@ out:
62 */ 62 */
63void ubi_dump_ec_hdr(const struct ubi_ec_hdr *ec_hdr) 63void ubi_dump_ec_hdr(const struct ubi_ec_hdr *ec_hdr)
64{ 64{
65 printk(KERN_DEBUG "Erase counter header dump:\n"); 65 pr_err("Erase counter header dump:\n");
66 printk(KERN_DEBUG "\tmagic %#08x\n", 66 pr_err("\tmagic %#08x\n", be32_to_cpu(ec_hdr->magic));
67 be32_to_cpu(ec_hdr->magic)); 67 pr_err("\tversion %d\n", (int)ec_hdr->version);
68 printk(KERN_DEBUG "\tversion %d\n", (int)ec_hdr->version); 68 pr_err("\tec %llu\n", (long long)be64_to_cpu(ec_hdr->ec));
69 printk(KERN_DEBUG "\tec %llu\n", 69 pr_err("\tvid_hdr_offset %d\n", be32_to_cpu(ec_hdr->vid_hdr_offset));
70 (long long)be64_to_cpu(ec_hdr->ec)); 70 pr_err("\tdata_offset %d\n", be32_to_cpu(ec_hdr->data_offset));
71 printk(KERN_DEBUG "\tvid_hdr_offset %d\n", 71 pr_err("\timage_seq %d\n", be32_to_cpu(ec_hdr->image_seq));
72 be32_to_cpu(ec_hdr->vid_hdr_offset)); 72 pr_err("\thdr_crc %#08x\n", be32_to_cpu(ec_hdr->hdr_crc));
73 printk(KERN_DEBUG "\tdata_offset %d\n", 73 pr_err("erase counter header hexdump:\n");
74 be32_to_cpu(ec_hdr->data_offset));
75 printk(KERN_DEBUG "\timage_seq %d\n",
76 be32_to_cpu(ec_hdr->image_seq));
77 printk(KERN_DEBUG "\thdr_crc %#08x\n",
78 be32_to_cpu(ec_hdr->hdr_crc));
79 printk(KERN_DEBUG "erase counter header hexdump:\n");
80 print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 1, 74 print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 1,
81 ec_hdr, UBI_EC_HDR_SIZE, 1); 75 ec_hdr, UBI_EC_HDR_SIZE, 1);
82} 76}
@@ -87,21 +81,21 @@ void ubi_dump_ec_hdr(const struct ubi_ec_hdr *ec_hdr)
87 */ 81 */
88void ubi_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr) 82void ubi_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr)
89{ 83{
90 printk(KERN_DEBUG "Volume identifier header dump:\n"); 84 pr_err("Volume identifier header dump:\n");
91 printk(KERN_DEBUG "\tmagic %08x\n", be32_to_cpu(vid_hdr->magic)); 85 pr_err("\tmagic %08x\n", be32_to_cpu(vid_hdr->magic));
92 printk(KERN_DEBUG "\tversion %d\n", (int)vid_hdr->version); 86 pr_err("\tversion %d\n", (int)vid_hdr->version);
93 printk(KERN_DEBUG "\tvol_type %d\n", (int)vid_hdr->vol_type); 87 pr_err("\tvol_type %d\n", (int)vid_hdr->vol_type);
94 printk(KERN_DEBUG "\tcopy_flag %d\n", (int)vid_hdr->copy_flag); 88 pr_err("\tcopy_flag %d\n", (int)vid_hdr->copy_flag);
95 printk(KERN_DEBUG "\tcompat %d\n", (int)vid_hdr->compat); 89 pr_err("\tcompat %d\n", (int)vid_hdr->compat);
96 printk(KERN_DEBUG "\tvol_id %d\n", be32_to_cpu(vid_hdr->vol_id)); 90 pr_err("\tvol_id %d\n", be32_to_cpu(vid_hdr->vol_id));
97 printk(KERN_DEBUG "\tlnum %d\n", be32_to_cpu(vid_hdr->lnum)); 91 pr_err("\tlnum %d\n", be32_to_cpu(vid_hdr->lnum));
98 printk(KERN_DEBUG "\tdata_size %d\n", be32_to_cpu(vid_hdr->data_size)); 92 pr_err("\tdata_size %d\n", be32_to_cpu(vid_hdr->data_size));
99 printk(KERN_DEBUG "\tused_ebs %d\n", be32_to_cpu(vid_hdr->used_ebs)); 93 pr_err("\tused_ebs %d\n", be32_to_cpu(vid_hdr->used_ebs));
100 printk(KERN_DEBUG "\tdata_pad %d\n", be32_to_cpu(vid_hdr->data_pad)); 94 pr_err("\tdata_pad %d\n", be32_to_cpu(vid_hdr->data_pad));
101 printk(KERN_DEBUG "\tsqnum %llu\n", 95 pr_err("\tsqnum %llu\n",
102 (unsigned long long)be64_to_cpu(vid_hdr->sqnum)); 96 (unsigned long long)be64_to_cpu(vid_hdr->sqnum));
103 printk(KERN_DEBUG "\thdr_crc %08x\n", be32_to_cpu(vid_hdr->hdr_crc)); 97 pr_err("\thdr_crc %08x\n", be32_to_cpu(vid_hdr->hdr_crc));
104 printk(KERN_DEBUG "Volume identifier header hexdump:\n"); 98 pr_err("Volume identifier header hexdump:\n");
105 print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 1, 99 print_hex_dump(KERN_DEBUG, "", DUMP_PREFIX_OFFSET, 32, 1,
106 vid_hdr, UBI_VID_HDR_SIZE, 1); 100 vid_hdr, UBI_VID_HDR_SIZE, 1);
107} 101}
@@ -112,25 +106,25 @@ void ubi_dump_vid_hdr(const struct ubi_vid_hdr *vid_hdr)
112 */ 106 */
113void ubi_dump_vol_info(const struct ubi_volume *vol) 107void ubi_dump_vol_info(const struct ubi_volume *vol)
114{ 108{
115 printk(KERN_DEBUG "Volume information dump:\n"); 109 pr_err("Volume information dump:\n");
116 printk(KERN_DEBUG "\tvol_id %d\n", vol->vol_id); 110 pr_err("\tvol_id %d\n", vol->vol_id);
117 printk(KERN_DEBUG "\treserved_pebs %d\n", vol->reserved_pebs); 111 pr_err("\treserved_pebs %d\n", vol->reserved_pebs);
118 printk(KERN_DEBUG "\talignment %d\n", vol->alignment); 112 pr_err("\talignment %d\n", vol->alignment);
119 printk(KERN_DEBUG "\tdata_pad %d\n", vol->data_pad); 113 pr_err("\tdata_pad %d\n", vol->data_pad);
120 printk(KERN_DEBUG "\tvol_type %d\n", vol->vol_type); 114 pr_err("\tvol_type %d\n", vol->vol_type);
121 printk(KERN_DEBUG "\tname_len %d\n", vol->name_len); 115 pr_err("\tname_len %d\n", vol->name_len);
122 printk(KERN_DEBUG "\tusable_leb_size %d\n", vol->usable_leb_size); 116 pr_err("\tusable_leb_size %d\n", vol->usable_leb_size);
123 printk(KERN_DEBUG "\tused_ebs %d\n", vol->used_ebs); 117 pr_err("\tused_ebs %d\n", vol->used_ebs);
124 printk(KERN_DEBUG "\tused_bytes %lld\n", vol->used_bytes); 118 pr_err("\tused_bytes %lld\n", vol->used_bytes);
125 printk(KERN_DEBUG "\tlast_eb_bytes %d\n", vol->last_eb_bytes); 119 pr_err("\tlast_eb_bytes %d\n", vol->last_eb_bytes);
126 printk(KERN_DEBUG "\tcorrupted %d\n", vol->corrupted); 120 pr_err("\tcorrupted %d\n", vol->corrupted);
127 printk(KERN_DEBUG "\tupd_marker %d\n", vol->upd_marker); 121 pr_err("\tupd_marker %d\n", vol->upd_marker);
128 122
129 if (vol->name_len <= UBI_VOL_NAME_MAX && 123 if (vol->name_len <= UBI_VOL_NAME_MAX &&
130 strnlen(vol->name, vol->name_len + 1) == vol->name_len) { 124 strnlen(vol->name, vol->name_len + 1) == vol->name_len) {
131 printk(KERN_DEBUG "\tname %s\n", vol->name); 125 pr_err("\tname %s\n", vol->name);
132 } else { 126 } else {
133 printk(KERN_DEBUG "\t1st 5 characters of name: %c%c%c%c%c\n", 127 pr_err("\t1st 5 characters of name: %c%c%c%c%c\n",
134 vol->name[0], vol->name[1], vol->name[2], 128 vol->name[0], vol->name[1], vol->name[2],
135 vol->name[3], vol->name[4]); 129 vol->name[3], vol->name[4]);
136 } 130 }
@@ -145,29 +139,28 @@ void ubi_dump_vtbl_record(const struct ubi_vtbl_record *r, int idx)
145{ 139{
146 int name_len = be16_to_cpu(r->name_len); 140 int name_len = be16_to_cpu(r->name_len);
147 141
148 printk(KERN_DEBUG "Volume table record %d dump:\n", idx); 142 pr_err("Volume table record %d dump:\n", idx);
149 printk(KERN_DEBUG "\treserved_pebs %d\n", 143 pr_err("\treserved_pebs %d\n", be32_to_cpu(r->reserved_pebs));
150 be32_to_cpu(r->reserved_pebs)); 144 pr_err("\talignment %d\n", be32_to_cpu(r->alignment));
151 printk(KERN_DEBUG "\talignment %d\n", be32_to_cpu(r->alignment)); 145 pr_err("\tdata_pad %d\n", be32_to_cpu(r->data_pad));
152 printk(KERN_DEBUG "\tdata_pad %d\n", be32_to_cpu(r->data_pad)); 146 pr_err("\tvol_type %d\n", (int)r->vol_type);
153 printk(KERN_DEBUG "\tvol_type %d\n", (int)r->vol_type); 147 pr_err("\tupd_marker %d\n", (int)r->upd_marker);
154 printk(KERN_DEBUG "\tupd_marker %d\n", (int)r->upd_marker); 148 pr_err("\tname_len %d\n", name_len);
155 printk(KERN_DEBUG "\tname_len %d\n", name_len);
156 149
157 if (r->name[0] == '\0') { 150 if (r->name[0] == '\0') {
158 printk(KERN_DEBUG "\tname NULL\n"); 151 pr_err("\tname NULL\n");
159 return; 152 return;
160 } 153 }
161 154
162 if (name_len <= UBI_VOL_NAME_MAX && 155 if (name_len <= UBI_VOL_NAME_MAX &&
163 strnlen(&r->name[0], name_len + 1) == name_len) { 156 strnlen(&r->name[0], name_len + 1) == name_len) {
164 printk(KERN_DEBUG "\tname %s\n", &r->name[0]); 157 pr_err("\tname %s\n", &r->name[0]);
165 } else { 158 } else {
166 printk(KERN_DEBUG "\t1st 5 characters of name: %c%c%c%c%c\n", 159 pr_err("\t1st 5 characters of name: %c%c%c%c%c\n",
167 r->name[0], r->name[1], r->name[2], r->name[3], 160 r->name[0], r->name[1], r->name[2], r->name[3],
168 r->name[4]); 161 r->name[4]);
169 } 162 }
170 printk(KERN_DEBUG "\tcrc %#08x\n", be32_to_cpu(r->crc)); 163 pr_err("\tcrc %#08x\n", be32_to_cpu(r->crc));
171} 164}
172 165
173/** 166/**
@@ -176,15 +169,15 @@ void ubi_dump_vtbl_record(const struct ubi_vtbl_record *r, int idx)
176 */ 169 */
177void ubi_dump_av(const struct ubi_ainf_volume *av) 170void ubi_dump_av(const struct ubi_ainf_volume *av)
178{ 171{
179 printk(KERN_DEBUG "Volume attaching information dump:\n"); 172 pr_err("Volume attaching information dump:\n");
180 printk(KERN_DEBUG "\tvol_id %d\n", av->vol_id); 173 pr_err("\tvol_id %d\n", av->vol_id);
181 printk(KERN_DEBUG "\thighest_lnum %d\n", av->highest_lnum); 174 pr_err("\thighest_lnum %d\n", av->highest_lnum);
182 printk(KERN_DEBUG "\tleb_count %d\n", av->leb_count); 175 pr_err("\tleb_count %d\n", av->leb_count);
183 printk(KERN_DEBUG "\tcompat %d\n", av->compat); 176 pr_err("\tcompat %d\n", av->compat);
184 printk(KERN_DEBUG "\tvol_type %d\n", av->vol_type); 177 pr_err("\tvol_type %d\n", av->vol_type);
185 printk(KERN_DEBUG "\tused_ebs %d\n", av->used_ebs); 178 pr_err("\tused_ebs %d\n", av->used_ebs);
186 printk(KERN_DEBUG "\tlast_data_size %d\n", av->last_data_size); 179 pr_err("\tlast_data_size %d\n", av->last_data_size);
187 printk(KERN_DEBUG "\tdata_pad %d\n", av->data_pad); 180 pr_err("\tdata_pad %d\n", av->data_pad);
188} 181}
189 182
190/** 183/**
@@ -194,13 +187,13 @@ void ubi_dump_av(const struct ubi_ainf_volume *av)
194 */ 187 */
195void ubi_dump_aeb(const struct ubi_ainf_peb *aeb, int type) 188void ubi_dump_aeb(const struct ubi_ainf_peb *aeb, int type)
196{ 189{
197 printk(KERN_DEBUG "eraseblock attaching information dump:\n"); 190 pr_err("eraseblock attaching information dump:\n");
198 printk(KERN_DEBUG "\tec %d\n", aeb->ec); 191 pr_err("\tec %d\n", aeb->ec);
199 printk(KERN_DEBUG "\tpnum %d\n", aeb->pnum); 192 pr_err("\tpnum %d\n", aeb->pnum);
200 if (type == 0) { 193 if (type == 0) {
201 printk(KERN_DEBUG "\tlnum %d\n", aeb->lnum); 194 pr_err("\tlnum %d\n", aeb->lnum);
202 printk(KERN_DEBUG "\tscrub %d\n", aeb->scrub); 195 pr_err("\tscrub %d\n", aeb->scrub);
203 printk(KERN_DEBUG "\tsqnum %llu\n", aeb->sqnum); 196 pr_err("\tsqnum %llu\n", aeb->sqnum);
204 } 197 }
205} 198}
206 199
@@ -212,16 +205,16 @@ void ubi_dump_mkvol_req(const struct ubi_mkvol_req *req)
212{ 205{
213 char nm[17]; 206 char nm[17];
214 207
215 printk(KERN_DEBUG "Volume creation request dump:\n"); 208 pr_err("Volume creation request dump:\n");
216 printk(KERN_DEBUG "\tvol_id %d\n", req->vol_id); 209 pr_err("\tvol_id %d\n", req->vol_id);
217 printk(KERN_DEBUG "\talignment %d\n", req->alignment); 210 pr_err("\talignment %d\n", req->alignment);
218 printk(KERN_DEBUG "\tbytes %lld\n", (long long)req->bytes); 211 pr_err("\tbytes %lld\n", (long long)req->bytes);
219 printk(KERN_DEBUG "\tvol_type %d\n", req->vol_type); 212 pr_err("\tvol_type %d\n", req->vol_type);
220 printk(KERN_DEBUG "\tname_len %d\n", req->name_len); 213 pr_err("\tname_len %d\n", req->name_len);
221 214
222 memcpy(nm, req->name, 16); 215 memcpy(nm, req->name, 16);
223 nm[16] = 0; 216 nm[16] = 0;
224 printk(KERN_DEBUG "\t1st 16 characters of name: %s\n", nm); 217 pr_err("\t1st 16 characters of name: %s\n", nm);
225} 218}
226 219
227/** 220/**