)]}'
{"id":"openocd~master~I42ab8a8018d01f9af43c5ba49f650c3cb5d31dcb","project":"openocd","branch":"master","hashtags":[],"change_id":"I42ab8a8018d01f9af43c5ba49f650c3cb5d31dcb","subject":"flash/nor: improved API of flash_driver.info \u0026 fixed buffer overruns","status":"MERGED","created":"2021-04-23 10:04:54.000000000","updated":"2021-08-05 14:49:36.000000000","submitted":"2021-06-13 18:58:28.000000000","submitter":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"total_comment_count":20,"unresolved_comment_count":0,"has_review_started":true,"submission_id":"6182-1623610708533-0bebc6e2","meta_rev_id":"69e48d65461a20d4fe4f332df92e8d5a79fa60cc","_number":6182,"owner":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"actions":{},"labels":{"Verified":{"approved":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"all":[{"value":0,"date":"2021-06-13 18:58:28.000000000","_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},{"value":0,"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},{"value":0,"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},{"value":1,"date":"2021-06-13 18:58:28.000000000","permitted_voting_range":{"min":1,"max":1},"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]}],"values":{"-1":"Fails"," 0":"No score","+1":"Verified"},"description":"","default_value":0},"Code-Review":{"approved":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"all":[{"value":0,"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},{"value":1,"date":"2021-06-13 18:58:28.000000000","permitted_voting_range":{"min":1,"max":2},"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},{"value":2,"date":"2021-06-13 18:58:28.000000000","permitted_voting_range":{"min":2,"max":2},"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},{"value":0,"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]}],"values":{"-2":"This shall not be merged","-1":"I would prefer this is not merged as is"," 0":"No score","+1":"Looks good to me, but someone else must approve","+2":"Looks good to me, approved"},"description":"","default_value":0}},"removable_reviewers":[],"reviewers":{"REVIEWER":[{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"}]},"pending_reviewers":{},"reviewer_updates":[{"updated":"2021-05-28 08:15:59.000000000","updated_by":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"reviewer":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"state":"REVIEWER"},{"updated":"2021-06-07 19:48:55.000000000","updated_by":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"reviewer":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"state":"REVIEWER"},{"updated":"2021-06-13 18:58:28.000000000","updated_by":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"reviewer":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"state":"REVIEWER"}],"messages":[{"id":"9c50db9b487bd8abaa41b6dc6ab7c5bbefc6390b","author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"real_author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"date":"2021-04-23 10:04:54.000000000","message":"Uploaded patch set 1.","accounts_in_message":[],"_revision_number":1},{"id":"0a3ab2de59dbec2c8ad4450358f15cc5e6539b6e","author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"real_author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"date":"2021-04-23 10:07:01.000000000","message":"Uploaded patch set 2: Commit message was updated.","accounts_in_message":[],"_revision_number":2},{"id":"fdd6379d53acb919608e05f79ff0611e55a38074","author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"real_author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"date":"2021-04-23 10:07:03.000000000","message":"Patch Set 1: Verified-1\n\nBuild Failed \n\nhttp://build.openocd.org/job/openocd-gerrit/14410/ : ABORTED\n\nhttp://build.openocd.org/job/openocd-gerrit-build/13664/ : ABORTED","accounts_in_message":[],"_revision_number":1},{"id":"b13bc630eff56eeb1f36ce43990477326a3dbbd5","author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"real_author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"date":"2021-04-23 10:38:10.000000000","message":"Patch Set 2: Verified+1\n\nBuild Successful \n\nhttp://build.openocd.org/job/openocd-gerrit/14411/ : SUCCESS\n\nhttp://build.openocd.org/job/openocd-gerrit-build/13665/ : SUCCESS","accounts_in_message":[],"_revision_number":2},{"id":"95b912e64069030b9f61a1e044b74e44ba56cd9f","author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"real_author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"date":"2021-04-24 06:20:59.000000000","message":"Patch Set 2:\n\nIf you\u0027re touching almost all drivers code, would be better to use alloc_printf() instead of the fixed buffer for info text?","accounts_in_message":[],"_revision_number":2},{"id":"7f0c1a4c9065170314b1b9ba0110f1326823dd6d","author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"real_author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"date":"2021-04-24 13:33:40.000000000","message":"Patch Set 2:\n\n\u003e If you\u0027re touching almost all drivers code, would be better to use\n \u003e alloc_printf() instead of the fixed buffer for info text?\n\nTomas, thank you for the suggestion.\n\nI\u0027d like keep the changes to minimum, because:\n\n- The change to printf_alloc() is not straightforward in some of the flash drivers, especially those that concatenate the resulting info output from multiple snprintf() calls.\n- I do not have all the flash memories around to test the results.\n- The amount time I am able work on OpenOCD is limited.\n\nPlease, consider the merge request as is, since it addresses the existing buffer issues and is an improvement over the current state.","accounts_in_message":[],"_revision_number":2},{"id":"cb339aa2c27aa52e0d77d3892fe195170d723d1a","author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"real_author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"date":"2021-04-24 15:28:21.000000000","message":"Patch Set 2:\n\n\u003e I\u0027d like keep the changes to minimum, because:\n \u003e \n \u003e info output from multiple snprintf() calls.\n \u003e - I do not have all the flash memories around to test the results.\n \u003e - The amount time I am able work on OpenOCD is limited.\n\nNobody has all devices and everybody has some limit of time spent on OpenOCD.\nAny change of widely used API breaks numerous patches stacked in gerrit\nand solving the conflicts requires lot of time.\nThat\u0027s why I\u0027m reluctant to accept a \"minimal\" change which does not\nsolve the main problem. IMO the main problem is the fixed size of buffer.\nYour change just ensures correct reaction when the buffer runs out.\nSo an user gets \"error retrieving flash info\".\nYes, it\u0027s better than messed memory without this change but does not\nmake the user too happy.\n\n \u003e - The change to printf_alloc() is not straightforward in some of\n \u003e the flash drivers, especially those that concatenate the resulting\n\nAgreed. printf_alloc was just the first quick idea, not the best one.\n\nThere is much better way: pass struct command_invocation *cmd\nfrom COMMAND_HANDLER(handle_flash_info_command) to the driver .info call.\nThe driver can use command_print(cmd, ...) without any hassle.\nIt\u0027s a drop-in replacement of snprintf(buf, buf_size, ...) and all\nfiddling with returned size can be dropped.\n\nThe only (small) complication I\u0027m aware of is stm32l4x.c which reuses its own\ninfo string for LOG_INFO during probe.","accounts_in_message":[],"_revision_number":2},{"id":"3aa3cd55b840a6a27a6257553e0a789bb6761377","author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"real_author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"date":"2021-04-25 10:10:59.000000000","message":"Patch Set 2:\n\nPlease use \u0027unsigned int\u0027 instead of \u0027unsigned\u0027.\nI think the XXX_info() functions should return error if snprintf() returns negative, because it is an error condition. Then, after the error check, it\u0027s fine to use the return value of snprintf(). I mean\nretval \u003d snprintf(buf, buf_size, ...);\nif (retval \u003c 0)\n  return ERROR_FAIL;\nbuf +\u003d retval;\nbuf_size -\u003d retval;","accounts_in_message":[],"_revision_number":2},{"id":"96261cd31be3f441659a90038d84d85af70c6554","author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"real_author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"date":"2021-04-25 20:18:23.000000000","message":"Patch Set 2:\n\n\u003e I think the XXX_info() functions should return error if snprintf()\n \u003e returns negative, because it is an error condition. Then, after the\n \u003e error check, it\u0027s fine to use the return value of snprintf(). I\n \u003e mean\n \u003e retval \u003d snprintf(buf, buf_size, ...);\n \u003e if (retval \u003c 0)\n \u003e return ERROR_FAIL;\n \u003e buf +\u003d retval;\n \u003e buf_size -\u003d retval;\n\nIt\u0027s not enough, Antonio.\n\nSee man snprintf, return value:\n\nThe  functions  snprintf()  and vsnprintf() do not write more than size\nbytes (including the terminating null byte (\u0027\\0\u0027)).  If the output  was\ntruncated  due  to  this  limit  then the return value is the number of\ncharacters (excluding the terminating null byte) which would have  been\nwritten  to the final string if enough space had been available.  Thus,\na return value of size or more means that  the  output  was  truncated.","accounts_in_message":[],"_revision_number":2},{"id":"6122e3c4224694a62ec6b77b155699f08a8dfbc6","author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"real_author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"date":"2021-04-25 20:59:36.000000000","message":"Patch Set 2:\n\nYou are right! So it should be something like this?\n\nretval \u003d snprintf(buf, buf_size, ...);\nif (retval \u003c 0)\n    return ERROR_FAIL;\nretval \u003d retval \u003c buf_size ? retval : bufsize;\nbuf +\u003d retval;\nbuf_size -\u003d retval;\n\nMaybe adding a function\nint snprintf_advance(char **buf, unsigned int **size, ...);\nthat updates automatically buf and size.\nThe caller should only check for error.","accounts_in_message":[],"_revision_number":2},{"id":"8a4a6235e81e006340652b1dd2bafdfce9f96855","author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"real_author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"date":"2021-04-25 21:41:43.000000000","message":"Patch Set 2:\n\n\u003e You are right! So it should be something like this?\n \u003e \n \u003e retval \u003d snprintf(buf, buf_size, ...);\n \u003e if (retval \u003c 0)\n \u003e return ERROR_FAIL;\n \u003e retval \u003d retval \u003c buf_size ? retval : bufsize;\n \u003e buf +\u003d retval;\n \u003e buf_size -\u003d retval;\n \u003e \n \u003e Maybe adding a function\n \u003e int snprintf_advance(char **buf, unsigned int **size, ...);\n \u003e that updates automatically buf and size.\n \u003e The caller should only check for error.\n\n6 lines of code to produce a single line of info? All this crap copied ~100 times?\nWhy not just\n\n  command_print(cmd, ...)\n\n????!!!","accounts_in_message":[],"_revision_number":2},{"id":"5d1d6ae125fae5a22eb54e9124ba86af7ed2abe8","author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"real_author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"date":"2021-04-25 22:30:06.000000000","message":"Patch Set 2:\n\n\u003e 6 lines of code to produce a single line of info? All this crap\n \u003e copied ~100 times?\n\nThat\u0027s why I suggest put all this crap inside snprintf_advance(). This will even simplify the code:\n\nretval \u003d snprintf_advance(\u0026buf, \u0026buf_size, ...);\nif (retval \u003c 0) return ERROR_FAIL;\nretval \u003d snprintf_advance(\u0026buf, \u0026buf_size, ...);\nif (retval \u003c 0) return ERROR_FAIL;\n\n \u003e Why not just\n \u003e \n \u003e command_print(cmd, ...)\n\nI thought the same but will require an API change of struct flash_driver-\u003einfo() because we need struct command_invocation.","accounts_in_message":[],"_revision_number":2},{"id":"c81239960a16fdff86848ee08bb8b4539aa4e4b1","author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"real_author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"date":"2021-04-26 07:22:16.000000000","message":"Patch Set 2: Code-Review-1\n\nOnce more for you, Antonio:\n\n1) From the point of view of project maintenance there is no difference between changing buf_size to unsigned and replacing both buf params by cmd invocation struct. Both breaks all pending changes touching this code.\n\n2) COMMAND_HANDLER(handle_flash_info_command) already allocates 1 kbyte for the info text which should be concise, e.g. the name of device, size of flash. This patch proves that it\u0027s not enough for some flash drivers. Seems me if we allocated 1 Mbyte some driver would put bible quotes into info and run out the size again.\n\n3) If we can fix the reason of the problem (the fixed buf size) with comparable effort why bother with fixing consequences of the problem (buf overruns)?\n\n4) The drawback of command_print() is very poor (or none) checking of memory allocation fails in jimtcl. Particularly in this case it makes no difference as the info text gathered in buf is currently passed to command_print() anyway.","accounts_in_message":[],"_revision_number":2},{"id":"7fede927b33ae8f772cd132bba757202e68cbcb5","author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"real_author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"date":"2021-04-26 07:48:33.000000000","message":"Patch Set 2:\n\nGentlemen, thank you for your inputs.\n\nPassing \"struct command_invocation\" to the \"info\" callback \u0026 using command_print() or command_print_sameline() to produce the prints sounds fine. \n\nThis is a clean change, it improves the API, addresses the existing buffer issues and at the same time does not require much changes inside the \"info\" callbacks of the drivers.\n\nI\u0027ll do it this way, unless you have different suggestions.","accounts_in_message":[],"_revision_number":2},{"id":"b81cb2432fc52c1dac8549f4a78d379c832fbdee","author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"real_author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"date":"2021-04-26 08:54:59.000000000","message":"Patch Set 2:\n\nGreat decision, Jan!\nI\u0027m working on the change of command_print() to send the output as LOG_INFO in the case of NULL is passed instead of the real command invocation struct. It will ease the internal use of flash_driver.info by the driver probe.","accounts_in_message":[],"_revision_number":2},{"id":"5903f8000c1cc4c13a2036089e56d4563c7d5e35","author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"real_author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"date":"2021-05-14 10:32:09.000000000","message":"Uploaded patch set 3.","accounts_in_message":[],"_revision_number":3},{"id":"f5d285a700134b786e52c1b0188b66ffa972c553","author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"real_author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"date":"2021-05-14 10:41:59.000000000","message":"Patch Set 3:\n\nNote: This change is based on top of http://openocd.zylin.com/#/c/6193","accounts_in_message":[],"_revision_number":3},{"id":"e9fb5e0c806c17700338f75de8d50d061a597ba3","author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"real_author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"date":"2021-05-14 11:02:42.000000000","message":"Patch Set 3: Verified+1\n\nBuild Successful \n\nhttp://build.openocd.org/job/openocd-gerrit/14549/ : SUCCESS\n\nhttp://build.openocd.org/job/openocd-gerrit-build/13802/ : SUCCESS","accounts_in_message":[],"_revision_number":3},{"id":"7b6d5e91f12b1c63d51ecd5f9b946d484a43bac9","author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"real_author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"date":"2021-05-18 07:58:05.000000000","message":"Uploaded patch set 4.","accounts_in_message":[],"_revision_number":4},{"id":"84c8165563fb880e27dc7cd04777bcf7fd2e5889","author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"real_author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"date":"2021-05-18 07:59:21.000000000","message":"Patch Set 4:\n\nI have rebased the change so that it is independent on http://openocd.zylin.com/#/c/6193.\n\nIt turned out I could do this fix easily without the need for command_print(NULL, ...);","accounts_in_message":[],"_revision_number":4},{"id":"b8a6bdd2f4db950e9749c06721e057cd119c2ae9","author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"real_author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"date":"2021-05-18 08:32:28.000000000","message":"Patch Set 4: Verified+1\n\nBuild Successful \n\nhttp://build.openocd.org/job/openocd-gerrit/14574/ : SUCCESS\n\nhttp://build.openocd.org/job/openocd-gerrit-build/13826/ : SUCCESS","accounts_in_message":[],"_revision_number":4},{"id":"f53bdaf4a190ee584568b98aa7f3cc2c67e3dd4d","author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"real_author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"date":"2021-05-18 15:50:37.000000000","message":"Patch Set 4:\n\n(7 comments)\n\nWe had some comment exchange in IRC about using command_print() and command_print_sameline().\nToday most commands use command_print(), but then when we use the command result this adds an extra empty line!\nIt\u0027s not a problem whne you just print it out, but it\u0027s bad when we use the result.\nTry, as example,\nsplit [targets] \\n\nsplit [adapter list] \\n\nthey both report an extra empty line at the end.\nThe idea is to rework OpenOCD in two steps:\n1) replace all the command_print() with command_print_sameline(), adding the \\n in the format string when needed;\n2) once all the command_print() have disappeared, rename command_print_sameline() as command_print().\nIn this huge work you are balancing the two functions to try to get the exact same result, adding and removing \"\\n\" when needed. Would you mind following the approach above, so we don\u0027t have to rework all again?","accounts_in_message":[],"_revision_number":4},{"id":"4dd45cf67840eb235026b8dcff845e4d24353e2f","author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"real_author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"date":"2021-05-19 06:29:19.000000000","message":"Patch Set 4:\n\nAntonio - \n\nthank you for looking at the changes and for your feedback. I\u0027ll address all the items in the next round.\n\n\nAll -\n\nBefore I make those changes, I\u0027d just like to double-check that we have a consensus here on how the code should be structured:\n\n1) Are we all in favor of using command_print_sameline() in all the flash driver \"info\" callbacks, as Antonio described above?\n\n2) Are we all OK with minor code duplication in few of the flash drivers to avoid buffer allocation and snprintf, as pointed out in this review?\n\nIf we\u0027re in agreement, I\u0027ll make the changes.\n\nThanks, Jan","accounts_in_message":[],"_revision_number":4},{"id":"b4f8f80f9e1a2e76657ba816e19cd396382dfaf7","author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"real_author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"date":"2021-05-19 11:30:45.000000000","message":"Patch Set 4:\n\n(1 comment)","accounts_in_message":[],"_revision_number":4},{"id":"f0d6a789257052d91cee0b405c0c1cd824e842b9","author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"real_author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"date":"2021-05-19 11:36:04.000000000","message":"Patch Set 4:\n\n(1 comment)","accounts_in_message":[],"_revision_number":4},{"id":"d067f4cc6430be612cc54d3f30a6d0543e7e4ca5","author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"real_author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"date":"2021-05-19 16:33:02.000000000","message":"Patch Set 4:\n\n(1 comment)","accounts_in_message":[],"_revision_number":4},{"id":"5d2b3e24a9a4321260994b22dce26a4dfc35e951","author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"real_author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"date":"2021-05-19 16:57:33.000000000","message":"Patch Set 4:\n\nIt remains one point that probably changes the behavior of -\u003eprobe().\nToday -\u003eprobe() prints out some text. By using command_print(), instead, the text goes as command result.\nIs this ok?\nDo we need some odd API to print the command result so far and reset it?\nThis can also be done online, something like:\nLOG_USER(Jim_String(cmd-\u003ecommand));\nJim_DecrRefCount(cmd-\u003ectx-\u003einterp, cmd-\u003eoutput);\ncmd-\u003eoutput \u003d Jim_NewEmptyStringObj(cmd-\u003ectx-\u003einterp);","accounts_in_message":[],"_revision_number":4},{"id":"e3c563bdcc627ad09186b01daba474b5653f39e8","author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"real_author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"date":"2021-05-20 06:36:02.000000000","message":"Patch Set 4:\n\n\u003e It remains one point that probably changes the behavior of\n \u003e -\u003eprobe().\n \u003e Today -\u003eprobe() prints out some text. By using command_print(),\n \u003e instead, the text goes as command result.\n \u003e Is this ok?\n\nGood question. The probe code often runs as auto-probe, before\nanother flash command. Prepending the output of this command\nby the probe output would surely complicate parsing the result by\na Tcl script as the auto-probe runs just if needed.\n\n \u003e Do we need some odd API to print the command result so far and\n \u003e reset it?\n \u003e This can also be done online, something like:\n \u003e LOG_USER(Jim_String(cmd-\u003ecommand));\n \u003e Jim_DecrRefCount(cmd-\u003ectx-\u003einterp, cmd-\u003eoutput);\n \u003e cmd-\u003eoutput \u003d Jim_NewEmptyStringObj(cmd-\u003ectx-\u003einterp);\n\nIf we flush cmd-\u003eoutput somewhere in the infrastructure (flash/nor/tcl.c)\nnot in a flash driver, then it seems me acceptable. There is also a minor issue\nthat the output from cmd-\u003ecommand is delayed in comparison to other LOG_\noutputs (may make debug log analyse more tricky)\n\nConsidering flushing cmd-\u003eoutput and changing probe and autoprobe of all\nflash drivers to pass cmd... this solution is way more complicated than http://openocd.zylin.com/6193\nOr am I wrong?","accounts_in_message":[],"_revision_number":4},{"id":"e598b81684661bdccced3b73d6a56db58feac91e","author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"real_author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"date":"2021-05-20 12:35:40.000000000","message":"Patch Set 4:\n\nTomas, I prefer keeping well separated what is the command result (produced through command_print(), that should probably be renamed cmd_append_result()) from what is sent to LOG_XXX().\nSo for me 6193 is not the proper solution.\n\nHere in 6182 we have a broken string append that should be fixed.\nIn case of \"flash info\" the string should go in command output. This patch is going in this direction.\nBut very few drivers (only 3) reuse the same code to print the same string during flash probe.\nShould probe() produce a result or print an output?\nFor me it should produce a result too and the very few tcl files that explicitly probe should run \"echo [flash probe]\" if the output has to be printed.\n\nMoreover, I think it\u0027s redundant to let probe() print what should be printed by info(). probe() output should be limited at 1 informative line max. But this extra change should not be addressed in this patch.","accounts_in_message":[],"_revision_number":4},{"id":"9763f7f279dfbd19fb4013bdb647040966fe1ff5","author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"real_author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"date":"2021-05-20 12:43:01.000000000","message":"Patch Set 4:\n\nArggg! there is -\u003eauto_probe() too!","accounts_in_message":[],"_revision_number":4},{"id":"02704bb6486e446abd44d84a4c9a46ce20019983","author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"real_author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"date":"2021-05-20 21:28:26.000000000","message":"Patch Set 4:\n\nReviewed again, I\u0027m still convinced that info() should use command_print(), probe() should use LOG_XXX.\nThe 3 driver that use a common function to produce the same output in info() and probe() should get the few print duplicated. I believe the developer of these driver just found easy reusing the function, but there is no real reason to print so much in probe().\nThis will make the code clean.\nThen, another patch could evaluate, cleanup and remove some of the LOG_XXX duplicated in probe().","accounts_in_message":[],"_revision_number":4},{"id":"1c20578c5cf4c96a355a09463b2db3f6e0bde54a","author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"real_author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"date":"2021-05-23 04:30:05.000000000","message":"Patch Set 4:\n\n\u003e Reviewed again, I\u0027m still convinced that info() should use\n \u003e command_print(), probe() should use LOG_XXX.\n \u003e The 3 driver that use a common function to produce the same output\n \u003e in info() and probe() should get the few print duplicated. I\n \u003e believe the developer of these driver just found easy reusing the\n \u003e function, but there is no real reason to print so much in probe().\n \u003e This will make the code clean.\n \u003e Then, another patch could evaluate, cleanup and remove some of the\n \u003e LOG_XXX duplicated in probe().\n\nPerhaps you\u0027re right.","accounts_in_message":[],"_revision_number":4},{"id":"69cc5da6882f58b5b863b1e106ba1bc1edfe163e","author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"real_author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"date":"2021-05-28 07:31:34.000000000","message":"Uploaded patch set 5.","accounts_in_message":[],"_revision_number":5},{"id":"c9c0e9c71b97d153cdffc2be3a52c3e527e903da","author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"real_author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"date":"2021-05-28 07:32:30.000000000","message":"Patch Set 5: Verified-1\n\nBuild Failed \n\nhttp://build.openocd.org/job/openocd-gerrit/14656/ : FAILURE\n\nhttp://build.openocd.org/job/openocd-gerrit-build/13906/ : FAILURE","accounts_in_message":[],"_revision_number":5},{"id":"4ea926b24ee6d8bd2f9dd8747999858d989b01ea","author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"real_author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"date":"2021-05-28 07:37:14.000000000","message":"Patch Set 5:\n\n(7 comments)\n\nThanks for your feedback, I\u0027ve reworked the patch accordingly. The change also includes the replacement of command_print() by command_print_sameline(), as discussed above.\n\nLet me know if there is more to do prior to merge. Thanks.","accounts_in_message":[],"_revision_number":5},{"id":"da64962631d5401bf287b41757f527c74ea3010d","author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"real_author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"date":"2021-05-28 07:41:23.000000000","message":"Uploaded patch set 6.","accounts_in_message":[],"_revision_number":6},{"id":"708bbcc8a8c4535fe0d65ac11ad54d240c37ac45","author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"real_author":{"_account_id":1000014,"name":"jenkins","username":"jenkins","tags":["SERVICE_USER"]},"date":"2021-05-28 08:15:59.000000000","message":"Patch Set 6: Verified+1\n\nBuild Successful \n\nhttp://build.openocd.org/job/openocd-gerrit/14657/ : SUCCESS\n\nhttp://build.openocd.org/job/openocd-gerrit-build/13907/ : SUCCESS","accounts_in_message":[],"_revision_number":6},{"id":"22d916b74624d61ab2b6776041ff13072cca382f","author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"real_author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"date":"2021-05-31 21:54:48.000000000","message":"Patch Set 6: Code-Review+1\n\n(2 comments)\n\nI\u0027m fine with this version.\nTwo comments for minor changes not part of this patch, but it doesn\u0027t hurt.\nI think there is some extra \u0027\\n\u0027 at the end of some of the \"info\" command. But this is quite common to many other commands. It could be part of another patch.","accounts_in_message":[],"_revision_number":6},{"id":"fc8328de986682f886b877ccf4883a9a1f0d1b15","author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"real_author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"date":"2021-06-01 05:49:25.000000000","message":"Patch Set 6:\n\nThank you for looking at this. \n\n \u003e I think there is some extra \u0027\\n\u0027 at the end of some of the \"info\"\n \u003e command. But this is quite common to many other commands. It could\n \u003e be part of another patch.\n\nRight. To limit the amount of changes in this already large patch, I tried to preserve the newlines in the prints as they were. I only changed command_print() to command_print_sameline(), as discussed.","accounts_in_message":[],"_revision_number":6},{"id":"20046b77639a9dce6f8a979b0a344f5635d042a3","author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"real_author":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"date":"2021-06-07 06:05:25.000000000","message":"Patch Set 6:\n\nCan I do anything more to help this merge request get approved?\n\nDue to its size, it would be preferable to have it merged sooner than later so that any queued changes that touch flash/nor could be rebased.","accounts_in_message":[],"_revision_number":6},{"id":"707444dffff64db9cb831775fe0436266d1b0cea","author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"real_author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"date":"2021-06-07 07:34:06.000000000","message":"Patch Set 6:\n\nTomas, is this version ok for you too?","accounts_in_message":[],"_revision_number":6},{"id":"7f42bd2fb3447e84b854282a323ad1427baea424","author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"real_author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"tomas.vanek.oocd@gmail.com","username":"vanekt"},"date":"2021-06-07 19:48:55.000000000","message":"Patch Set 6: Code-Review+2\n\nOk, let\u0027s merge it","accounts_in_message":[],"_revision_number":6},{"id":"aaa36ac316728103c44d30ba6b8caa9108159d79","author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"real_author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"date":"2021-06-13 18:58:28.000000000","message":"Change has been successfully cherry-picked as 64c2e03b23d9cadc1b919d38e902a079d015ddc6 by Antonio Borneo","accounts_in_message":[],"_revision_number":7},{"id":"69e48d65461a20d4fe4f332df92e8d5a79fa60cc","author":{"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},"real_author":{"_account_id":1000863,"name":"Tarek BOCHKATI","email":"tarek.bouchkati@gmail.com","username":"BouchkatiTarek"},"date":"2021-08-05 14:49:36.000000000","message":"Patch Set 7:\n\n(1 comment)\n\noops, a regression !\nI will fix it ASAP","accounts_in_message":[],"_revision_number":7}],"current_revision":"64c2e03b23d9cadc1b919d38e902a079d015ddc6","revisions":{"3b227d92882a42d0176ab15c027023b40e9e62d1":{"kind":"REWORK","_number":1,"created":"2021-04-23 10:04:54.000000000","uploader":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"ref":"refs/changes/82/6182/1","fetch":{"anonymous http":{"url":"https://review.openocd.org/openocd","ref":"refs/changes/82/6182/1","commands":{"Branch":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/1 \u0026\u0026 git checkout -b change-6182 FETCH_HEAD","Checkout":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/1 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/1 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/1 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.openocd.org/openocd refs/changes/82/6182/1","Reset To":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/1 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"41a6089504823433817ea67d9af3d2d85f402336","subject":"flash/nor/nrf5: Fix data types and const correctness"}],"author":{"name":"Jan Matyas","email":"matyas@codasip.com","date":"2021-04-23 08:47:17.000000000","tz":120},"committer":{"name":"Jan Matyas","email":"matyas@codasip.com","date":"2021-04-23 10:03:07.000000000","tz":120},"subject":"flash/nor: datatype fix - make buf_size in flash_driver.info unsigned","message":"flash/nor: datatype fix - make buf_size in flash_driver.info unsigned\n\n1) Fix of the buf_size argument in \"info\" callback of \"struct\nflash_driver\" - it should be unsigned.\n\n2) Multiple fixes of buffer-overruns-to-be in the struct flash_driver\ninfo callbacks. These were caused by an improper use of the snprintf\u0027s\nreturn value.\n\nChange-Id: I42ab8a8018d01f9af43c5ba49f650c3cb5d31dcb\nSigned-off-by: Jan Matyas \u003cmatyas@codasip.com\u003e\n"}},"ffd57fbfcd7999944a87fc10f19b24a4c4acf795":{"kind":"NO_CODE_CHANGE","_number":2,"created":"2021-04-23 10:07:01.000000000","uploader":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"ref":"refs/changes/82/6182/2","fetch":{"anonymous http":{"url":"https://review.openocd.org/openocd","ref":"refs/changes/82/6182/2","commands":{"Branch":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/2 \u0026\u0026 git checkout -b change-6182 FETCH_HEAD","Checkout":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/2 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/2 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/2 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.openocd.org/openocd refs/changes/82/6182/2","Reset To":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/2 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"41a6089504823433817ea67d9af3d2d85f402336","subject":"flash/nor/nrf5: Fix data types and const correctness"}],"author":{"name":"Jan Matyas","email":"matyas@codasip.com","date":"2021-04-23 08:47:17.000000000","tz":120},"committer":{"name":"Jan Matyas","email":"matyas@codasip.com","date":"2021-04-23 10:06:41.000000000","tz":120},"subject":"flash/nor: fix data types \u0026 buffer overruns in flash_driver.info","message":"flash/nor: fix data types \u0026 buffer overruns in flash_driver.info\n\n1) Fix of the buf_size argument in \"info\" callback of \"struct\nflash_driver\" - it should be unsigned.\n\n2) Multiple fixes of buffer-overruns-to-be in the struct flash_driver\u0027s\ninfo callbacks. These were caused by an improper use of the snprintf\u0027s\nreturn value.\n\nChange-Id: I42ab8a8018d01f9af43c5ba49f650c3cb5d31dcb\nSigned-off-by: Jan Matyas \u003cmatyas@codasip.com\u003e\n"}},"a88d861d674766a912814eceb1c7d25d9727567d":{"kind":"REWORK","_number":3,"created":"2021-05-14 10:32:09.000000000","uploader":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"ref":"refs/changes/82/6182/3","fetch":{"anonymous http":{"url":"https://review.openocd.org/openocd","ref":"refs/changes/82/6182/3","commands":{"Branch":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/3 \u0026\u0026 git checkout -b change-6182 FETCH_HEAD","Checkout":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/3 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/3 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/3 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.openocd.org/openocd refs/changes/82/6182/3","Reset To":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/3 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"25db1c7e595bbb3e967181e0e41cb1fd811096fc","subject":"helper/command, log: provide fallback for command_print()"}],"author":{"name":"Jan Matyas","email":"matyas@codasip.com","date":"2021-04-23 08:47:17.000000000","tz":120},"committer":{"name":"Jan Matyas","email":"matyas@codasip.com","date":"2021-05-14 10:30:05.000000000","tz":120},"subject":"flash/nor: improved API of flash_driver.info \u0026 fixed buffer overruns","message":"flash/nor: improved API of flash_driver.info \u0026 fixed buffer overruns\n\n1) The API of \"info\" callback in \"struct flash_driver\" has been\nimproved. Fixed buffers for strings\n\n2) Removed the calls to snprintf() from the flash_driver.info\nimplementations. Many of them were used in an unsafe manner\n(buffer overruns were possible).\n\nChange-Id: I42ab8a8018d01f9af43c5ba49f650c3cb5d31dcb\nSigned-off-by: Jan Matyas \u003cmatyas@codasip.com\u003e\n"}},"162370f131cf20454b5fd247a2aa693a96a60d5f":{"kind":"REWORK","_number":4,"created":"2021-05-18 07:58:05.000000000","uploader":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"ref":"refs/changes/82/6182/4","fetch":{"anonymous http":{"url":"https://review.openocd.org/openocd","ref":"refs/changes/82/6182/4","commands":{"Branch":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/4 \u0026\u0026 git checkout -b change-6182 FETCH_HEAD","Checkout":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/4 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/4 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/4 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.openocd.org/openocd refs/changes/82/6182/4","Reset To":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/4 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"bbbfddc3efd4a93b0c9489c2537efbaa117bcfb0","subject":"jimtcl: restrict memory leak workaround on Linux only"}],"author":{"name":"Jan Matyas","email":"matyas@codasip.com","date":"2021-04-23 08:47:17.000000000","tz":120},"committer":{"name":"Jan Matyas","email":"matyas@codasip.com","date":"2021-05-18 07:57:13.000000000","tz":120},"subject":"flash/nor: improved API of flash_driver.info \u0026 fixed buffer overruns","message":"flash/nor: improved API of flash_driver.info \u0026 fixed buffer overruns\n\n1) The API of \"info\" callback in \"struct flash_driver\" has been\nimproved. Fixed buffers for strings\n\n2) Removed the calls to snprintf() from the flash_driver.info\nimplementations. Many of them were used in an unsafe manner\n(buffer overruns were possible).\n\nChange-Id: I42ab8a8018d01f9af43c5ba49f650c3cb5d31dcb\nSigned-off-by: Jan Matyas \u003cmatyas@codasip.com\u003e\n"}},"46a63dc256c9e609fe8a3f5fd47622ae911f5b89":{"kind":"REWORK","_number":5,"created":"2021-05-28 07:31:34.000000000","uploader":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"ref":"refs/changes/82/6182/5","fetch":{"anonymous http":{"url":"https://review.openocd.org/openocd","ref":"refs/changes/82/6182/5","commands":{"Branch":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/5 \u0026\u0026 git checkout -b change-6182 FETCH_HEAD","Checkout":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/5 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/5 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/5 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.openocd.org/openocd refs/changes/82/6182/5","Reset To":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/5 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"4e872a797f81595d5de790138bdec62f2bf175f0","subject":"target/zynqmp : Add AXI AP access port"}],"author":{"name":"Jan Matyas","email":"matyas@codasip.com","date":"2021-04-23 08:47:17.000000000","tz":120},"committer":{"name":"Jan Matyas","email":"matyas@codasip.com","date":"2021-05-28 07:30:58.000000000","tz":120},"subject":"flash/nor: improved API of flash_driver.info \u0026 fixed buffer overruns","message":"flash/nor: improved API of flash_driver.info \u0026 fixed buffer overruns\n\n1) The API of \"info\" callback in \"struct flash_driver\" has been\nimproved. Fixed buffers for strings\n\n2) Removed the calls to snprintf() from the flash_driver.info\nimplementations. Many of them were used in an unsafe manner\n(buffer overruns were possible).\n\nChange-Id: I42ab8a8018d01f9af43c5ba49f650c3cb5d31dcb\nSigned-off-by: Jan Matyas \u003cmatyas@codasip.com\u003e\n"}},"442163e009671e888696a148e752bf815cf62446":{"kind":"REWORK","_number":6,"created":"2021-05-28 07:41:23.000000000","uploader":{"_account_id":1001667,"name":"Jan Matyas","email":"jan.matyas@codasip.com","username":"JanMatCodasip"},"ref":"refs/changes/82/6182/6","fetch":{"anonymous http":{"url":"https://review.openocd.org/openocd","ref":"refs/changes/82/6182/6","commands":{"Branch":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/6 \u0026\u0026 git checkout -b change-6182 FETCH_HEAD","Checkout":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/6 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/6 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/6 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.openocd.org/openocd refs/changes/82/6182/6","Reset To":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/6 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"4e872a797f81595d5de790138bdec62f2bf175f0","subject":"target/zynqmp : Add AXI AP access port"}],"author":{"name":"Jan Matyas","email":"matyas@codasip.com","date":"2021-04-23 08:47:17.000000000","tz":120},"committer":{"name":"Jan Matyas","email":"matyas@codasip.com","date":"2021-05-28 07:40:53.000000000","tz":120},"subject":"flash/nor: improved API of flash_driver.info \u0026 fixed buffer overruns","message":"flash/nor: improved API of flash_driver.info \u0026 fixed buffer overruns\n\n1) The API of \"info\" callback in \"struct flash_driver\" has been\nimproved. Fixed buffers for strings\n\n2) Removed the calls to snprintf() from the flash_driver.info\nimplementations. Many of them were used in an unsafe manner\n(buffer overruns were possible).\n\nChange-Id: I42ab8a8018d01f9af43c5ba49f650c3cb5d31dcb\nSigned-off-by: Jan Matyas \u003cmatyas@codasip.com\u003e\n"}},"64c2e03b23d9cadc1b919d38e902a079d015ddc6":{"kind":"REWORK","_number":7,"created":"2021-06-13 18:58:28.000000000","uploader":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"ref":"refs/changes/82/6182/7","fetch":{"anonymous http":{"url":"https://review.openocd.org/openocd","ref":"refs/changes/82/6182/7","commands":{"Branch":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/7 \u0026\u0026 git checkout -b change-6182 FETCH_HEAD","Checkout":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/7 \u0026\u0026 git checkout FETCH_HEAD","Cherry Pick":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/7 \u0026\u0026 git cherry-pick FETCH_HEAD","Format Patch":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/7 \u0026\u0026 git format-patch -1 --stdout FETCH_HEAD","Pull":"git pull https://review.openocd.org/openocd refs/changes/82/6182/7","Reset To":"git fetch https://review.openocd.org/openocd refs/changes/82/6182/7 \u0026\u0026 git reset --hard FETCH_HEAD"}}},"commit":{"parents":[{"commit":"f2958fc04bd879393fa743860478834e234f05d0","subject":"Add remote bitbang write buffer."}],"author":{"name":"Jan Matyas","email":"matyas@codasip.com","date":"2021-04-23 08:47:17.000000000","tz":120},"committer":{"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","date":"2021-06-13 18:58:28.000000000","tz":60},"subject":"flash/nor: improved API of flash_driver.info \u0026 fixed buffer overruns","message":"flash/nor: improved API of flash_driver.info \u0026 fixed buffer overruns\n\n1) The API of \"info\" callback in \"struct flash_driver\" has been\nimproved. Fixed buffers for strings\n\n2) Removed the calls to snprintf() from the flash_driver.info\nimplementations. Many of them were used in an unsafe manner\n(buffer overruns were possible).\n\nChange-Id: I42ab8a8018d01f9af43c5ba49f650c3cb5d31dcb\nSigned-off-by: Jan Matyas \u003cmatyas@codasip.com\u003e\nReviewed-on: http://openocd.zylin.com/6182\nTested-by: jenkins\nReviewed-by: Antonio Borneo \u003cborneo.antonio@gmail.com\u003e\nReviewed-by: Tomas Vanek \u003cvanekt@fbl.cz\u003e\n"}}},"requirements":[],"submit_records":[],"submit_requirements":[]}
