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

media: cx23885-alsa: number of pages should be unsigned long

As reported by smatch:

	drivers/media//pci/cx23885/cx23885-alsa.c:83 cx23885_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 99c2ec04
...@@ -68,7 +68,8 @@ MODULE_PARM_DESC(audio_debug, "enable debug messages [analog audio]"); ...@@ -68,7 +68,8 @@ MODULE_PARM_DESC(audio_debug, "enable debug messages [analog audio]");
#define AUD_INT_MCHG_IRQ (1 << 21) #define AUD_INT_MCHG_IRQ (1 << 21)
#define GP_COUNT_CONTROL_RESET 0x3 #define GP_COUNT_CONTROL_RESET 0x3
static int cx23885_alsa_dma_init(struct cx23885_audio_dev *chip, int nr_pages) static int cx23885_alsa_dma_init(struct cx23885_audio_dev *chip,
unsigned long nr_pages)
{ {
struct cx23885_audio_buffer *buf = chip->buf; struct cx23885_audio_buffer *buf = chip->buf;
struct page *pg; struct page *pg;
...@@ -76,11 +77,11 @@ static int cx23885_alsa_dma_init(struct cx23885_audio_dev *chip, int nr_pages) ...@@ -76,11 +77,11 @@ static int cx23885_alsa_dma_init(struct cx23885_audio_dev *chip, int nr_pages)
buf->vaddr = vmalloc_32(nr_pages << PAGE_SHIFT); buf->vaddr = vmalloc_32(nr_pages << PAGE_SHIFT);
if (NULL == buf->vaddr) { if (NULL == 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);
......
...@@ -326,7 +326,7 @@ struct cx23885_audio_buffer { ...@@ -326,7 +326,7 @@ struct cx23885_audio_buffer {
void *vaddr; void *vaddr;
struct scatterlist *sglist; struct scatterlist *sglist;
int sglen; int sglen;
int nr_pages; unsigned long nr_pages;
}; };
struct cx23885_audio_dev { struct cx23885_audio_dev {
......
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