From 6db93d98ab6b126faecda9846368016239097d4c Mon Sep 17 00:00:00 2001 From: jsg Date: Mon, 14 Feb 2022 12:54:43 +0000 Subject: [PATCH] OF_getproplen() returns -1 on error, so don't store result in size_t spotted by and ok tb@, ok tobhe@ --- sys/dev/ofw/ofw_regulator.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/dev/ofw/ofw_regulator.c b/sys/dev/ofw/ofw_regulator.c index bb0d6399451..c0b3deba12e 100644 --- a/sys/dev/ofw/ofw_regulator.c +++ b/sys/dev/ofw/ofw_regulator.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ofw_regulator.c,v 1.15 2020/12/23 11:58:36 kettenis Exp $ */ +/* $OpenBSD: ofw_regulator.c,v 1.16 2022/02/14 12:54:43 jsg Exp $ */ /* * Copyright (c) 2016 Mark Kettenis * @@ -328,8 +328,7 @@ regulator_gpio_get(int node) { uint32_t *gpio, *gpios, *states; uint32_t idx, value; - size_t glen, slen; - int i; + int glen, slen, i; pinctrl_byname(node, "default"); @@ -377,10 +376,9 @@ int regulator_gpio_set(int node, uint32_t value) { uint32_t *gpio, *gpios, *states; - size_t glen, slen; uint32_t min, max; uint32_t idx; - int i; + int glen, slen, i; pinctrl_byname(node, "default"); -- 2.20.1