mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ASoC: pcm512x: use DIV_ROUND_CLOSEST_ULL() from kernel.h
       [not found] <201503250933.dBZIxVT3%fengguang.wu@intel.com>
@ 2015-03-25 11:29 ` Javi Merino
  2015-03-25 16:20   ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Javi Merino @ 2015-03-25 11:29 UTC (permalink / raw)
  To: akpm
  Cc: hannes, kbuild-all, linux-mm, linux-kernel, Javi Merino,
	Peter Rosin, Mark Brown, Liam Girdwood, Jaroslav Kysela,
	Takashi Iwai

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

Cc: Peter Rosin <peda@axentia.se>
Cc: Mark Brown <broonie@kernel.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.de>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Javi Merino <javi.merino@arm.com>
---
Patches in the -mm tree now provide a DIV_ROUND_CLOSEST_ULL()
implementation in kernel.h[0].  If I understand it correctly, this
patch should go via the -mm tree as well with appropriate Acks from
the maintainers.

[0] http://ozlabs.org/~akpm/mmots/broken-out/kernelh-implement-div_round_closest_ull.patch

 sound/soc/codecs/pcm512x.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/sound/soc/codecs/pcm512x.c b/sound/soc/codecs/pcm512x.c
index 9974f201a08f..a3dad00b5afc 100644
--- a/sound/soc/codecs/pcm512x.c
+++ b/sound/soc/codecs/pcm512x.c
@@ -18,6 +18,7 @@
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/clk.h>
+#include <linux/kernel.h>
 #include <linux/pm_runtime.h>
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
@@ -31,8 +32,6 @@
 
 #define DIV_ROUND_DOWN_ULL(ll, d) \
 	({ unsigned long long _tmp = (ll); do_div(_tmp, d); _tmp; })
-#define DIV_ROUND_CLOSEST_ULL(ll, d) \
-	({ unsigned long long _tmp = (ll)+(d)/2; do_div(_tmp, d); _tmp; })
 
 #define PCM512x_NUM_SUPPLIES 3
 static const char * const pcm512x_supply_names[PCM512x_NUM_SUPPLIES] = {
-- 
1.9.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] ASoC: pcm512x: use DIV_ROUND_CLOSEST_ULL() from kernel.h
  2015-03-25 11:29 ` [PATCH] ASoC: pcm512x: use DIV_ROUND_CLOSEST_ULL() from kernel.h Javi Merino
@ 2015-03-25 16:20   ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2015-03-25 16:20 UTC (permalink / raw)
  To: Javi Merino
  Cc: akpm, hannes, kbuild-all, linux-mm, linux-kernel, Peter Rosin,
	Liam Girdwood, Jaroslav Kysela, Takashi Iwai

[-- Attachment #1: Type: text/plain, Size: 219 bytes --]

On Wed, Mar 25, 2015 at 11:29:44AM +0000, Javi Merino wrote:
> Now that the kernel provides DIV_ROUND_CLOSEST_ULL(), drop the internal
> implementation and use the kernel one.

Acked-by: Mark Brown <broonie@kernel.org>

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-25 16:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <201503250933.dBZIxVT3%fengguang.wu@intel.com>
2015-03-25 11:29 ` [PATCH] ASoC: pcm512x: use DIV_ROUND_CLOSEST_ULL() from kernel.h Javi Merino
2015-03-25 16:20   ` Mark Brown

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®