diff mbox

[1/2] ASoC: wm_adsp: Use __leXX for little endian data

Message ID 1429534365-13439-1-git-send-email-ckeepax@opensource.wolfsonmicro.com (mailing list archive)
State Accepted
Commit 8299ee8123a7ef708811c3ff09eae0cf0874b651
Headers show

Commit Message

Charles Keepax April 20, 2015, 12:52 p.m. UTC
Using uXX for little endian data, was triggering some warnings through
sparse:

sound/soc/codecs/wm_adsp.c:716:26: sparse: cast to restricted __le16
sound/soc/codecs/wm_adsp.c:736:23: sparse: cast to restricted __le16
sound/soc/codecs/wm_adsp.c:739:23: sparse: cast to restricted __le32

Correct this by changing the casts to use __leXX instead of uXX.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
---
 sound/soc/codecs/wm_adsp.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

Comments

Mark Brown April 20, 2015, 1:59 p.m. UTC | #1
On Mon, Apr 20, 2015 at 01:52:44PM +0100, Charles Keepax wrote:
> Using uXX for little endian data, was triggering some warnings through
> sparse:

Applied both, thanks.
diff mbox

Patch

diff --git a/sound/soc/codecs/wm_adsp.c b/sound/soc/codecs/wm_adsp.c
index 00289bf..53fc7f8 100644
--- a/sound/soc/codecs/wm_adsp.c
+++ b/sound/soc/codecs/wm_adsp.c
@@ -713,7 +713,7 @@  static int wm_coeff_parse_string(int bytes, const u8 **pos, const u8 **str)
 		length = **pos;
 		break;
 	case 2:
-		length = le16_to_cpu(*((u16 *)*pos));
+		length = le16_to_cpu(*((__le16 *)*pos));
 		break;
 	default:
 		return 0;
@@ -733,10 +733,10 @@  static int wm_coeff_parse_int(int bytes, const u8 **pos)
 
 	switch (bytes) {
 	case 2:
-		val = le16_to_cpu(*((u16 *)*pos));
+		val = le16_to_cpu(*((__le16 *)*pos));
 		break;
 	case 4:
-		val = le32_to_cpu(*((u32 *)*pos));
+		val = le32_to_cpu(*((__le32 *)*pos));
 		break;
 	default:
 		break;