mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-16 01:24:08 +08:00
media: cx88-alsa: number of pages should be unsigned long
As reported by smatch: drivers/media/pci/cx88/cx88-alsa.c:286 cx88_alsa_dma_init() warn: should 'nr_pages << 12' be a 64 bit type? the number of patches should be unsigned long. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
parent
7463773187
commit
b4e0a5f9c0
@ -42,12 +42,12 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
struct cx88_audio_buffer {
|
struct cx88_audio_buffer {
|
||||||
unsigned int bpl;
|
unsigned int bpl;
|
||||||
struct cx88_riscmem risc;
|
struct cx88_riscmem risc;
|
||||||
void *vaddr;
|
void *vaddr;
|
||||||
struct scatterlist *sglist;
|
struct scatterlist *sglist;
|
||||||
int sglen;
|
int sglen;
|
||||||
int nr_pages;
|
unsigned long nr_pages;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct cx88_audio_dev {
|
struct cx88_audio_dev {
|
||||||
@ -271,7 +271,8 @@ static irqreturn_t cx8801_irq(int irq, void *dev_id)
|
|||||||
return IRQ_RETVAL(handled);
|
return IRQ_RETVAL(handled);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cx88_alsa_dma_init(struct cx88_audio_dev *chip, int nr_pages)
|
static int cx88_alsa_dma_init(struct cx88_audio_dev *chip,
|
||||||
|
unsigned long nr_pages)
|
||||||
{
|
{
|
||||||
struct cx88_audio_buffer *buf = chip->buf;
|
struct cx88_audio_buffer *buf = chip->buf;
|
||||||
struct page *pg;
|
struct page *pg;
|
||||||
@ -279,11 +280,11 @@ static int cx88_alsa_dma_init(struct cx88_audio_dev *chip, int nr_pages)
|
|||||||
|
|
||||||
buf->vaddr = vmalloc_32(nr_pages << PAGE_SHIFT);
|
buf->vaddr = vmalloc_32(nr_pages << PAGE_SHIFT);
|
||||||
if (!buf->vaddr) {
|
if (!buf->vaddr) {
|
||||||
dprintk(1, "vmalloc_32(%d pages) failed\n", nr_pages);
|
dprintk(1, "vmalloc_32(%lu pages) failed\n", nr_pages);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
dprintk(1, "vmalloc is at addr %p, size=%d\n",
|
dprintk(1, "vmalloc is at addr %p, size=%lu\n",
|
||||||
buf->vaddr, nr_pages << PAGE_SHIFT);
|
buf->vaddr, nr_pages << PAGE_SHIFT);
|
||||||
|
|
||||||
memset(buf->vaddr, 0, nr_pages << PAGE_SHIFT);
|
memset(buf->vaddr, 0, nr_pages << PAGE_SHIFT);
|
||||||
|
Loading…
Reference in New Issue
Block a user