Deleted Added
full compact
nandsim_cfgparse.c (249744) nandsim_cfgparse.c (289677)
1/*-
2 * Copyright (C) 2009-2012 Semihalf
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (C) 2009-2012 Semihalf
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/usr.sbin/nandsim/nandsim_cfgparse.c 249744 2013-04-21 22:47:24Z ed $");
28__FBSDID("$FreeBSD: head/usr.sbin/nandsim/nandsim_cfgparse.c 289677 2015-10-21 05:37:09Z eadler $");
29
30#include <sys/errno.h>
31#include <sys/ioctl.h>
32#include <sys/types.h>
33
34#include <dev/nand/nandsim.h>
35
36#include <ctype.h>

--- 307 unchanged lines hidden (view full) ---

344 }
345
346 for (i = 0; i < count; i++) {
347 bzero((void *)&ctrl_conf, sizeof(ctrl_conf));
348
349 /*
350 * ECC layout have to end up with 0xffff, so
351 * we're filling buffer with 0xff. If ecc_layout is
29
30#include <sys/errno.h>
31#include <sys/ioctl.h>
32#include <sys/types.h>
33
34#include <dev/nand/nandsim.h>
35
36#include <ctype.h>

--- 307 unchanged lines hidden (view full) ---

344 }
345
346 for (i = 0; i < count; i++) {
347 bzero((void *)&ctrl_conf, sizeof(ctrl_conf));
348
349 /*
350 * ECC layout have to end up with 0xffff, so
351 * we're filling buffer with 0xff. If ecc_layout is
352 * defined in config file, values will be overriden.
352 * defined in config file, values will be overridden.
353 */
354 memset((void *)&ctrl_conf.ecc_layout, 0xff,
355 sizeof(ctrl_conf.ecc_layout));
356
357 if (validate_section_config(f, "ctrl", i) != 0) {
358 free(ctrlsptr);
359 return (EINVAL);
360 }

--- 45 unchanged lines hidden (view full) ---

406 }
407
408 for (i = 0; i < count; i++) {
409 bzero((void *)&chip_conf, sizeof(chip_conf));
410
411 /*
412 * Bad block map have to end up with 0xffff, so
413 * we're filling array with 0xff. If bad block map is
353 */
354 memset((void *)&ctrl_conf.ecc_layout, 0xff,
355 sizeof(ctrl_conf.ecc_layout));
356
357 if (validate_section_config(f, "ctrl", i) != 0) {
358 free(ctrlsptr);
359 return (EINVAL);
360 }

--- 45 unchanged lines hidden (view full) ---

406 }
407
408 for (i = 0; i < count; i++) {
409 bzero((void *)&chip_conf, sizeof(chip_conf));
410
411 /*
412 * Bad block map have to end up with 0xffff, so
413 * we're filling array with 0xff. If bad block map is
414 * defined in config file, values will be overriden.
414 * defined in config file, values will be overridden.
415 */
416 memset((void *)&chip_conf.bad_block_map, 0xff,
417 sizeof(chip_conf.bad_block_map));
418
419 if (validate_section_config(f, "chip", i) != 0) {
420 free(chipsptr);
421 return (EINVAL);
422 }

--- 537 unchanged lines hidden ---
415 */
416 memset((void *)&chip_conf.bad_block_map, 0xff,
417 sizeof(chip_conf.bad_block_map));
418
419 if (validate_section_config(f, "chip", i) != 0) {
420 free(chipsptr);
421 return (EINVAL);
422 }

--- 537 unchanged lines hidden ---