Bill XIE has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/47387 )
Change subject: drivers/ipmi: Handle the condition when (dev->chip_info == NULL) ......................................................................
Patch Set 2:
(2 comments)
Patch Set 1: Code-Review+1
(1 comment)
dev->chip_info should never be NULL under normal circumstances, though. Trying to work around the problem feels unnecessarily complex. I'd just throw an error and call it a day.
We all know that, but the compiler do not, and (dev->chip_info == NULL) may not be fatal, but anyway, I could also print an error when dev->chip_info is really NULL.
https://review.coreboot.org/c/coreboot/+/47387/1/src/drivers/ipmi/ipmi_kcs_o... File src/drivers/ipmi/ipmi_kcs_ops.c:
https://review.coreboot.org/c/coreboot/+/47387/1/src/drivers/ipmi/ipmi_kcs_o... PS1, Line 79: str Besides,
struct drivers_ipmi_config *conf = NULL; ... if (dev->chip_info) conf = dev->chip_info;
should be replaced with
struct drivers_ipmi_config *conf = dev->chip_info;
since they have nearly identical effect, but the latter is obviously more elegant.
https://review.coreboot.org/c/coreboot/+/47387/1/src/drivers/ipmi/ipmi_kcs_o... PS1, Line 80: {{ 0, 0, 0 }, 0, 0}
Just use a { 0 } initializer.
Done