locking: fix build problem
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 15 Mar 2013 14:50:10 +0000 (15 17:50 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Fri, 15 Mar 2013 14:50:10 +0000 (15 17:50 +0300)
I forgot to commit the remove_parens() function.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
smatch.h
smatch_helper.c

index 100a302..e1f2ed5 100644 (file)
--- a/smatch.h
+++ b/smatch.h
@@ -229,6 +229,7 @@ int is_reachable(void);
 /* smatch_helper.c */
 char *alloc_string(const char *str);
 void free_string(char *str);
+void remove_parens(char *str);
 struct smatch_state *alloc_state_num(int num);
 struct expression *get_argument_from_call_expr(struct expression_list *args,
                                               int num);
index ba11ab3..0aad17e 100644 (file)
@@ -34,6 +34,21 @@ void free_string(char *str)
        free(str);
 }
 
+void remove_parens(char *str)
+{
+       char *src, *dst;
+
+       dst = src = str;
+       while (*src != '\0') {
+               if (*src == '(' || *src == ')') {
+                       src++;
+                       continue;
+               }
+               *dst++ = *src++;
+       }
+       *dst = *src;
+}
+
 struct smatch_state *alloc_state_num(int num)
 {
        struct smatch_state *state;