lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160916201204.9424-9-nicstange@gmail.com>
Date:   Fri, 16 Sep 2016 22:12:01 +0200
From:   Nicolai Stange <nicstange@...il.com>
To:     Thomas Gleixner <tglx@...utronix.de>
Cc:     John Stultz <john.stultz@...aro.org>, linux-kernel@...r.kernel.org,
        Nicolai Stange <nicstange@...il.com>
Subject: [RFC v7 20/23] clockevents: purge ->min_delta_ns

The struct clock_event_device's ->min_delta_ns member isn't used anymore.

Purge it.

In __clockevents_update_bounds(), shortcut the
  ->min_delta_ticks => ->min_delta_ns => ->min_delta_ticks_adjusted
calculation detour -- it had been made solely for the purpose of ensuring
that ->min_delta_ticks_adjusted corresponds to something >= 1us.

Signed-off-by: Nicolai Stange <nicstange@...il.com>
---
 include/linux/clockchips.h |  2 --
 kernel/time/clockevents.c  | 12 +++++-------
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index 7c3a193..2ff15f03 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -94,7 +94,6 @@ enum clock_event_state {
  * @tick_resume:	resume clkevt device
  * @broadcast:		function to broadcast events
  * @min_delta_ticks:	minimum delta value in ticks stored for reconfiguration
- * @min_delta_ns:	minimum delta value in ns
  * @name:		ptr to clock event name
  * @rating:		variable to rate clock event devices
  * @irq:		IRQ number (only for non CPU local devices)
@@ -127,7 +126,6 @@ struct clock_event_device {
 	void			(*suspend)(struct clock_event_device *);
 	void			(*resume)(struct clock_event_device *);
 	unsigned long		min_delta_ticks;
-	u64			min_delta_ns;
 
 	const char		*name;
 	int			rating;
diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c
index 86d9f97..394b8dc 100644
--- a/kernel/time/clockevents.c
+++ b/kernel/time/clockevents.c
@@ -492,14 +492,12 @@ static void __clockevents_update_bounds(struct clock_event_device *dev)
 	}
 
 	/*
-	 * cev_delta2ns() never returns values less than 1us and thus,
-	 * we'll never program any ced with anything less.
+	 * Enforce ->min_delta_ticks_adjusted to correspond to a value
+	 * >= 1us.
 	 */
-	dev->min_delta_ns = cev_delta2ns(dev->min_delta_ticks, dev, false);
-	dev->min_delta_ticks_adjusted = (unsigned long)((dev->min_delta_ns *
-						dev->mult) >> dev->shift);
-	dev->min_delta_ticks_adjusted = max(dev->min_delta_ticks_adjusted,
-						dev->min_delta_ticks);
+	dev->min_delta_ticks_adjusted =
+		max(dev->min_delta_ticks,
+			(unsigned long)((1000ULL * dev->mult) >> dev->shift));
 }
 
 /**
-- 
2.10.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ