locking: ignore parenthesis
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 12 Mar 2013 18:12:31 +0000 (12 21:12 +0300)
committerDan Carpenter <dan.carpenter@oracle.com>
Tue, 12 Mar 2013 18:12:31 +0000 (12 21:12 +0300)
Smatch used to get confused and think that:
mutex_lock(&(foo));
was different from:
mutex_lock(&foo);

This is easy to solve by just ignoring all the parenthesis.

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

index d8d7184..f7aef22 100644 (file)
@@ -343,8 +343,8 @@ static char *make_full_name(const char *lock, const char *var)
 {
        static char tmp_buf[512];
 
-       snprintf(tmp_buf, 512, "%s:%s", lock, var);
-       tmp_buf[511] = '\0';
+       snprintf(tmp_buf, sizeof(tmp_buf), "%s:%s", lock, var);
+       remove_parens(tmp_buf);
        return alloc_string(tmp_buf);
 }