perf metric: Change expr__get_id to return struct expr_id_data
[linux-2.6-microblaze.git] / tools / perf / util / expr.c
index 9228f60..4e5a653 100644 (file)
@@ -73,14 +73,10 @@ int expr__add_id_val(struct expr_parse_ctx *ctx, const char *id, double val)
        return ret;
 }
 
-int expr__get_id(struct expr_parse_ctx *ctx, const char *id, double *val_ptr)
+int expr__get_id(struct expr_parse_ctx *ctx, const char *id,
+                struct expr_id_data **data)
 {
-       struct expr_id_data *data;
-
-       if (!hashmap__find(&ctx->ids, id, (void **)&data))
-               return -1;
-       *val_ptr = (data == NULL) ?  0.0 : data->val;
-       return 0;
+       return hashmap__find(&ctx->ids, id, (void **)data) ? 0 : -1;
 }
 
 void expr__ctx_init(struct expr_parse_ctx *ctx)