)]}'
{"/PATCHSET_LEVEL":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"4762f9b915d1e0fb7c229b5ff7663258da746d1e","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"a8521e10_5c47bf7c","updated":"2024-09-15 09:22:36.000000000","message":"As a confirmed bugfix, let\u0027s merge this quickly.\nThe renaming can wait for few day more","commit_id":"7538deb70bdce9d16295c34e7fc5b62a0a9061b0"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"27e68c7afa374491e6fd8dbfcfb8823ec6ff7b54","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"7a5f070e_2736def0","updated":"2024-09-13 07:37:08.000000000","message":"Good catch, Jessica! Thanks!","commit_id":"7538deb70bdce9d16295c34e7fc5b62a0a9061b0"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"d6b90d343ff15d5b04314c4f4c9838328b7bbbd2","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"6a8d9539_911953a8","updated":"2024-09-13 07:42:23.000000000","message":"Issue present since 2009!\nThanks for the fix.\nWill riscv fork get this patch by merging from upstream?","commit_id":"7538deb70bdce9d16295c34e7fc5b62a0a9061b0"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"84663c46dde1b4cb1af742266d023a5962140aed","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"7f1042b0_4f3d92f2","updated":"2024-09-13 10:01:28.000000000","message":"Thanks a lot for the catch!\n\nOn a side note, don\u0027t you think the function is a bit misleading?\nWhat I mean is:\n* From the name\u0027s similarity to `strcmp` and `memcmp`one can assume the function return type is `int` and it returns `0` for equal buffers.\n* However, the function returns `bool`. So it obviously only checks for equality and does not distinguish between less and greater, unlike `*cmp` functions mentioned before.\n\nWouldn\u0027t it be better to invert the logic (`true` on equality) and rename `buf_cmp` to `buf_equal` or at least document the current behaviour (`false` on equality) in a separate commit.","commit_id":"7538deb70bdce9d16295c34e7fc5b62a0a9061b0"},{"author":{"_account_id":1002319,"name":"Jessica Clarke","email":"jrtc27@jrtc27.com","username":"jrtc27"},"change_message_id":"7809c96cb495bf752893f98bca66c0df27268236","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"a4bb77ac_69eec969","in_reply_to":"2785f362_2d2f58af","updated":"2024-09-13 16:51:06.000000000","message":"I\u0027d say it\u0027s not worth changing the return value if you don\u0027t also rename them, since the name is rather ambiguous as to what the return value means (even if true for same feels more natural/intuitive), and it does carry a small risk for downstreams that don\u0027t notice the changed semantics. But I think it makes a lot of sense to invert and rename them to buf_eq(ual) or similar. I can add a follow-up to do so if nobody else is working on it.","commit_id":"7538deb70bdce9d16295c34e7fc5b62a0a9061b0"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"60703a3eb615720e2963d7c325f9692de8c40d4e","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"2785f362_2d2f58af","in_reply_to":"55d7f9bc_94567ea5","updated":"2024-09-13 10:32:49.000000000","message":"\u003e But is it worth to change in all callers?\n\nFWIW, there are 4 uses of `buf_cmp*` functions in `helper/binarybuffer.c` itself, two more in `jtag/core.c` and one in `svf/svf.c`. Seems like a patch should be small enough.\n```\n\u003e git grep -PC1 \u0027(?\u003c!bool )buf_cmp\u0027\nsrc/helper/binarybuffer.c-      uint8_t mask \u003d (1 \u003c\u003c trailing) - 1;\nsrc/helper/binarybuffer.c:      return buf_cmp_masked(a, b, mask \u0026 m);\nsrc/helper/binarybuffer.c-}\n--\nsrc/helper/binarybuffer.c-      const uint8_t *buf1 \u003d _buf1, *buf2 \u003d _buf2;\nsrc/helper/binarybuffer.c:      return buf_cmp_trailing(buf1[last], buf2[last], 0xff, trailing);\nsrc/helper/binarybuffer.c-}\n--\nsrc/helper/binarybuffer.c-      for (unsigned i \u003d 0; i \u003c last; i++) {\nsrc/helper/binarybuffer.c:              if (buf_cmp_masked(buf1[i], buf2[i], mask[i]))\nsrc/helper/binarybuffer.c-                      return true;\n--\nsrc/helper/binarybuffer.c-              return false;\nsrc/helper/binarybuffer.c:      return buf_cmp_trailing(buf1[last], buf2[last], mask[last], trailing);\nsrc/helper/binarybuffer.c-}\n--\nsrc/jtag/core.c-        if (in_check_mask)\nsrc/jtag/core.c:                compare_failed \u003d buf_cmp_mask(captured, in_check_value, in_check_mask, num_bits);\nsrc/jtag/core.c-        else\nsrc/jtag/core.c:                compare_failed \u003d buf_cmp(captured, in_check_value, num_bits);\nsrc/jtag/core.c-\n--\nsrc/svf/svf.c-          if ((svf_check_tdo_para[i].enabled)\nsrc/svf/svf.c:                          \u0026\u0026 buf_cmp_mask(\u0026svf_tdi_buffer[index_var], \u0026svf_tdo_buffer[index_var],\nsrc/svf/svf.c-                          \u0026svf_mask_buffer[index_var], len)) {\n```","commit_id":"7538deb70bdce9d16295c34e7fc5b62a0a9061b0"},{"author":{"_account_id":1002047,"name":"Evgeniy Naydanov","email":"eugnay@gmail.com","username":"en-sc"},"change_message_id":"84663c46dde1b4cb1af742266d023a5962140aed","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"54790763_4a922d63","in_reply_to":"6a8d9539_911953a8","updated":"2024-09-13 10:01:28.000000000","message":"\u003e Will riscv fork get this patch by merging from upstream?\n\nYes, that is probably the way.\nThough it will take 2+ days (and probably more considering the upcoming weekend).\n\nIn the meantime I\u0027ve created an announcement in RISC-V fork that informs about the issue:\nhttps://github.com/riscv-collab/riscv-openocd/discussions/1131","commit_id":"7538deb70bdce9d16295c34e7fc5b62a0a9061b0"},{"author":{"_account_id":1002161,"name":"Anatoly P","email":"kupokupokupopo@gmail.com","username":"ecco_the_dolphin"},"change_message_id":"6195d5d38ec581576c7af8107e0496148e956d8d","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":1,"id":"6f4e372d_40280eaf","in_reply_to":"6a8d9539_911953a8","updated":"2024-09-13 09:22:23.000000000","message":"it will)","commit_id":"7538deb70bdce9d16295c34e7fc5b62a0a9061b0"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"effcc6cedf1b67001930bd4cdfda4b3facd46a9f","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"55d7f9bc_94567ea5","in_reply_to":"7f1042b0_4f3d92f2","updated":"2024-09-13 10:13:27.000000000","message":"Yup I feel the same. Might be also the reason why the bug was made in 2009. But is it worth to change in all callers?\nAt least a follow up patch should add a Doxigen doc for the function.","commit_id":"7538deb70bdce9d16295c34e7fc5b62a0a9061b0"},{"author":{"_account_id":1002319,"name":"Jessica Clarke","email":"jrtc27@jrtc27.com","username":"jrtc27"},"change_message_id":"f7d4ba62b7b3ab778883519752a10041b7468eb3","unresolved":true,"context_lines":[],"source_content_type":"","patch_set":1,"id":"d54e9ead_8474e22c","in_reply_to":"a4bb77ac_69eec969","updated":"2024-09-13 17:11:55.000000000","message":"https://review.openocd.org/c/openocd/+/8490","commit_id":"7538deb70bdce9d16295c34e7fc5b62a0a9061b0"}]}
