aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/expr.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2011-09-15 09:08:05 -0400
committerJiri Kosina <jkosina@suse.cz>2011-09-15 09:08:18 -0400
commite060c38434b2caa78efe7cedaff4191040b65a15 (patch)
tree407361230bf6733f63d8e788e4b5e6566ee04818 /scripts/kconfig/expr.c
parent10e4ac572eeffe5317019bd7330b6058a400dfc2 (diff)
parentcc39c6a9bbdebfcf1a7dee64d83bf302bc38d941 (diff)
Merge branch 'master' into for-next
Fast-forward merge with Linus to be able to merge patches based on more recent version of the tree.
Diffstat (limited to 'scripts/kconfig/expr.c')
-rw-r--r--scripts/kconfig/expr.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c
index 001003452f68..290ce41f8ba4 100644
--- a/scripts/kconfig/expr.c
+++ b/scripts/kconfig/expr.c
@@ -7,15 +7,13 @@
7#include <stdlib.h> 7#include <stdlib.h>
8#include <string.h> 8#include <string.h>
9 9
10#define LKC_DIRECT_LINK
11#include "lkc.h" 10#include "lkc.h"
12 11
13#define DEBUG_EXPR 0 12#define DEBUG_EXPR 0
14 13
15struct expr *expr_alloc_symbol(struct symbol *sym) 14struct expr *expr_alloc_symbol(struct symbol *sym)
16{ 15{
17 struct expr *e = malloc(sizeof(*e)); 16 struct expr *e = calloc(1, sizeof(*e));
18 memset(e, 0, sizeof(*e));
19 e->type = E_SYMBOL; 17 e->type = E_SYMBOL;
20 e->left.sym = sym; 18 e->left.sym = sym;
21 return e; 19 return e;
@@ -23,8 +21,7 @@ struct expr *expr_alloc_symbol(struct symbol *sym)
23 21
24struct expr *expr_alloc_one(enum expr_type type, struct expr *ce) 22struct expr *expr_alloc_one(enum expr_type type, struct expr *ce)
25{ 23{
26 struct expr *e = malloc(sizeof(*e)); 24 struct expr *e = calloc(1, sizeof(*e));
27 memset(e, 0, sizeof(*e));
28 e->type = type; 25 e->type = type;
29 e->left.expr = ce; 26 e->left.expr = ce;
30 return e; 27 return e;
@@ -32,8 +29,7 @@ struct expr *expr_alloc_one(enum expr_type type, struct expr *ce)
32 29
33struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e2) 30struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e2)
34{ 31{
35 struct expr *e = malloc(sizeof(*e)); 32 struct expr *e = calloc(1, sizeof(*e));
36 memset(e, 0, sizeof(*e));
37 e->type = type; 33 e->type = type;
38 e->left.expr = e1; 34 e->left.expr = e1;
39 e->right.expr = e2; 35 e->right.expr = e2;
@@ -42,8 +38,7 @@ struct expr *expr_alloc_two(enum expr_type type, struct expr *e1, struct expr *e
42 38
43struct expr *expr_alloc_comp(enum expr_type type, struct symbol *s1, struct symbol *s2) 39struct expr *expr_alloc_comp(enum expr_type type, struct symbol *s1, struct symbol *s2)
44{ 40{
45 struct expr *e = malloc(sizeof(*e)); 41 struct expr *e = calloc(1, sizeof(*e));
46 memset(e, 0, sizeof(*e));
47 e->type = type; 42 e->type = type;
48 e->left.sym = s1; 43 e->left.sym = s1;
49 e->right.sym = s2; 44 e->right.sym = s2;