diff mbox

ASoC: pcm512x: Do not redefine DIV_ROUND_CLOSEST_ULL

Message ID 1427765462-7318-1-git-send-email-festevam@gmail.com (mailing list archive)
State Accepted
Commit d48502eacd8934b79c3e62f7858c79fa6422398b
Headers show

Commit Message

Fabio Estevam March 31, 2015, 1:31 a.m. UTC
From: Fabio Estevam <fabio.estevam@freescale.com>

DIV_ROUND_CLOSEST_ULL is already defined at <linux/kernel.h>, so use the 
definition from this header file rather than re-defining it locally.

This fixes the following build warning:

sound/soc/codecs/pcm512x.c:34:0: warning: "DIV_ROUND_CLOSEST_ULL" redefined [enabled by default]
In file included from include/linux/list.h:8:0,
                 from include/linux/module.h:9,
                 from sound/soc/codecs/pcm512x.c:19:
include/linux/kernel.h:110:0: note: this is the location of the previous definition

Reported-by: Olof's autobuilder <build@lixom.net>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 sound/soc/codecs/pcm512x.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Mark Brown March 31, 2015, 7:12 a.m. UTC | #1
On Mon, Mar 30, 2015 at 10:31:02PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> DIV_ROUND_CLOSEST_ULL is already defined at <linux/kernel.h>, so use the 
> definition from this header file rather than re-defining it locally.

Someone already sent a patch for this, unfortunately the issue exists
only in -mm and akpm didn' pick the patch up yet.
diff mbox

Patch

diff --git a/sound/soc/codecs/pcm512x.c b/sound/soc/codecs/pcm512x.c
index 5a30fdd..e12764d 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] = {