On Mon, 27 Feb 2012, Arie Middelkoop wrote:

On 27-02-12 18:07, ron minnich wrote:
I have a use for coccinelle that I have not seen described. I need to
"filter" out a set of functions from a linux driver, so as to create a
standalone driver to be run from user mode.

Here's an example, from drivers/gpu/drm/i915/intel_bios.c: I'd like to
run a coccinelle spatch that would 'extract' the function
intel_setup_bios

I assume that you want to obtain all the code that is reachable from the "intel_setup_bios" function. You also seem to suggest that you want to apply transformations that will reduce these dependencies? E.g. when you eliminate a function call, it may very well turn out that you don't need the callee anymore. Is that correct?

If you do want what Arie is talking about, you can use iteration. You can see an example in demos/iteration.cocci

julia
_______________________________________________
Cocci mailing list
[email protected]
http://lists.diku.dk/mailman/listinfo/cocci
(Web access from inside DIKUs LAN only)

Reply via email to