Felix Held has submitted this change. ( https://review.coreboot.org/c/coreboot/+/49941 )
Change subject: soc/amd/picasso/chip: use switch/case statement in enable_dev() ......................................................................
soc/amd/picasso/chip: use switch/case statement in enable_dev()
The default case is only needed to make the compiler happy.
Signed-off-by: Felix Held felix-coreboot@felixheld.de Change-Id: Idf54e7128f9e9d96f15ac7ab121f22621e033fac Reviewed-on: https://review.coreboot.org/c/coreboot/+/49941 Reviewed-by: Raul Rangel rrangel@chromium.org Reviewed-by: Marshall Dawson marshalldawson3rd@gmail.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/soc/amd/picasso/chip.c 1 file changed, 9 insertions(+), 3 deletions(-)
Approvals: build bot (Jenkins): Verified Marshall Dawson: Looks good to me, approved Raul Rangel: Looks good to me, approved
diff --git a/src/soc/amd/picasso/chip.c b/src/soc/amd/picasso/chip.c index d31e94a..91dd4c4 100644 --- a/src/soc/amd/picasso/chip.c +++ b/src/soc/amd/picasso/chip.c @@ -82,12 +82,18 @@ static void enable_dev(struct device *dev) { /* Set the operations if it is a special bus type */ - if (dev->path.type == DEVICE_PATH_DOMAIN) { + switch (dev->path.type) { + case DEVICE_PATH_DOMAIN: dev->ops = &pci_domain_ops; - } else if (dev->path.type == DEVICE_PATH_CPU_CLUSTER) { + break; + case DEVICE_PATH_CPU_CLUSTER: dev->ops = &cpu_bus_ops; - } else if (dev->path.type == DEVICE_PATH_MMIO) { + break; + case DEVICE_PATH_MMIO: set_mmio_dev_ops(dev); + break; + default: + break; } }