On Fri, Mar 15, 2024 at 01:46:29PM +0300, Dan Carpenter wrote:
> I started writing this code, but I ran into an issue where:
>
> lock = gen_expression_from_key(arg, key);
>
> doesnt' work. The arg is "&icom_port->uart_port" and the key is
> "&$->lock". The check_locking.c code does this as strings, but I want
> to do this as expressions... Anyway, here's the code that I have so
> far.
Actually instead of fixing gen_expression_from_key() what I could do is:
var = get_variable_from_key(arg, key, &sym);
lock = gen_expression_from_name_sym(var, sym);
It's slightly immoral to work around bugs instead of fixing them but it
has the advantage of being much faster.
I think the check will work now. I left out a bunch of stuff in the
code I sent. The changes to smatch.h, the Makefile and check_list.h.
But I'll test this code out and resend.
regards,
dan carpenter