From: Michal Simek Date: Mon, 6 May 2013 14:42:54 +0000 (+0200) Subject: nand: Use calloc instead of malloc X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f6de3797bd737b0265f668532ea84799428f0d46;p=thirdparty%2Fu-boot.git nand: Use calloc instead of malloc Simplify the code. Signed-off-by: Michal Simek --- diff --git a/drivers/mtd/nand/zynq_nand.c b/drivers/mtd/nand/zynq_nand.c index f5fe8656f4f..5054067fe84 100644 --- a/drivers/mtd/nand/zynq_nand.c +++ b/drivers/mtd/nand/zynq_nand.c @@ -1046,8 +1046,7 @@ static int zynq_nand_init(struct nand_chip *nand_chip, int devnum) int ondie_ecc_enabled = 0; int is_16bit_bw; - xnand = malloc(sizeof(struct xnandps_info)); - memset(xnand, 0, sizeof(struct xnandps_info)); + xnand = calloc(1, sizeof(struct xnandps_info)); if (!xnand) { printf("%s: failed to allocate\n", __func__); goto free;