Attention is currently required from: Jason Glenesk, Raul Rangel, Marshall Dawson. Felix Held has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/60206 )
Change subject: soc/amd/common/lpc/espi_util: simplify espi_configure_decodes ......................................................................
soc/amd/common/lpc/espi_util: simplify espi_configure_decodes
The intermediate ret variable isn't needed. espi_open_generic_io_window only returns 0 or -1, so if ret is != 0, it has to be -1. This is a preparation to use the enum cb_err type for the return values.
Signed-off-by: Felix Held felix-coreboot@felixheld.de Change-Id: Ia6c7f4cedf8c2defadcf4c4da1697a97c7b401f2 --- M src/soc/amd/common/block/lpc/espi_util.c 1 file changed, 4 insertions(+), 5 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/06/60206/1
diff --git a/src/soc/amd/common/block/lpc/espi_util.c b/src/soc/amd/common/block/lpc/espi_util.c index 7261bb9..d495a0e 100644 --- a/src/soc/amd/common/block/lpc/espi_util.c +++ b/src/soc/amd/common/block/lpc/espi_util.c @@ -300,17 +300,16 @@
static int espi_configure_decodes(const struct espi_config *cfg) { - int i, ret; + int i;
espi_enable_decode(cfg->std_io_decode_bitmap);
for (i = 0; i < ESPI_GENERIC_IO_WIN_COUNT; i++) { if (cfg->generic_io_range[i].size == 0) continue; - ret = espi_open_generic_io_window(cfg->generic_io_range[i].base, - cfg->generic_io_range[i].size); - if (ret) - return ret; + if (espi_open_generic_io_window(cfg->generic_io_range[i].base, + cfg->generic_io_range[i].size)) + return -1; }
return 0;