Attention is currently required from: openrc@posteo.de.
Nicholas Chin has posted comments on this change by openrc@posteo.de. ( https://review.coreboot.org/c/coreboot/+/86052?usp=email )
Change subject: util/nvramtool: Fix spacing issues reported by linter ......................................................................
Patch Set 8:
(5 comments)
File util/nvramtool/cbfs.h:
https://review.coreboot.org/c/coreboot/+/86052/comment/4213bfc1_9d2a1318?usp... : PS8, Line 129: #define CBFS_SUBHEADER(_p) ((void *) ((((u8 *) (_p)) + ntohl((_p)->offset)))) Arguably the spaces in the original version help with readability due to the multiple levels of nested parenthesis
File util/nvramtool/layout.c:
https://review.coreboot.org/c/coreboot/+/86052/comment/274ea41c_9d1e8ca1?usp... : PS8, Line 91: address = ((unsigned long)p) - offset; I think it would be better if the body of the function was left at a single indent level rather than adding another indent just so that the `(const cmos_entry_t *p)` can be indented. The original formatting isn't that bad and I'd be fine with just leaving it despite checkpatch complaining (though still change `* p` to `*p` for consistency with everything else).
If you really want to change it I'd probably either put it on one line (our line length limit is 96: https://doc.coreboot.org/contributing/coding_style.html#breaking-long-lines-...):
``` static inline const cmos_entry_item_t *cmos_entry_to_const_item(const cmost_entry_t *p){ ```
or put the function name and arguments on its own line:
``` static inline const cmos_entry_item_t * cmos_entry_to_const_item(const cmost_entry_t *p) { ```
Note that the opening `{` should be on its own line for functions as per the coding style: https://doc.coreboot.org/contributing/coding_style.html#placing-braces-and-s...
https://review.coreboot.org/c/coreboot/+/86052/comment/c515ca9c_019eab6e?usp... : PS8, Line 100: static inline const cmos_enum_item_t *cmos_enum_to_const_item : (const cmos_enum_t *p) { : static const cmos_enum_t *pos = &((cmos_enum_item_t *) 0)->item; : unsigned long offset, address; : : offset = (unsigned long)pos; : address = ((unsigned long)p) - offset; : return (const cmos_enum_item_t *)address; : } Same here, as above.
https://review.coreboot.org/c/coreboot/+/86052/comment/4f2e046b_8be6b861?usp... : PS8, Line 269: for (item = cmos_enum_list, prev = NULL; : (item != NULL) && (item->item.config_id < e->config_id); : prev = item, item = item->next); This is another one of those loops with no body, where we have been adding a single continue statement so far. You could also consider converting it into a while loop: ``` item = cmos_enum_list; prev = NULL; while ((item != NULL) && (item->item.config_id < e->config_id)) { prev = item; item = item->next; } ```
https://review.coreboot.org/c/coreboot/+/86052/comment/6c9ce1d0_2368bfe7?usp... : PS8, Line 508: for (item = cmos_enum_list; : (item != NULL) && (item->item.config_id < config_id); : item = item->next); Same as above