mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Javi Merino <javi.merino@arm.com>
To: akpm@linux-foundation.org
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, emil.l.velikov@gmail.com,
	jepler@unpythonic.net, daniel@ffwll.ch,
	Javi Merino <javi.merino@arm.com>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Mel Gorman <mgorman@suse.de>,
	Stephen Hemminger <shemminger@linux-foundation.org>
Subject: [PATCH v2 3/4] cpuidle: menu: use DIV_ROUND_CLOSEST_ULL()
Date: Tue, 24 Mar 2015 14:03:44 +0000	[thread overview]
Message-ID: <1427205825-5444-4-git-send-email-javi.merino@arm.com> (raw)
In-Reply-To: <1427205825-5444-1-git-send-email-javi.merino@arm.com>

Now that the kernel provides DIV_ROUND_CLOSEST_ULL(), drop the internal
implementation and use the kernel one.

Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Stephen Hemminger <shemminger@linux-foundation.org>
Signed-off-by: Javi Merino <javi.merino@arm.com>
---
 drivers/cpuidle/governors/menu.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c
index 40580794e23d..b8a5fa15ca24 100644
--- a/drivers/cpuidle/governors/menu.c
+++ b/drivers/cpuidle/governors/menu.c
@@ -190,12 +190,6 @@ static DEFINE_PER_CPU(struct menu_device, menu_devices);
 
 static void menu_update(struct cpuidle_driver *drv, struct cpuidle_device *dev);
 
-/* This implements DIV_ROUND_CLOSEST but avoids 64 bit division */
-static u64 div_round64(u64 dividend, u32 divisor)
-{
-	return div_u64(dividend + (divisor / 2), divisor);
-}
-
 /*
  * Try detecting repeating patterns by keeping track of the last 8
  * intervals, and checking if the standard deviation of that set
@@ -317,7 +311,7 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev)
 	 * operands are 32 bits.
 	 * Make sure to round up for half microseconds.
 	 */
-	data->predicted_us = div_round64((uint64_t)data->next_timer_us *
+	data->predicted_us = DIV_ROUND_CLOSEST_ULL((uint64_t)data->next_timer_us *
 					 data->correction_factor[data->bucket],
 					 RESOLUTION * DECAY);
 
-- 
1.9.1


  parent reply	other threads:[~2015-03-24 14:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-24 14:03 [PATCH v2 0/4] Consolidate DIV_ROUND_CLOSEST_ULL() Javi Merino
2015-03-24 14:03 ` [PATCH v2 1/4] kernel.h: Implement DIV_ROUND_CLOSEST_ULL Javi Merino
2015-03-24 14:29   ` Jeff Epler
2015-03-24 14:03 ` [PATCH v2 2/4] clk: bcm/kona: use DIV_ROUND_CLOSEST_ULL() Javi Merino
2015-03-24 18:03   ` Alex Elder
2015-03-24 14:03 ` Javi Merino [this message]
2015-03-24 20:22   ` [PATCH v2 3/4] cpuidle: menu: " Rafael J. Wysocki
2015-03-25 11:40   ` Rafael J. Wysocki
2015-03-24 14:03 ` [PATCH v2 4/4] media: cxd2820r: " Javi Merino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1427205825-5444-4-git-send-email-javi.merino@arm.com \
    --to=javi.merino@arm.com \
    --cc=akpm@linux-foundation.org \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emil.l.velikov@gmail.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jepler@unpythonic.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgorman@suse.de \
    --cc=rafael.j.wysocki@intel.com \
    --cc=shemminger@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®