Quoting Stephen Boyd (2015-02-02 14:35:59)I have found these three cases using Coccinnelle in the mach-omap2
On 02/02/15 13:31, Julia Lawall wrote:Ack. Is there precedent for a "Don't do that" kind of response?
On Mon, 2 Feb 2015, Stephen Boyd wrote:I'm not sure how to fix this case with parent_index values generically.
Julia,Comparing or dereferencing pointers of a particular type should be
Is there a way we can write a coccinelle script to check for this? The
goal being to find all drivers that are comparing struct clk pointers or
attempting to dereference them. There are probably other frameworks that
could use the same type of check (regulator, gpiod, reset, pwm, etc.).
Probably anything that has a get/put API.
straightforward to check for. Is there an example of how to use the
parent_index value to fix the problem?
I imagine it would be highly specific to the surrounding code to the
point where we couldn't fix it automatically. For example, if it's a clk
consumer (not provider like in this case) using an index wouldn't be the
right fix. We would need some sort of clk API that we don't currently
have and I would wonder why clock consumers even care to compare such
pointers in the first place.
Regards,
Mike
--_______________________________________________
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
Cocci mailing list
Cocci@xxxxxxxxxxxxxxx
https://systeme.lip6.fr/mailman/listinfo/cocci