acpihpet(4): don't truncate HPET frequency to 32-bit value
authorcheloha <cheloha@openbsd.org>
Thu, 25 Aug 2022 18:01:54 +0000 (18:01 +0000)
committercheloha <cheloha@openbsd.org>
Thu, 25 Aug 2022 18:01:54 +0000 (18:01 +0000)
timecounter.tc_frequency is a 64-bit value: this cast is unnecessary.

Split off from the acpihpet_delay() commit at jsg@'s suggestion.

Link1: https://marc.info/?l=openbsd-tech&m=166053729104923&w=2
Link2: https://marc.info/?l=openbsd-tech&m=166132727120528&w=2

probably ok jsg@

sys/dev/acpi/acpihpet.c

index 87eaf02..bb1e6c5 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: acpihpet.c,v 1.27 2022/08/25 17:54:33 cheloha Exp $ */
+/* $OpenBSD: acpihpet.c,v 1.28 2022/08/25 18:01:54 cheloha Exp $ */
 /*
  * Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
  *
@@ -264,7 +264,7 @@ acpihpet_attach(struct device *parent, struct device *self, void *aux)
        freq = 1000000000000000ull / period;
        printf(": %lld Hz\n", freq);
 
-       hpet_timecounter.tc_frequency = (uint32_t)freq;
+       hpet_timecounter.tc_frequency = freq;
        hpet_timecounter.tc_priv = sc;
        hpet_timecounter.tc_name = sc->sc_dev.dv_xname;
        tc_init(&hpet_timecounter);