From patchwork Sat Jul 2 05:10:36 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnaud Lacombe X-Patchwork-Id: 940102 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.4) with ESMTP id p625AnE6006738 for ; Sat, 2 Jul 2011 05:10:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750967Ab1GBFKt (ORCPT ); Sat, 2 Jul 2011 01:10:49 -0400 Received: from mail-iw0-f174.google.com ([209.85.214.174]:35815 "EHLO mail-iw0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750899Ab1GBFKt (ORCPT ); Sat, 2 Jul 2011 01:10:49 -0400 Received: by mail-iw0-f174.google.com with SMTP id 6so3288158iwn.19 for ; Fri, 01 Jul 2011 22:10:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=I+zlClDGOY96u7MQSGxm+MdpucB6/C8Lr/kf7lreh2M=; b=R5rBIwdPgjZECv1QQRax0e0jKFq7KS/GAi15qBmkfVPUBR3NCi+yLAOXaoT44NjJ3z eZhL2MOZQBI16jFm1fnOC+fVVoBrz70tFuMroLPKnoCtz4j1XEL2I4+eg937WycrCNFK mEQ9/OZbaYlx4ljkv93EwXIP/4WWBEL9/j/6k= Received: by 10.42.155.202 with SMTP id v10mr4189235icw.488.1309583448948; Fri, 01 Jul 2011 22:10:48 -0700 (PDT) Received: from localhost.localdomain (69-165-144-226.dsl.teksavvy.com [69.165.144.226]) by mx.google.com with ESMTPS id a9sm1507011icy.6.2011.07.01.22.10.47 (version=SSLv3 cipher=OTHER); Fri, 01 Jul 2011 22:10:48 -0700 (PDT) From: Arnaud Lacombe To: linux-kbuild@vger.kernel.org, Michal Marek Cc: Arnaud Lacombe Subject: [PATCH 1/5] kconfig: use calloc() for expr allocation Date: Sat, 2 Jul 2011 01:10:36 -0400 Message-Id: <1309583440-4795-2-git-send-email-lacombar@gmail.com> X-Mailer: git-send-email 1.7.3.4.574.g608b.dirty In-Reply-To: <1309583440-4795-1-git-send-email-lacombar@gmail.com> References: <1307386711-8866-1-git-send-email-lacombar@gmail.com> <1309583440-4795-1-git-send-email-lacombar@gmail.com> Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Sat, 02 Jul 2011 05:10:50 +0000 (UTC) Signed-off-by: Arnaud Lacombe --- scripts/kconfig/expr.c | 12 ++++-------- 1 files changed, 4 insertions(+), 8 deletions(-) diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c index 792c62e..290ce41 100644 --- a/scripts/kconfig/expr.c +++ b/scripts/kconfig/expr.c @@ -13,8 +13,7 @@ struct expr *expr_alloc_symbol(struct symbol *sym) { - struct expr *e = malloc(sizeof(*e)); - memset(e, 0, sizeof(*e)); + struct expr *e = calloc(1, sizeof(*e)); e->type = E_SYMBOL; e->left.sym = sym; return e; @@ -22,8 +21,7 @@ struct expr *expr_alloc_symbol(struct symbol *sym) struct expr *expr_alloc_one(enum expr_type type, struct expr *ce) { - struct expr *e = malloc(sizeof(*e)); - memset(e, 0, sizeof(*e)); + struct expr *e = calloc(1, sizeof(*e)); e->type = type; e->left.expr = ce; return e; @@ -31,8 +29,7 @@ struct expr *expr_alloc_one(enum expr_type type, struct expr *ce) struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e2) { - struct expr *e = malloc(sizeof(*e)); - memset(e, 0, sizeof(*e)); + struct expr *e = calloc(1, sizeof(*e)); e->type = type; e->left.expr = e1; e->right.expr = e2; @@ -41,8 +38,7 @@ struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e struct expr *expr_alloc_comp(enum expr_type type, struct symbol *s1, struct symbol *s2) { - struct expr *e = malloc(sizeof(*e)); - memset(e, 0, sizeof(*e)); + struct expr *e = calloc(1, sizeof(*e)); e->type = type; e->left.sym = s1; e->right.sym = s2;