Commit b4e0a5f9 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

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: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 74637731
......@@ -47,7 +47,7 @@ struct cx88_audio_buffer {
void *vaddr;
struct scatterlist *sglist;
int sglen;
int nr_pages;
unsigned long nr_pages;
};
struct cx88_audio_dev {
......@@ -271,7 +271,8 @@ static irqreturn_t cx8801_irq(int irq, void *dev_id)
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 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);
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;
}
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);
memset(buf->vaddr, 0, nr_pages << PAGE_SHIFT);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment