diff options
author | Richard Knutsson <ricknu-0@student.ltu.se> | 2007-12-08 08:35:06 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-01-25 16:03:26 -0500 |
commit | 14d5deba2737c59444e805c10764d58a3d73e9b2 (patch) | |
tree | 89caa43d90e9c622261ede8f81999a7aee158aa8 /drivers/media/video/ivtv | |
parent | d130fa8a05ee5f39c786df02dd75d1eebb12633b (diff) |
V4L/DVB (6776): ivtv: Some general fixes
Fix "warning: Using plain integer as NULL pointer".
Convert 'x < y ? x : y' to use min() instead.
Signed-off-by: Richard Knutsson <ricknu-0@student.ltu.se>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/ivtv')
-rw-r--r-- | drivers/media/video/ivtv/ivtv-driver.c | 2 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-ioctl.c | 2 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-irq.c | 4 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtv-streams.c | 4 | ||||
-rw-r--r-- | drivers/media/video/ivtv/ivtvfb.c | 2 |
5 files changed, 7 insertions, 7 deletions
diff --git a/drivers/media/video/ivtv/ivtv-driver.c b/drivers/media/video/ivtv/ivtv-driver.c index 4994dc59d40c..2765624b230f 100644 --- a/drivers/media/video/ivtv/ivtv-driver.c +++ b/drivers/media/video/ivtv/ivtv-driver.c | |||
@@ -983,7 +983,7 @@ static int __devinit ivtv_probe(struct pci_dev *dev, | |||
983 | } | 983 | } |
984 | 984 | ||
985 | itv = kzalloc(sizeof(struct ivtv), GFP_ATOMIC); | 985 | itv = kzalloc(sizeof(struct ivtv), GFP_ATOMIC); |
986 | if (itv == 0) { | 986 | if (itv == NULL) { |
987 | spin_unlock(&ivtv_cards_lock); | 987 | spin_unlock(&ivtv_cards_lock); |
988 | return -ENOMEM; | 988 | return -ENOMEM; |
989 | } | 989 | } |
diff --git a/drivers/media/video/ivtv/ivtv-ioctl.c b/drivers/media/video/ivtv/ivtv-ioctl.c index 25b68843a289..edef2a579617 100644 --- a/drivers/media/video/ivtv/ivtv-ioctl.c +++ b/drivers/media/video/ivtv/ivtv-ioctl.c | |||
@@ -698,7 +698,7 @@ static int ivtv_debug_ioctls(struct file *filp, unsigned int cmd, void *arg) | |||
698 | ivtv_reset_ir_gpio(itv); | 698 | ivtv_reset_ir_gpio(itv); |
699 | } | 699 | } |
700 | if (val & 0x02) { | 700 | if (val & 0x02) { |
701 | itv->video_dec_func(itv, cmd, 0); | 701 | itv->video_dec_func(itv, cmd, NULL); |
702 | } | 702 | } |
703 | break; | 703 | break; |
704 | } | 704 | } |
diff --git a/drivers/media/video/ivtv/ivtv-irq.c b/drivers/media/video/ivtv/ivtv-irq.c index c5ea54e65272..65604dde9726 100644 --- a/drivers/media/video/ivtv/ivtv-irq.c +++ b/drivers/media/video/ivtv/ivtv-irq.c | |||
@@ -204,7 +204,7 @@ static int stream_enc_dma_append(struct ivtv_stream *s, u32 data[CX2341X_MBOX_MA | |||
204 | s->sg_pending[idx].dst = buf->dma_handle; | 204 | s->sg_pending[idx].dst = buf->dma_handle; |
205 | s->sg_pending[idx].src = offset; | 205 | s->sg_pending[idx].src = offset; |
206 | s->sg_pending[idx].size = s->buf_size; | 206 | s->sg_pending[idx].size = s->buf_size; |
207 | buf->bytesused = (size < s->buf_size) ? size : s->buf_size; | 207 | buf->bytesused = min(size, s->buf_size); |
208 | buf->dma_xfer_cnt = s->dma_xfer_cnt; | 208 | buf->dma_xfer_cnt = s->dma_xfer_cnt; |
209 | 209 | ||
210 | s->q_predma.bytesused += buf->bytesused; | 210 | s->q_predma.bytesused += buf->bytesused; |
@@ -736,7 +736,7 @@ static void ivtv_irq_dec_data_req(struct ivtv *itv) | |||
736 | s = &itv->streams[IVTV_DEC_STREAM_TYPE_YUV]; | 736 | s = &itv->streams[IVTV_DEC_STREAM_TYPE_YUV]; |
737 | } | 737 | } |
738 | else { | 738 | else { |
739 | itv->dma_data_req_size = data[2] >= 0x10000 ? 0x10000 : data[2]; | 739 | itv->dma_data_req_size = min_t(u32, data[2], 0x10000); |
740 | itv->dma_data_req_offset = data[1]; | 740 | itv->dma_data_req_offset = data[1]; |
741 | s = &itv->streams[IVTV_DEC_STREAM_TYPE_MPG]; | 741 | s = &itv->streams[IVTV_DEC_STREAM_TYPE_MPG]; |
742 | } | 742 | } |
diff --git a/drivers/media/video/ivtv/ivtv-streams.c b/drivers/media/video/ivtv/ivtv-streams.c index 3ca2a1a62a71..24d98ecf35ad 100644 --- a/drivers/media/video/ivtv/ivtv-streams.c +++ b/drivers/media/video/ivtv/ivtv-streams.c | |||
@@ -572,10 +572,10 @@ int ivtv_start_v4l2_encode_stream(struct ivtv_stream *s) | |||
572 | clear_bit(IVTV_F_I_EOS, &itv->i_flags); | 572 | clear_bit(IVTV_F_I_EOS, &itv->i_flags); |
573 | 573 | ||
574 | /* Initialize Digitizer for Capture */ | 574 | /* Initialize Digitizer for Capture */ |
575 | itv->video_dec_func(itv, VIDIOC_STREAMOFF, 0); | 575 | itv->video_dec_func(itv, VIDIOC_STREAMOFF, NULL); |
576 | ivtv_msleep_timeout(300, 1); | 576 | ivtv_msleep_timeout(300, 1); |
577 | ivtv_vapi(itv, CX2341X_ENC_INITIALIZE_INPUT, 0); | 577 | ivtv_vapi(itv, CX2341X_ENC_INITIALIZE_INPUT, 0); |
578 | itv->video_dec_func(itv, VIDIOC_STREAMON, 0); | 578 | itv->video_dec_func(itv, VIDIOC_STREAMON, NULL); |
579 | } | 579 | } |
580 | 580 | ||
581 | /* begin_capture */ | 581 | /* begin_capture */ |
diff --git a/drivers/media/video/ivtv/ivtvfb.c b/drivers/media/video/ivtv/ivtvfb.c index 1a73038ea811..3b23fc05f7c4 100644 --- a/drivers/media/video/ivtv/ivtvfb.c +++ b/drivers/media/video/ivtv/ivtvfb.c | |||
@@ -1057,7 +1057,7 @@ static int ivtvfb_init_card(struct ivtv *itv) | |||
1057 | } | 1057 | } |
1058 | 1058 | ||
1059 | itv->osd_info = kzalloc(sizeof(struct osd_info), GFP_ATOMIC); | 1059 | itv->osd_info = kzalloc(sizeof(struct osd_info), GFP_ATOMIC); |
1060 | if (itv->osd_info == 0) { | 1060 | if (itv->osd_info == NULL) { |
1061 | IVTVFB_ERR("Failed to allocate memory for osd_info\n"); | 1061 | IVTVFB_ERR("Failed to allocate memory for osd_info\n"); |
1062 | return -ENOMEM; | 1062 | return -ENOMEM; |
1063 | } | 1063 | } |