[alsa-devel] [PATCH 2/2] ALSA: lx6464es: Fix pointer cast compile warnings

Takashi Iwai tiwai at suse.de
Wed Nov 6 18:23:09 CET 2013


At Wed,  6 Nov 2013 17:58:06 +0100,
Takashi Iwai wrote:
> 
> The warnings are really harmless but annoying.  Since they are only
> about debug prints, and it's at most 32bit DMA, let's just cast to
> unsigned long.
> 
>   sound/pci/lx6464es/lx6464es.c:457:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
>   sound/pci/lx6464es/lx_core.c:1195:21: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
> 
> Signed-off-by: Takashi Iwai <tiwai at suse.de>

Oops, the wrong one was sent.  The correct one is below.


Takashi
---
From: Takashi Iwai <tiwai at suse.de>
Subject: [PATCH 2/2] ALSA: lx6464es: Fix pointer cast compile warnings

The warnings are really harmless but annoying.  Since they are only
about debug prints, and it's at most 32bit DMA, let's just cast to
unsigned long.

  sound/pci/lx6464es/lx6464es.c:457:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
  sound/pci/lx6464es/lx_core.c:1195:21: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]

Signed-off-by: Takashi Iwai <tiwai at suse.de>
---
 sound/pci/lx6464es/lx6464es.c | 4 ++--
 sound/pci/lx6464es/lx_core.c  | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/sound/pci/lx6464es/lx6464es.c b/sound/pci/lx6464es/lx6464es.c
index 3230e57f246c..5fcaaa6da4a8 100644
--- a/sound/pci/lx6464es/lx6464es.c
+++ b/sound/pci/lx6464es/lx6464es.c
@@ -453,8 +453,8 @@ static void lx_trigger_start(struct lx6464es *chip, struct lx_stream *lx_stream)
 				     lower_32_bits(buf), upper_32_bits(buf),
 				     &buffer_index);
 
-		snd_printdd(LXP "starting: buffer index %x on %p (%d bytes)\n",
-			    buffer_index, (void *)buf, period_bytes);
+		snd_printdd(LXP "starting: buffer index %x on 0x%lx (%d bytes)\n",
+			    buffer_index, (unsigned long)buf, period_bytes);
 		buf += period_bytes;
 	}
 
diff --git a/sound/pci/lx6464es/lx_core.c b/sound/pci/lx6464es/lx_core.c
index 633c8607d053..626ecad4dae7 100644
--- a/sound/pci/lx6464es/lx_core.c
+++ b/sound/pci/lx6464es/lx_core.c
@@ -1191,8 +1191,8 @@ static int lx_interrupt_request_new_buffer(struct lx6464es *chip,
 	unpack_pointer(buf, &buf_lo, &buf_hi);
 	err = lx_buffer_give(chip, 0, is_capture, period_bytes, buf_lo, buf_hi,
 			     &buffer_index);
-	snd_printdd(LXP "interrupt: gave buffer index %x on %p (%d bytes)\n",
-		    buffer_index, (void *)buf, period_bytes);
+	snd_printdd(LXP "interrupt: gave buffer index %x on 0x%lx (%d bytes)\n",
+		    buffer_index, (unsigned long)buf, period_bytes);
 
 	lx_stream->frame_pos = next_pos;
 	spin_unlock_irqrestore(&chip->lock, flags);
-- 
1.8.4.2



More information about the Alsa-devel mailing list