aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915
diff options
context:
space:
mode:
authorJavi Merino <javi.merino@arm.com>2015-04-16 15:43:45 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-17 09:03:55 -0400
commitf766093ecb647f5a87bfa456715abbbccee547ce (patch)
tree818e47743fc5216fe7647dca2d1d6ca4de78c824 /drivers/gpu/drm/i915
parent675cf53c1deaffadc7b6a0b4afe6cdafec86bedb (diff)
kernel.h: implement DIV_ROUND_CLOSEST_ULL
We have grown a number of different implementations of DIV_ROUND_CLOSEST_ULL throughout the kernel. Move the i915 one to kernel.h so that it can be reused. Signed-off-by: Javi Merino <javi.merino@arm.com> Reviewed-by: Jeff Epler <jepler@unpythonic.net> Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: David Airlie <airlied@linux.ie> Cc: Guenter Roeck <linux@roeck-us.net> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com> Cc: Alex Elder <elder@linaro.org> Cc: Antti Palosaari <crope@iki.fi> Cc: Javi Merino <javi.merino@arm.com> Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Cc: Mel Gorman <mgorman@suse.de> Cc: Mike Turquette <mturquette@linaro.org> Cc: Stephen Boyd <sboyd@codeaurora.org> Cc: Stephen Hemminger <shemminger@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/gpu/drm/i915')
-rw-r--r--drivers/gpu/drm/i915/intel_drv.h3
-rw-r--r--drivers/gpu/drm/i915/intel_panel.c1
2 files changed, 1 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index eef79ccd0b7c..ba243db35840 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -36,9 +36,6 @@
36#include <drm/drm_dp_mst_helper.h> 36#include <drm/drm_dp_mst_helper.h>
37#include <drm/drm_rect.h> 37#include <drm/drm_rect.h>
38 38
39#define DIV_ROUND_CLOSEST_ULL(ll, d) \
40({ unsigned long long _tmp = (ll)+(d)/2; do_div(_tmp, d); _tmp; })
41
42/** 39/**
43 * _wait_for - magic (register) wait macro 40 * _wait_for - magic (register) wait macro
44 * 41 *
diff --git a/drivers/gpu/drm/i915/intel_panel.c b/drivers/gpu/drm/i915/intel_panel.c
index d8686ce89160..08532d4ffe0a 100644
--- a/drivers/gpu/drm/i915/intel_panel.c
+++ b/drivers/gpu/drm/i915/intel_panel.c
@@ -30,6 +30,7 @@
30 30
31#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 31#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
32 32
33#include <linux/kernel.h>
33#include <linux/moduleparam.h> 34#include <linux/moduleparam.h>
34#include "intel_drv.h" 35#include "intel_drv.h"
35 36