From 87e1db881a8f3e8e8a520fc107ca276e6066c277 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Sat, 16 Jun 2012 16:45:01 +0300 Subject: [PATCH] sm_buf: don't return the maximum store buffer size I have turned this off for now. Eventually I think I want to have the checks call get_buffer_size_max() if that's what they want. But for now, I've just turned it off. Signed-off-by: Dan Carpenter --- smatch_buf_size.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/smatch_buf_size.c b/smatch_buf_size.c index 7137206d..24639c75 100644 --- a/smatch_buf_size.c +++ b/smatch_buf_size.c @@ -176,19 +176,12 @@ static int get_size_from_initializer(struct expression *expr) static int get_stored_size_bytes(struct expression *expr) { - struct sm_state *sm, *tmp; - int max = 0; + struct smatch_state *state; - sm = get_sm_state_expr(my_size_id, expr); - if (!sm) + state = get_state_expr(my_size_id, expr); + if (!state) return 0; - - FOR_EACH_PTR(sm->possible, tmp) { - if (PTR_INT(tmp->state->data) > max) - max = PTR_INT(tmp->state->data); - } END_FOR_EACH_PTR(tmp); - - return max; + return PTR_INT(state->data); } static struct expression *get_pointer_expression(struct expression *expr) -- 2.11.4.GIT