From d302773e0e080a1ae5b27b90633c903b1ac8f625 Mon Sep 17 00:00:00 2001 From: riastradh Date: Wed, 20 Mar 2024 18:47:59 +0000 Subject: [PATCH] apei(4): Pacify -Wsign-compare. Assert that the parsing made forward progress too while here. PR kern/58046 --- sys/dev/acpi/apei_hest.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/dev/acpi/apei_hest.c b/sys/dev/acpi/apei_hest.c index d7549c61ce09..b35e48e911bd 100644 --- a/sys/dev/acpi/apei_hest.c +++ b/sys/dev/acpi/apei_hest.c @@ -1,4 +1,4 @@ -/* $NetBSD: apei_hest.c,v 1.1 2024/03/20 17:11:43 riastradh Exp $ */ +/* $NetBSD: apei_hest.c,v 1.2 2024/03/20 18:47:59 riastradh Exp $ */ /*- * Copyright (c) 2024 The NetBSD Foundation, Inc. @@ -46,7 +46,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: apei_hest.c,v 1.1 2024/03/20 17:11:43 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: apei_hest.c,v 1.2 2024/03/20 18:47:59 riastradh Exp $"); #include @@ -917,7 +917,9 @@ apei_hest_attach(struct apei_softc *sc) " %"PRIu32"\n", i); break; } - KASSERT((const char *)next - (const char *)header <= resid); + KASSERT(header < next); + KASSERT((size_t)((const char *)next - (const char *)header) <= + resid); resid -= (const char *)next - (const char *)header; } if (resid) {