Module Name: src
Committed By: jmcneill
Date: Wed Oct 24 11:04:54 UTC 2018
Modified Files:
src/sys/arch/arm/acpi: sbsawdt_acpi.c
Log Message:
Avoid overflow when calculating watchdog offset.
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/sys/arch/arm/acpi/sbsawdt_acpi.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/arm/acpi/sbsawdt_acpi.c
diff -u src/sys/arch/arm/acpi/sbsawdt_acpi.c:1.1 src/sys/arch/arm/acpi/sbsawdt_acpi.c:1.2
--- src/sys/arch/arm/acpi/sbsawdt_acpi.c:1.1 Wed Oct 24 11:01:47 2018
+++ src/sys/arch/arm/acpi/sbsawdt_acpi.c Wed Oct 24 11:04:54 2018
@@ -1,4 +1,4 @@
-/* $NetBSD: sbsawdt_acpi.c,v 1.1 2018/10/24 11:01:47 jmcneill Exp $ */
+/* $NetBSD: sbsawdt_acpi.c,v 1.2 2018/10/24 11:04:54 jmcneill Exp $ */
/*-
* Copyright (c) 2018 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sbsawdt_acpi.c,v 1.1 2018/10/24 11:01:47 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sbsawdt_acpi.c,v 1.2 2018/10/24 11:04:54 jmcneill Exp $");
#include <sys/param.h>
#include <sys/bus.h>
@@ -182,7 +182,7 @@ sbsawdt_acpi_setmode(struct sysmon_wdog
* second time that the offset is reached, the WD1 signal is raised
* which will either interrupt privileged software or cause a PE reset.
*/
- const uint32_t wor = (smw->smw_period * sc->sc_cntfreq) / 2;
+ const uint32_t wor = smw->smw_period * sc->sc_cntfreq / 2;
CONTROL_WR4(sc, C_WCS_REG, 0);
CONTROL_WR4(sc, C_WOR_REG, wor);