Werner Zeh has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31544 )
Change subject: commonlib: Add Bubble sort algorithm ......................................................................
Patch Set 2:
(8 comments)
https://review.coreboot.org/#/c/31544/2//COMMIT_MSG Commit Message:
https://review.coreboot.org/#/c/31544/2//COMMIT_MSG@9 PS2, Line 9: Integers
integers
Ack
https://review.coreboot.org/#/c/31544/2//COMMIT_MSG@13 PS2, Line 13: sort are
Just one space.
Ack
https://review.coreboot.org/#/c/31544/2//COMMIT_MSG@16 PS2, Line 16: need
needed
Ack
https://review.coreboot.org/#/c/31544/2/src/commonlib/include/commonlib/sort... File src/commonlib/include/commonlib/sort.h:
https://review.coreboot.org/#/c/31544/2/src/commonlib/include/commonlib/sort... PS2, Line 20: typedef enum{
Add a space before {?
Yes, how has it slipped in using checkpatch? Will add.
https://review.coreboot.org/#/c/31544/2/src/commonlib/sort.c File src/commonlib/sort.c:
https://review.coreboot.org/#/c/31544/2/src/commonlib/sort.c@18 PS2, Line 18: static void swap(int *v1, int *v2)
Should this maybe be a macro (using typeof()) in some header to be more widely useful?
I had a macro with typeof() here in the first run and was not sure. Will switch back to the macro.
https://review.coreboot.org/#/c/31544/2/src/commonlib/sort.c@26 PS2, Line 26: static int is_bigger(int v1, int v2)
This... […]
Agree, will move comparison into the code below.
https://review.coreboot.org/#/c/31544/2/src/commonlib/sort.c@30 PS2, Line 30: /* Implement a simple Bubble sort algorithm. Reduce the needed number of
Please use the allowed comment style. (No idea if clang-format would help. […]
Yes, will do.
https://review.coreboot.org/#/c/31544/2/src/commonlib/sort.c@51 PS2, Line 51: idx = i + 1;
I don't get the point of the idx variable. […]
Will improve.