aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mtd/tests
diff options
context:
space:
mode:
authorVikram Narayanan <vikram186@gmail.com>2012-10-10 13:41:06 -0400
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>2012-11-15 08:37:49 -0500
commitcd66a2df7c29e51ed90f298abbb6f698fa424a08 (patch)
tree4200c5fbcb82057f0bf09d6a22f3b9461c395680 /drivers/mtd/tests
parent2c70d292825df639d7ac765424098bdc1882bd49 (diff)
mtd: tests: mtd_subpagetest: replace printk with pr_{info,crit,err}
Use pr_fmt instead of PRINT_PREF macro Signed-off-by: Vikram Narayanan <vikram186@gmail.com> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers/mtd/tests')
-rw-r--r--drivers/mtd/tests/mtd_subpagetest.c124
1 files changed, 62 insertions, 62 deletions
diff --git a/drivers/mtd/tests/mtd_subpagetest.c b/drivers/mtd/tests/mtd_subpagetest.c
index 9667bf535282..8813b0e86637 100644
--- a/drivers/mtd/tests/mtd_subpagetest.c
+++ b/drivers/mtd/tests/mtd_subpagetest.c
@@ -19,6 +19,8 @@
19 * 19 *
20 */ 20 */
21 21
22#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
23
22#include <linux/init.h> 24#include <linux/init.h>
23#include <linux/module.h> 25#include <linux/module.h>
24#include <linux/moduleparam.h> 26#include <linux/moduleparam.h>
@@ -27,8 +29,6 @@
27#include <linux/slab.h> 29#include <linux/slab.h>
28#include <linux/sched.h> 30#include <linux/sched.h>
29 31
30#define PRINT_PREF KERN_INFO "mtd_subpagetest: "
31
32static int dev = -EINVAL; 32static int dev = -EINVAL;
33module_param(dev, int, S_IRUGO); 33module_param(dev, int, S_IRUGO);
34MODULE_PARM_DESC(dev, "MTD device number to use"); 34MODULE_PARM_DESC(dev, "MTD device number to use");
@@ -82,12 +82,12 @@ static int erase_eraseblock(int ebnum)
82 82
83 err = mtd_erase(mtd, &ei); 83 err = mtd_erase(mtd, &ei);
84 if (err) { 84 if (err) {
85 printk(PRINT_PREF "error %d while erasing EB %d\n", err, ebnum); 85 pr_err("error %d while erasing EB %d\n", err, ebnum);
86 return err; 86 return err;
87 } 87 }
88 88
89 if (ei.state == MTD_ERASE_FAILED) { 89 if (ei.state == MTD_ERASE_FAILED) {
90 printk(PRINT_PREF "some erase error occurred at EB %d\n", 90 pr_err("some erase error occurred at EB %d\n",
91 ebnum); 91 ebnum);
92 return -EIO; 92 return -EIO;
93 } 93 }
@@ -100,7 +100,7 @@ static int erase_whole_device(void)
100 int err; 100 int err;
101 unsigned int i; 101 unsigned int i;
102 102
103 printk(PRINT_PREF "erasing whole device\n"); 103 pr_info("erasing whole device\n");
104 for (i = 0; i < ebcnt; ++i) { 104 for (i = 0; i < ebcnt; ++i) {
105 if (bbt[i]) 105 if (bbt[i])
106 continue; 106 continue;
@@ -109,7 +109,7 @@ static int erase_whole_device(void)
109 return err; 109 return err;
110 cond_resched(); 110 cond_resched();
111 } 111 }
112 printk(PRINT_PREF "erased %u eraseblocks\n", i); 112 pr_info("erased %u eraseblocks\n", i);
113 return 0; 113 return 0;
114} 114}
115 115
@@ -122,11 +122,11 @@ static int write_eraseblock(int ebnum)
122 set_random_data(writebuf, subpgsize); 122 set_random_data(writebuf, subpgsize);
123 err = mtd_write(mtd, addr, subpgsize, &written, writebuf); 123 err = mtd_write(mtd, addr, subpgsize, &written, writebuf);
124 if (unlikely(err || written != subpgsize)) { 124 if (unlikely(err || written != subpgsize)) {
125 printk(PRINT_PREF "error: write failed at %#llx\n", 125 pr_err("error: write failed at %#llx\n",
126 (long long)addr); 126 (long long)addr);
127 if (written != subpgsize) { 127 if (written != subpgsize) {
128 printk(PRINT_PREF " write size: %#x\n", subpgsize); 128 pr_err(" write size: %#x\n", subpgsize);
129 printk(PRINT_PREF " written: %#zx\n", written); 129 pr_err(" written: %#zx\n", written);
130 } 130 }
131 return err ? err : -1; 131 return err ? err : -1;
132 } 132 }
@@ -136,11 +136,11 @@ static int write_eraseblock(int ebnum)
136 set_random_data(writebuf, subpgsize); 136 set_random_data(writebuf, subpgsize);
137 err = mtd_write(mtd, addr, subpgsize, &written, writebuf); 137 err = mtd_write(mtd, addr, subpgsize, &written, writebuf);
138 if (unlikely(err || written != subpgsize)) { 138 if (unlikely(err || written != subpgsize)) {
139 printk(PRINT_PREF "error: write failed at %#llx\n", 139 pr_err("error: write failed at %#llx\n",
140 (long long)addr); 140 (long long)addr);
141 if (written != subpgsize) { 141 if (written != subpgsize) {
142 printk(PRINT_PREF " write size: %#x\n", subpgsize); 142 pr_err(" write size: %#x\n", subpgsize);
143 printk(PRINT_PREF " written: %#zx\n", written); 143 pr_err(" written: %#zx\n", written);
144 } 144 }
145 return err ? err : -1; 145 return err ? err : -1;
146 } 146 }
@@ -160,12 +160,12 @@ static int write_eraseblock2(int ebnum)
160 set_random_data(writebuf, subpgsize * k); 160 set_random_data(writebuf, subpgsize * k);
161 err = mtd_write(mtd, addr, subpgsize * k, &written, writebuf); 161 err = mtd_write(mtd, addr, subpgsize * k, &written, writebuf);
162 if (unlikely(err || written != subpgsize * k)) { 162 if (unlikely(err || written != subpgsize * k)) {
163 printk(PRINT_PREF "error: write failed at %#llx\n", 163 pr_err("error: write failed at %#llx\n",
164 (long long)addr); 164 (long long)addr);
165 if (written != subpgsize) { 165 if (written != subpgsize) {
166 printk(PRINT_PREF " write size: %#x\n", 166 pr_err(" write size: %#x\n",
167 subpgsize * k); 167 subpgsize * k);
168 printk(PRINT_PREF " written: %#08zx\n", 168 pr_err(" written: %#08zx\n",
169 written); 169 written);
170 } 170 }
171 return err ? err : -1; 171 return err ? err : -1;
@@ -198,23 +198,23 @@ static int verify_eraseblock(int ebnum)
198 err = mtd_read(mtd, addr, subpgsize, &read, readbuf); 198 err = mtd_read(mtd, addr, subpgsize, &read, readbuf);
199 if (unlikely(err || read != subpgsize)) { 199 if (unlikely(err || read != subpgsize)) {
200 if (mtd_is_bitflip(err) && read == subpgsize) { 200 if (mtd_is_bitflip(err) && read == subpgsize) {
201 printk(PRINT_PREF "ECC correction at %#llx\n", 201 pr_info("ECC correction at %#llx\n",
202 (long long)addr); 202 (long long)addr);
203 err = 0; 203 err = 0;
204 } else { 204 } else {
205 printk(PRINT_PREF "error: read failed at %#llx\n", 205 pr_err("error: read failed at %#llx\n",
206 (long long)addr); 206 (long long)addr);
207 return err ? err : -1; 207 return err ? err : -1;
208 } 208 }
209 } 209 }
210 if (unlikely(memcmp(readbuf, writebuf, subpgsize))) { 210 if (unlikely(memcmp(readbuf, writebuf, subpgsize))) {
211 printk(PRINT_PREF "error: verify failed at %#llx\n", 211 pr_err("error: verify failed at %#llx\n",
212 (long long)addr); 212 (long long)addr);
213 printk(PRINT_PREF "------------- written----------------\n"); 213 pr_info("------------- written----------------\n");
214 print_subpage(writebuf); 214 print_subpage(writebuf);
215 printk(PRINT_PREF "------------- read ------------------\n"); 215 pr_info("------------- read ------------------\n");
216 print_subpage(readbuf); 216 print_subpage(readbuf);
217 printk(PRINT_PREF "-------------------------------------\n"); 217 pr_info("-------------------------------------\n");
218 errcnt += 1; 218 errcnt += 1;
219 } 219 }
220 220
@@ -225,23 +225,23 @@ static int verify_eraseblock(int ebnum)
225 err = mtd_read(mtd, addr, subpgsize, &read, readbuf); 225 err = mtd_read(mtd, addr, subpgsize, &read, readbuf);
226 if (unlikely(err || read != subpgsize)) { 226 if (unlikely(err || read != subpgsize)) {
227 if (mtd_is_bitflip(err) && read == subpgsize) { 227 if (mtd_is_bitflip(err) && read == subpgsize) {
228 printk(PRINT_PREF "ECC correction at %#llx\n", 228 pr_info("ECC correction at %#llx\n",
229 (long long)addr); 229 (long long)addr);
230 err = 0; 230 err = 0;
231 } else { 231 } else {
232 printk(PRINT_PREF "error: read failed at %#llx\n", 232 pr_err("error: read failed at %#llx\n",
233 (long long)addr); 233 (long long)addr);
234 return err ? err : -1; 234 return err ? err : -1;
235 } 235 }
236 } 236 }
237 if (unlikely(memcmp(readbuf, writebuf, subpgsize))) { 237 if (unlikely(memcmp(readbuf, writebuf, subpgsize))) {
238 printk(PRINT_PREF "error: verify failed at %#llx\n", 238 pr_info("error: verify failed at %#llx\n",
239 (long long)addr); 239 (long long)addr);
240 printk(PRINT_PREF "------------- written----------------\n"); 240 pr_info("------------- written----------------\n");
241 print_subpage(writebuf); 241 print_subpage(writebuf);
242 printk(PRINT_PREF "------------- read ------------------\n"); 242 pr_info("------------- read ------------------\n");
243 print_subpage(readbuf); 243 print_subpage(readbuf);
244 printk(PRINT_PREF "-------------------------------------\n"); 244 pr_info("-------------------------------------\n");
245 errcnt += 1; 245 errcnt += 1;
246 } 246 }
247 247
@@ -262,17 +262,17 @@ static int verify_eraseblock2(int ebnum)
262 err = mtd_read(mtd, addr, subpgsize * k, &read, readbuf); 262 err = mtd_read(mtd, addr, subpgsize * k, &read, readbuf);
263 if (unlikely(err || read != subpgsize * k)) { 263 if (unlikely(err || read != subpgsize * k)) {
264 if (mtd_is_bitflip(err) && read == subpgsize * k) { 264 if (mtd_is_bitflip(err) && read == subpgsize * k) {
265 printk(PRINT_PREF "ECC correction at %#llx\n", 265 pr_info("ECC correction at %#llx\n",
266 (long long)addr); 266 (long long)addr);
267 err = 0; 267 err = 0;
268 } else { 268 } else {
269 printk(PRINT_PREF "error: read failed at " 269 pr_err("error: read failed at "
270 "%#llx\n", (long long)addr); 270 "%#llx\n", (long long)addr);
271 return err ? err : -1; 271 return err ? err : -1;
272 } 272 }
273 } 273 }
274 if (unlikely(memcmp(readbuf, writebuf, subpgsize * k))) { 274 if (unlikely(memcmp(readbuf, writebuf, subpgsize * k))) {
275 printk(PRINT_PREF "error: verify failed at %#llx\n", 275 pr_err("error: verify failed at %#llx\n",
276 (long long)addr); 276 (long long)addr);
277 errcnt += 1; 277 errcnt += 1;
278 } 278 }
@@ -295,17 +295,17 @@ static int verify_eraseblock_ff(int ebnum)
295 err = mtd_read(mtd, addr, subpgsize, &read, readbuf); 295 err = mtd_read(mtd, addr, subpgsize, &read, readbuf);
296 if (unlikely(err || read != subpgsize)) { 296 if (unlikely(err || read != subpgsize)) {
297 if (mtd_is_bitflip(err) && read == subpgsize) { 297 if (mtd_is_bitflip(err) && read == subpgsize) {
298 printk(PRINT_PREF "ECC correction at %#llx\n", 298 pr_info("ECC correction at %#llx\n",
299 (long long)addr); 299 (long long)addr);
300 err = 0; 300 err = 0;
301 } else { 301 } else {
302 printk(PRINT_PREF "error: read failed at " 302 pr_err("error: read failed at "
303 "%#llx\n", (long long)addr); 303 "%#llx\n", (long long)addr);
304 return err ? err : -1; 304 return err ? err : -1;
305 } 305 }
306 } 306 }
307 if (unlikely(memcmp(readbuf, writebuf, subpgsize))) { 307 if (unlikely(memcmp(readbuf, writebuf, subpgsize))) {
308 printk(PRINT_PREF "error: verify 0xff failed at " 308 pr_err("error: verify 0xff failed at "
309 "%#llx\n", (long long)addr); 309 "%#llx\n", (long long)addr);
310 errcnt += 1; 310 errcnt += 1;
311 } 311 }
@@ -320,7 +320,7 @@ static int verify_all_eraseblocks_ff(void)
320 int err; 320 int err;
321 unsigned int i; 321 unsigned int i;
322 322
323 printk(PRINT_PREF "verifying all eraseblocks for 0xff\n"); 323 pr_info("verifying all eraseblocks for 0xff\n");
324 for (i = 0; i < ebcnt; ++i) { 324 for (i = 0; i < ebcnt; ++i) {
325 if (bbt[i]) 325 if (bbt[i])
326 continue; 326 continue;
@@ -328,10 +328,10 @@ static int verify_all_eraseblocks_ff(void)
328 if (err) 328 if (err)
329 return err; 329 return err;
330 if (i % 256 == 0) 330 if (i % 256 == 0)
331 printk(PRINT_PREF "verified up to eraseblock %u\n", i); 331 pr_info("verified up to eraseblock %u\n", i);
332 cond_resched(); 332 cond_resched();
333 } 333 }
334 printk(PRINT_PREF "verified %u eraseblocks\n", i); 334 pr_info("verified %u eraseblocks\n", i);
335 return 0; 335 return 0;
336} 336}
337 337
@@ -342,7 +342,7 @@ static int is_block_bad(int ebnum)
342 342
343 ret = mtd_block_isbad(mtd, addr); 343 ret = mtd_block_isbad(mtd, addr);
344 if (ret) 344 if (ret)
345 printk(PRINT_PREF "block %d is bad\n", ebnum); 345 pr_info("block %d is bad\n", ebnum);
346 return ret; 346 return ret;
347} 347}
348 348
@@ -352,18 +352,18 @@ static int scan_for_bad_eraseblocks(void)
352 352
353 bbt = kzalloc(ebcnt, GFP_KERNEL); 353 bbt = kzalloc(ebcnt, GFP_KERNEL);
354 if (!bbt) { 354 if (!bbt) {
355 printk(PRINT_PREF "error: cannot allocate memory\n"); 355 pr_err("error: cannot allocate memory\n");
356 return -ENOMEM; 356 return -ENOMEM;
357 } 357 }
358 358
359 printk(PRINT_PREF "scanning for bad eraseblocks\n"); 359 pr_info("scanning for bad eraseblocks\n");
360 for (i = 0; i < ebcnt; ++i) { 360 for (i = 0; i < ebcnt; ++i) {
361 bbt[i] = is_block_bad(i) ? 1 : 0; 361 bbt[i] = is_block_bad(i) ? 1 : 0;
362 if (bbt[i]) 362 if (bbt[i])
363 bad += 1; 363 bad += 1;
364 cond_resched(); 364 cond_resched();
365 } 365 }
366 printk(PRINT_PREF "scanned %d eraseblocks, %d are bad\n", i, bad); 366 pr_info("scanned %d eraseblocks, %d are bad\n", i, bad);
367 return 0; 367 return 0;
368} 368}
369 369
@@ -377,22 +377,22 @@ static int __init mtd_subpagetest_init(void)
377 printk(KERN_INFO "=================================================\n"); 377 printk(KERN_INFO "=================================================\n");
378 378
379 if (dev < 0) { 379 if (dev < 0) {
380 printk(PRINT_PREF "Please specify a valid mtd-device via module paramter\n"); 380 pr_info("Please specify a valid mtd-device via module paramter\n");
381 printk(KERN_CRIT "CAREFUL: This test wipes all data on the specified MTD device!\n"); 381 pr_crit("CAREFUL: This test wipes all data on the specified MTD device!\n");
382 return -EINVAL; 382 return -EINVAL;
383 } 383 }
384 384
385 printk(PRINT_PREF "MTD device: %d\n", dev); 385 pr_info("MTD device: %d\n", dev);
386 386
387 mtd = get_mtd_device(NULL, dev); 387 mtd = get_mtd_device(NULL, dev);
388 if (IS_ERR(mtd)) { 388 if (IS_ERR(mtd)) {
389 err = PTR_ERR(mtd); 389 err = PTR_ERR(mtd);
390 printk(PRINT_PREF "error: cannot get MTD device\n"); 390 pr_err("error: cannot get MTD device\n");
391 return err; 391 return err;
392 } 392 }
393 393
394 if (mtd->type != MTD_NANDFLASH) { 394 if (mtd->type != MTD_NANDFLASH) {
395 printk(PRINT_PREF "this test requires NAND flash\n"); 395 pr_info("this test requires NAND flash\n");
396 goto out; 396 goto out;
397 } 397 }
398 398
@@ -402,7 +402,7 @@ static int __init mtd_subpagetest_init(void)
402 ebcnt = tmp; 402 ebcnt = tmp;
403 pgcnt = mtd->erasesize / mtd->writesize; 403 pgcnt = mtd->erasesize / mtd->writesize;
404 404
405 printk(PRINT_PREF "MTD device size %llu, eraseblock size %u, " 405 pr_info("MTD device size %llu, eraseblock size %u, "
406 "page size %u, subpage size %u, count of eraseblocks %u, " 406 "page size %u, subpage size %u, count of eraseblocks %u, "
407 "pages per eraseblock %u, OOB size %u\n", 407 "pages per eraseblock %u, OOB size %u\n",
408 (unsigned long long)mtd->size, mtd->erasesize, 408 (unsigned long long)mtd->size, mtd->erasesize,
@@ -412,12 +412,12 @@ static int __init mtd_subpagetest_init(void)
412 bufsize = subpgsize * 32; 412 bufsize = subpgsize * 32;
413 writebuf = kmalloc(bufsize, GFP_KERNEL); 413 writebuf = kmalloc(bufsize, GFP_KERNEL);
414 if (!writebuf) { 414 if (!writebuf) {
415 printk(PRINT_PREF "error: cannot allocate memory\n"); 415 pr_info("error: cannot allocate memory\n");
416 goto out; 416 goto out;
417 } 417 }
418 readbuf = kmalloc(bufsize, GFP_KERNEL); 418 readbuf = kmalloc(bufsize, GFP_KERNEL);
419 if (!readbuf) { 419 if (!readbuf) {
420 printk(PRINT_PREF "error: cannot allocate memory\n"); 420 pr_info("error: cannot allocate memory\n");
421 goto out; 421 goto out;
422 } 422 }
423 423
@@ -429,7 +429,7 @@ static int __init mtd_subpagetest_init(void)
429 if (err) 429 if (err)
430 goto out; 430 goto out;
431 431
432 printk(PRINT_PREF "writing whole device\n"); 432 pr_info("writing whole device\n");
433 simple_srand(1); 433 simple_srand(1);
434 for (i = 0; i < ebcnt; ++i) { 434 for (i = 0; i < ebcnt; ++i) {
435 if (bbt[i]) 435 if (bbt[i])
@@ -438,13 +438,13 @@ static int __init mtd_subpagetest_init(void)
438 if (unlikely(err)) 438 if (unlikely(err))
439 goto out; 439 goto out;
440 if (i % 256 == 0) 440 if (i % 256 == 0)
441 printk(PRINT_PREF "written up to eraseblock %u\n", i); 441 pr_info("written up to eraseblock %u\n", i);
442 cond_resched(); 442 cond_resched();
443 } 443 }
444 printk(PRINT_PREF "written %u eraseblocks\n", i); 444 pr_info("written %u eraseblocks\n", i);
445 445
446 simple_srand(1); 446 simple_srand(1);
447 printk(PRINT_PREF "verifying all eraseblocks\n"); 447 pr_info("verifying all eraseblocks\n");
448 for (i = 0; i < ebcnt; ++i) { 448 for (i = 0; i < ebcnt; ++i) {
449 if (bbt[i]) 449 if (bbt[i])
450 continue; 450 continue;
@@ -452,10 +452,10 @@ static int __init mtd_subpagetest_init(void)
452 if (unlikely(err)) 452 if (unlikely(err))
453 goto out; 453 goto out;
454 if (i % 256 == 0) 454 if (i % 256 == 0)
455 printk(PRINT_PREF "verified up to eraseblock %u\n", i); 455 pr_info("verified up to eraseblock %u\n", i);
456 cond_resched(); 456 cond_resched();
457 } 457 }
458 printk(PRINT_PREF "verified %u eraseblocks\n", i); 458 pr_info("verified %u eraseblocks\n", i);
459 459
460 err = erase_whole_device(); 460 err = erase_whole_device();
461 if (err) 461 if (err)
@@ -467,7 +467,7 @@ static int __init mtd_subpagetest_init(void)
467 467
468 /* Write all eraseblocks */ 468 /* Write all eraseblocks */
469 simple_srand(3); 469 simple_srand(3);
470 printk(PRINT_PREF "writing whole device\n"); 470 pr_info("writing whole device\n");
471 for (i = 0; i < ebcnt; ++i) { 471 for (i = 0; i < ebcnt; ++i) {
472 if (bbt[i]) 472 if (bbt[i])
473 continue; 473 continue;
@@ -475,14 +475,14 @@ static int __init mtd_subpagetest_init(void)
475 if (unlikely(err)) 475 if (unlikely(err))
476 goto out; 476 goto out;
477 if (i % 256 == 0) 477 if (i % 256 == 0)
478 printk(PRINT_PREF "written up to eraseblock %u\n", i); 478 pr_info("written up to eraseblock %u\n", i);
479 cond_resched(); 479 cond_resched();
480 } 480 }
481 printk(PRINT_PREF "written %u eraseblocks\n", i); 481 pr_info("written %u eraseblocks\n", i);
482 482
483 /* Check all eraseblocks */ 483 /* Check all eraseblocks */
484 simple_srand(3); 484 simple_srand(3);
485 printk(PRINT_PREF "verifying all eraseblocks\n"); 485 pr_info("verifying all eraseblocks\n");
486 for (i = 0; i < ebcnt; ++i) { 486 for (i = 0; i < ebcnt; ++i) {
487 if (bbt[i]) 487 if (bbt[i])
488 continue; 488 continue;
@@ -490,10 +490,10 @@ static int __init mtd_subpagetest_init(void)
490 if (unlikely(err)) 490 if (unlikely(err))
491 goto out; 491 goto out;
492 if (i % 256 == 0) 492 if (i % 256 == 0)
493 printk(PRINT_PREF "verified up to eraseblock %u\n", i); 493 pr_info("verified up to eraseblock %u\n", i);
494 cond_resched(); 494 cond_resched();
495 } 495 }
496 printk(PRINT_PREF "verified %u eraseblocks\n", i); 496 pr_info("verified %u eraseblocks\n", i);
497 497
498 err = erase_whole_device(); 498 err = erase_whole_device();
499 if (err) 499 if (err)
@@ -503,7 +503,7 @@ static int __init mtd_subpagetest_init(void)
503 if (err) 503 if (err)
504 goto out; 504 goto out;
505 505
506 printk(PRINT_PREF "finished with %d errors\n", errcnt); 506 pr_info("finished with %d errors\n", errcnt);
507 507
508out: 508out:
509 kfree(bbt); 509 kfree(bbt);
@@ -511,7 +511,7 @@ out:
511 kfree(writebuf); 511 kfree(writebuf);
512 put_mtd_device(mtd); 512 put_mtd_device(mtd);
513 if (err) 513 if (err)
514 printk(PRINT_PREF "error %d occurred\n", err); 514 pr_info("error %d occurred\n", err);
515 printk(KERN_INFO "=================================================\n"); 515 printk(KERN_INFO "=================================================\n");
516 return err; 516 return err;
517} 517}