)]}'
{"src/jtag/drivers/stlink_usb.c":[{"author":{"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},"change_message_id":"58f27bf6db144c48bb483f0759d7691836c35eda","unresolved":true,"context_lines":[{"line_number":2715,"context_line":"\th_u24_to_le(h-\u003ecmdbuf + h-\u003ecmdidx, csw \u003e\u003e 8);"},{"line_number":2716,"context_line":"\th-\u003ecmdidx +\u003d 3;"},{"line_number":2717,"context_line":""},{"line_number":2718,"context_line":"\tint retval \u003d stlink_usb_xfer_noerrcheck(handle, h-\u003edatabuf, len);"},{"line_number":2719,"context_line":"\tif (retval !\u003d ERROR_OK)"},{"line_number":2720,"context_line":"\t\treturn retval;"},{"line_number":2721,"context_line":""},{"line_number":2722,"context_line":"\tmemcpy(buffer, h-\u003edatabuf, len);"},{"line_number":2723,"context_line":""},{"line_number":2724,"context_line":"\treturn stlink_usb_get_rw_status(handle);"},{"line_number":2725,"context_line":"}"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"692d8e38_21a70f53","line":2722,"range":{"start_line":2718,"start_character":1,"end_line":2722,"end_character":33},"updated":"2021-11-01 09:25:49.000000000","message":"just nitpicking, I know it like that in almost all stlink read functions.\nI\u0027m just wondering why we cannot do the following, and avoid memcpy ...\n\nint retval \u003d stlink_usb_xfer_noerrcheck(handle, buffer, len);\nif (retval !\u003d ERROR_OK)\n\treturn retval;","commit_id":"a86aa2ab5cb81688c4046c24767d3c27d32f9157"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"5a7a5105623e8e3df096c80baa3066083ba9c308","unresolved":true,"context_lines":[{"line_number":2715,"context_line":"\th_u24_to_le(h-\u003ecmdbuf + h-\u003ecmdidx, csw \u003e\u003e 8);"},{"line_number":2716,"context_line":"\th-\u003ecmdidx +\u003d 3;"},{"line_number":2717,"context_line":""},{"line_number":2718,"context_line":"\tint retval \u003d stlink_usb_xfer_noerrcheck(handle, h-\u003edatabuf, len);"},{"line_number":2719,"context_line":"\tif (retval !\u003d ERROR_OK)"},{"line_number":2720,"context_line":"\t\treturn retval;"},{"line_number":2721,"context_line":""},{"line_number":2722,"context_line":"\tmemcpy(buffer, h-\u003edatabuf, len);"},{"line_number":2723,"context_line":""},{"line_number":2724,"context_line":"\treturn stlink_usb_get_rw_status(handle);"},{"line_number":2725,"context_line":"}"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"41371579_eadb61d7","line":2722,"range":{"start_line":2718,"start_character":1,"end_line":2722,"end_character":33},"in_reply_to":"692d8e38_21a70f53","updated":"2021-11-01 11:36:22.000000000","message":"I have not investigated if these copies can be removed or simplified in current code.\n\nMy plan is instead to:\n1) extract and generalize the queue mechanism that is in JTAG code so it can be reused out of JTAG, e.g. CMSIS-DAP driver, this series for STLINK, queuing in SWD multidrop, ...\n2) apply the queue above in place of the silly queue of this series\n3) re-apply another queue for libusb multiple transaction, an extension of http://review.openocd.org/4484\n\nThe last step will require the callback to copy the received data.\nMaybe this copy here can be reused in the queue context, otherwise that would be the right moment to drop it.","commit_id":"a86aa2ab5cb81688c4046c24767d3c27d32f9157"}]}
