soc/amd/common/espi_util: simplify espi_std_io_decode function
We can just return at all places where the ret variable was written before its value gets returned at the end of the function. Change-Id: Id87f41c0d9e3397879ac3d15b13179cca1a1263f Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/44350 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Furquan Shaikh <furquan@google.com>
This commit is contained in:
parent
f08fbf882a
commit
4bf419fbf7
|
@ -104,29 +104,21 @@ static int espi_get_unused_io_window(void)
|
||||||
*/
|
*/
|
||||||
static int espi_std_io_decode(uint16_t base, size_t size)
|
static int espi_std_io_decode(uint16_t base, size_t size)
|
||||||
{
|
{
|
||||||
int ret = -1;
|
|
||||||
|
|
||||||
if (size != 1)
|
if (size != 1)
|
||||||
return ret;
|
return -1;
|
||||||
|
|
||||||
switch (base) {
|
switch (base) {
|
||||||
case 0x80:
|
case 0x80:
|
||||||
ret = ESPI_DECODE_IO_0x80_EN;
|
return ESPI_DECODE_IO_0x80_EN;
|
||||||
break;
|
|
||||||
case 0x60:
|
case 0x60:
|
||||||
case 0x64:
|
case 0x64:
|
||||||
ret = ESPI_DECODE_IO_0X60_0X64_EN;
|
return ESPI_DECODE_IO_0X60_0X64_EN;
|
||||||
break;
|
|
||||||
case 0x2e:
|
case 0x2e:
|
||||||
case 0x2f:
|
case 0x2f:
|
||||||
ret = ESPI_DECODE_IO_0X2E_0X2F_EN;
|
return ESPI_DECODE_IO_0X2E_0X2F_EN;
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
ret = -1;
|
return -1;
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static size_t espi_get_io_window_size(int idx)
|
static size_t espi_get_io_window_size(int idx)
|
||||||
|
|
Loading…
Reference in New Issue