)]}'
{"src/flash/nor/stm32l4x.c":[{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"0fed589a55aeaab42636c2ed29e81b0c2d336f00","unresolved":false,"context_lines":[{"line_number":1366,"context_line":"\t}"},{"line_number":1367,"context_line":""},{"line_number":1368,"context_line":"\t/* data_width should be multiple of double-word */"},{"line_number":1369,"context_line":"\tassert(IS_ALIGNED(stm32l4_info-\u003edata_width, 8));"},{"line_number":1370,"context_line":"\tconst size_t extra_size \u003d sizeof(struct stm32l4_work_area);"},{"line_number":1371,"context_line":"\tuint32_t buffer_size \u003d target_get_working_area_avail(target) - extra_size;"},{"line_number":1372,"context_line":"\t/* buffer_size should be multiple of stm32l4_info-\u003edata_width */"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"abba3cdd_b9ce7977","line":1369,"updated":"2022-08-01 15:28:20.000000000","message":"I tend to associate the adjective \"aligned\" to addresses.\nHere, as the comment above say, we are checking if it\u0027s a multiple of 8.\nAnd the end it\u0027s the same math ... why not!","commit_id":"51a0eac14ae21a10b013c1586362a0dff005cf86"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"ec9aa78bbd0f628766a382e4c61b1ce037a84d09","unresolved":true,"context_lines":[{"line_number":1366,"context_line":"\t}"},{"line_number":1367,"context_line":""},{"line_number":1368,"context_line":"\t/* data_width should be multiple of double-word */"},{"line_number":1369,"context_line":"\tassert(IS_ALIGNED(stm32l4_info-\u003edata_width, 8));"},{"line_number":1370,"context_line":"\tconst size_t extra_size \u003d sizeof(struct stm32l4_work_area);"},{"line_number":1371,"context_line":"\tuint32_t buffer_size \u003d target_get_working_area_avail(target) - extra_size;"},{"line_number":1372,"context_line":"\t/* buffer_size should be multiple of stm32l4_info-\u003edata_width */"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"88fef018_3798a971","line":1369,"in_reply_to":"730dbbdb_adda3792","updated":"2022-08-01 17:48:19.000000000","message":"Oh yes! Thanks for pointing it!","commit_id":"51a0eac14ae21a10b013c1586362a0dff005cf86"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"573d08668ab2363ca2500906e5d86b3848bdcff7","unresolved":true,"context_lines":[{"line_number":1366,"context_line":"\t}"},{"line_number":1367,"context_line":""},{"line_number":1368,"context_line":"\t/* data_width should be multiple of double-word */"},{"line_number":1369,"context_line":"\tassert(IS_ALIGNED(stm32l4_info-\u003edata_width, 8));"},{"line_number":1370,"context_line":"\tconst size_t extra_size \u003d sizeof(struct stm32l4_work_area);"},{"line_number":1371,"context_line":"\tuint32_t buffer_size \u003d target_get_working_area_avail(target) - extra_size;"},{"line_number":1372,"context_line":"\t/* buffer_size should be multiple of stm32l4_info-\u003edata_width */"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"9c9f29a7_9ad797cf","line":1369,"in_reply_to":"88fef018_3798a971","updated":"2022-08-01 18:14:13.000000000","message":"Actually data_width can be 8 or 16 nothing else. I added\n assert(IS_PWR_OF_2(stm32l4_info-\u003edata_width))\n\nto ensure align math is working","commit_id":"51a0eac14ae21a10b013c1586362a0dff005cf86"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"6bc3f58f6c35d59de14f87af1612ac0641cc50dc","unresolved":true,"context_lines":[{"line_number":1366,"context_line":"\t}"},{"line_number":1367,"context_line":""},{"line_number":1368,"context_line":"\t/* data_width should be multiple of double-word */"},{"line_number":1369,"context_line":"\tassert(IS_ALIGNED(stm32l4_info-\u003edata_width, 8));"},{"line_number":1370,"context_line":"\tconst size_t extra_size \u003d sizeof(struct stm32l4_work_area);"},{"line_number":1371,"context_line":"\tuint32_t buffer_size \u003d target_get_working_area_avail(target) - extra_size;"},{"line_number":1372,"context_line":"\t/* buffer_size should be multiple of stm32l4_info-\u003edata_width */"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"20f307ac_ff6f60fb","line":1369,"in_reply_to":"9c9f29a7_9ad797cf","updated":"2022-08-01 18:31:36.000000000","message":"Then it would be much more readable checking directly for 8 or 16.\n\nI\u0027m thinking if the assert(IS_PWR_OF_2(x)) should be added in ALIGN_DOWN() and friends... how many cases we would detect? But there is still plenty of code that doesn\u0027t use such macros.","commit_id":"51a0eac14ae21a10b013c1586362a0dff005cf86"},{"author":{"_account_id":1000687,"name":"Tomas Vanek","display_name":"Tomas Vanek","email":"vanekt@fbl.cz","username":"vanekt"},"change_message_id":"8aaf41b6ed3c2fff62b78257da8852a0e7e3270f","unresolved":false,"context_lines":[{"line_number":1366,"context_line":"\t}"},{"line_number":1367,"context_line":""},{"line_number":1368,"context_line":"\t/* data_width should be multiple of double-word */"},{"line_number":1369,"context_line":"\tassert(IS_ALIGNED(stm32l4_info-\u003edata_width, 8));"},{"line_number":1370,"context_line":"\tconst size_t extra_size \u003d sizeof(struct stm32l4_work_area);"},{"line_number":1371,"context_line":"\tuint32_t buffer_size \u003d target_get_working_area_avail(target) - extra_size;"},{"line_number":1372,"context_line":"\t/* buffer_size should be multiple of stm32l4_info-\u003edata_width */"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"f680b469_cd428dfa","line":1369,"in_reply_to":"abba3cdd_b9ce7977","updated":"2022-08-01 16:40:11.000000000","message":"\u003e I tend to associate the adjective \"aligned\" to addresses.\n\nYou\u0027re right!\nThe math is same just if we align both begin and end to equally sized blocks like here.\n\nSo implement round_down() like in kernel.h? I do not like the name as it conceals it rounds to a multiple.","commit_id":"51a0eac14ae21a10b013c1586362a0dff005cf86"},{"author":{"_account_id":1000021,"name":"Antonio Borneo","email":"borneo.antonio@gmail.com","username":"borneoa"},"change_message_id":"057e1b23954d8c9242f81c958132cc9e1cd3d986","unresolved":true,"context_lines":[{"line_number":1366,"context_line":"\t}"},{"line_number":1367,"context_line":""},{"line_number":1368,"context_line":"\t/* data_width should be multiple of double-word */"},{"line_number":1369,"context_line":"\tassert(IS_ALIGNED(stm32l4_info-\u003edata_width, 8));"},{"line_number":1370,"context_line":"\tconst size_t extra_size \u003d sizeof(struct stm32l4_work_area);"},{"line_number":1371,"context_line":"\tuint32_t buffer_size \u003d target_get_working_area_avail(target) - extra_size;"},{"line_number":1372,"context_line":"\t/* buffer_size should be multiple of stm32l4_info-\u003edata_width */"}],"source_content_type":"text/x-csrc","patch_set":1,"id":"730dbbdb_adda3792","line":1369,"in_reply_to":"f680b469_cd428dfa","updated":"2022-08-01 17:28:47.000000000","message":"Actually the code here is deeply incorrect.\nIf data_width has to be multiple of 8, as the comment states, it can be 3*8\u003d24!\nBut then the code below that checks for ALIGN_DOWN doesn\u0027t work with 24, it only works for power of 2.\nHere I think it should be:\n assert(IS_PWR_OF_2(stm32l4_info-\u003edata_width) \u0026\u0026 stm32l4_info-\u003edata_width \u003e\u003d 8);\n\nOr is the check below that need a fix?\nTarek? Do you have any idea?","commit_id":"51a0eac14ae21a10b013c1586362a0dff005cf86"}]}
