{"thread":{"id":"44406","subject":"[PATCH RESEND] cocci: avoid self-references in object_id transformations","startedAt":"2016-11-01T08:49:49Z","lastAt":"2016-11-01T08:49:49Z","messageCount":1,"participants":["René Scharfe"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"305222","messageId":"3d93136a-2cf4-de0a-e19f-b51cad1b40ec@web.de","threadId":"44406","inReplyTo":null,"subject":"[PATCH RESEND] cocci: avoid self-references in object_id transformations","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2016-11-01T08:49:12Z","receivedAt":"2016-11-01T08:49:49Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"The object_id functions oid_to_hex, oid_to_hex_r, oidclr, oidcmp, and\noidcpy are defined as wrappers of their legacy counterparts sha1_to_hex,\nsha1_to_hex_r, hashclr, hashcmp, and hashcpy, respectively.  Make sure\nthat the Coccinelle transformations for converting legacy function calls\nare not applied to these wrappers themselves, which would result in\ntautological declarations.\n\nSigned-off-by: Rene Scharfe <l.s.r@web.de>\n---\n contrib/coccinelle/object_id.cocci | 15 +++++++++++++++\n 1 file changed, 15 insertions(+)\n\ndiff --git a/contrib/coccinelle/object_id.cocci b/contrib/coccinelle/object_id.cocci\nindex 0307624..09afdbf 100644\n--- a/contrib/coccinelle/object_id.cocci\n+++ b/contrib/coccinelle/object_id.cocci\n@@ -17,10 +17,13 @@ expression E1;\n + oid_to_hex(&E1)\n \n @@\n+identifier f != oid_to_hex;\n expression E1;\n @@\n+  f(...) {...\n - sha1_to_hex(E1->hash)\n + oid_to_hex(E1)\n+  ...}\n \n @@\n expression E1, E2;\n@@ -29,10 +32,13 @@ expression E1, E2;\n + oid_to_hex_r(E1, &E2)\n \n @@\n+identifier f != oid_to_hex_r;\n expression E1, E2;\n @@\n+   f(...) {...\n - sha1_to_hex_r(E1, E2->hash)\n + oid_to_hex_r(E1, E2)\n+  ...}\n \n @@\n expression E1;\n@@ -41,10 +47,13 @@ expression E1;\n + oidclr(&E1)\n \n @@\n+identifier f != oidclr;\n expression E1;\n @@\n+  f(...) {...\n - hashclr(E1->hash)\n + oidclr(E1)\n+  ...}\n \n @@\n expression E1, E2;\n@@ -53,10 +62,13 @@ expression E1, E2;\n + oidcmp(&E1, &E2)\n \n @@\n+identifier f != oidcmp;\n expression E1, E2;\n @@\n+  f(...) {...\n - hashcmp(E1->hash, E2->hash)\n + oidcmp(E1, E2)\n+  ...}\n \n @@\n expression E1, E2;\n@@ -77,10 +89,13 @@ expression E1, E2;\n + oidcpy(&E1, &E2)\n \n @@\n+identifier f != oidcpy;\n expression E1, E2;\n @@\n+  f(...) {...\n - hashcpy(E1->hash, E2->hash)\n + oidcpy(E1, E2)\n+  ...}\n \n @@\n expression E1, E2;\n-- \n2.10.2\n\n"}]}