On Fri, Oct 12, 2018 at 5:24 PM Timur Tabi <[email protected]> wrote:>
I think now that my script is perfect.  Thanks again.

Looks like I spoke too soon.  It's modifying lines that are already
NV_PRINTF(), despite all the "depends on" that I have.  I want
Coccinelle to ignore any lines in the C file that are already
NV_PRINTF and just modify lines that are DBG_PRINTF.  But when I add
an NV_PRINTF() line to test.c, I get this:

-        DBG_PRINTF((DBG_MODULE_OS, DBG_LEVEL_ERRORS,
-                    "NVRM: %s: this is a test \
-                    of multiline " NvP64_fmt " strings %p\n",
-                    __FUNCTION__,
-                    p1,
-                    p2));
+        NV_PRINTF(LEVEL_ERROR,
+                  "this is a test of multiline " NvP64_fmt " strings %p\n",
+                  p1, p2);


-        NV_PRINTF(LEVEL_INFO, "%s\n", __FUNCTION__);
+        NV_PRINTF(LEVEL_INFO, "\n");

That second diff should not be there.

Looking at the output of --debug, I see it go through all the rules
and tell me what dependencies are satisfied, but it only does it once.
I would expect Coccinelle to re-evaluate all the rules for every line
of code it sees.  My script used to do that, so I broke it somehow.
_______________________________________________
Cocci mailing list
[email protected]
https://systeme.lip6.fr/mailman/listinfo/cocci

Reply via email to