summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2019-11-14 11:15:19 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2019-11-14 11:48:32 +0100
commite9ae74369d8fd4e22998893f276472654b650504 (patch)
tree036311646e64eb8069dfce013f152290a6c058c4
parent5a1bc17970f1841f8956c3e2257639f4f0f03248 (diff)
downloadrtems-e9ae74369d8fd4e22998893f276472654b650504.tar.bz2
bsp/riscv: Fix use of uninitialized integer
-rw-r--r--bsps/riscv/riscv/console/console-config.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/bsps/riscv/riscv/console/console-config.c b/bsps/riscv/riscv/console/console-config.c
index 9a8195dda7..0e8262422a 100644
--- a/bsps/riscv/riscv/console/console-config.c
+++ b/bsps/riscv/riscv/console/console-config.c
@@ -161,7 +161,6 @@ static void riscv_console_probe(void)
ns16550_context *ctx;
fdt32_t *val;
int len;
- int reg_shift;
ctx = &ns16550_instances[ns16550_devices];
ctx->initial_baud = BSP_CONSOLE_BAUD;
@@ -169,11 +168,7 @@ static void riscv_console_probe(void)
/* Get register shift property of the UART device */
val = (fdt32_t *) fdt_getprop(fdt, node, "reg-shift", &len);
- if (val) {
- reg_shift = fdt32_to_cpu(val[0]);
- }
-
- if (reg_shift == 2) {
+ if (val != NULL && fdt32_to_cpu(val[0]) == 2) {
ctx->get_reg = riscv_console_get_reg_32;
ctx->set_reg = riscv_console_set_reg_32;
} else {