Nico Huber has posted comments on this change. ( https://review.coreboot.org/c/coreboot/+/31531 )
Change subject: intelvbttool: Added support for reading vbt from sysfs ......................................................................
Patch Set 3: Code-Review+1
(2 comments)
Thanks for taking care of this. This could also be used to implement reading from `stdin`. Though, I'm not sure about a use case ;)
https://review.coreboot.org/#/c/31531/3/util/intelvbttool/intelvbttool.c File util/intelvbttool/intelvbttool.c:
https://review.coreboot.org/#/c/31531/3/util/intelvbttool/intelvbttool.c@409 PS3, Line 409: if (read_size == 0)
add comment when this could happen. […]
Or do something that doesn't require a comment: Drop the fseek()/ftell() completely, and just use the same code flow for all files.
With the remalloc_fo() call being implemented below anyway, it would reduce the code and make me very happy :)
https://review.coreboot.org/#/c/31531/3/util/intelvbttool/intelvbttool.c@422 PS3, Line 422: struct fileobject *newfo = remalloc_fo(fo, fo->size + read_size); This would realloc in any case, even if we knew the file size initially and already allocated/read enough. Which is ok, but reads oddly.