Эх сурвалжийг харах

ALSA: trident: Proper endian notations

The TLB entries in Trident driver are represented in little-endian,
hence they should be declared as __le32.

This patch fixes the sparse warnings like:
  sound/pci/trident/trident_memory.c:226:17: warning: incorrect type in assignment (different base types)

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai 7 жил өмнө
parent
commit
752089fea3

+ 1 - 1
sound/pci/trident/trident.h

@@ -264,7 +264,7 @@ struct snd_trident_memblk_arg {
 };
 };
 
 
 struct snd_trident_tlb {
 struct snd_trident_tlb {
-	unsigned int * entries;		/* 16k-aligned TLB table */
+	__le32 *entries;		/* 16k-aligned TLB table */
 	dma_addr_t entries_dmaaddr;	/* 16k-aligned PCI address to TLB table */
 	dma_addr_t entries_dmaaddr;	/* 16k-aligned PCI address to TLB table */
 	unsigned long * shadow_entries;	/* shadow entries with virtual addresses */
 	unsigned long * shadow_entries;	/* shadow entries with virtual addresses */
 	struct snd_dma_buffer buffer;
 	struct snd_dma_buffer buffer;

+ 1 - 1
sound/pci/trident/trident_main.c

@@ -3359,7 +3359,7 @@ static int snd_trident_tlb_alloc(struct snd_trident *trident)
 		dev_err(trident->card->dev, "unable to allocate TLB buffer\n");
 		dev_err(trident->card->dev, "unable to allocate TLB buffer\n");
 		return -ENOMEM;
 		return -ENOMEM;
 	}
 	}
-	trident->tlb.entries = (unsigned int*)ALIGN((unsigned long)trident->tlb.buffer.area, SNDRV_TRIDENT_MAX_PAGES * 4);
+	trident->tlb.entries = (__le32 *)ALIGN((unsigned long)trident->tlb.buffer.area, SNDRV_TRIDENT_MAX_PAGES * 4);
 	trident->tlb.entries_dmaaddr = ALIGN(trident->tlb.buffer.addr, SNDRV_TRIDENT_MAX_PAGES * 4);
 	trident->tlb.entries_dmaaddr = ALIGN(trident->tlb.buffer.addr, SNDRV_TRIDENT_MAX_PAGES * 4);
 	/* allocate shadow TLB page table (virtual addresses) */
 	/* allocate shadow TLB page table (virtual addresses) */
 	trident->tlb.shadow_entries =
 	trident->tlb.shadow_entries =