提交 14d5deba 编写于 作者: R Richard Knutsson 提交者: Mauro Carvalho Chehab

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: NRichard Knutsson <ricknu-0@student.ltu.se>
Signed-off-by: NHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: NMauro Carvalho Chehab <mchehab@infradead.org>
上级 d130fa8a
...@@ -983,7 +983,7 @@ static int __devinit ivtv_probe(struct pci_dev *dev, ...@@ -983,7 +983,7 @@ static int __devinit ivtv_probe(struct pci_dev *dev,
} }
itv = kzalloc(sizeof(struct ivtv), GFP_ATOMIC); itv = kzalloc(sizeof(struct ivtv), GFP_ATOMIC);
if (itv == 0) { if (itv == NULL) {
spin_unlock(&ivtv_cards_lock); spin_unlock(&ivtv_cards_lock);
return -ENOMEM; return -ENOMEM;
} }
......
...@@ -698,7 +698,7 @@ static int ivtv_debug_ioctls(struct file *filp, unsigned int cmd, void *arg) ...@@ -698,7 +698,7 @@ static int ivtv_debug_ioctls(struct file *filp, unsigned int cmd, void *arg)
ivtv_reset_ir_gpio(itv); ivtv_reset_ir_gpio(itv);
} }
if (val & 0x02) { if (val & 0x02) {
itv->video_dec_func(itv, cmd, 0); itv->video_dec_func(itv, cmd, NULL);
} }
break; break;
} }
......
...@@ -204,7 +204,7 @@ static int stream_enc_dma_append(struct ivtv_stream *s, u32 data[CX2341X_MBOX_MA ...@@ -204,7 +204,7 @@ static int stream_enc_dma_append(struct ivtv_stream *s, u32 data[CX2341X_MBOX_MA
s->sg_pending[idx].dst = buf->dma_handle; s->sg_pending[idx].dst = buf->dma_handle;
s->sg_pending[idx].src = offset; s->sg_pending[idx].src = offset;
s->sg_pending[idx].size = s->buf_size; s->sg_pending[idx].size = s->buf_size;
buf->bytesused = (size < s->buf_size) ? size : s->buf_size; buf->bytesused = min(size, s->buf_size);
buf->dma_xfer_cnt = s->dma_xfer_cnt; buf->dma_xfer_cnt = s->dma_xfer_cnt;
s->q_predma.bytesused += buf->bytesused; s->q_predma.bytesused += buf->bytesused;
...@@ -736,7 +736,7 @@ static void ivtv_irq_dec_data_req(struct ivtv *itv) ...@@ -736,7 +736,7 @@ static void ivtv_irq_dec_data_req(struct ivtv *itv)
s = &itv->streams[IVTV_DEC_STREAM_TYPE_YUV]; s = &itv->streams[IVTV_DEC_STREAM_TYPE_YUV];
} }
else { else {
itv->dma_data_req_size = data[2] >= 0x10000 ? 0x10000 : data[2]; itv->dma_data_req_size = min_t(u32, data[2], 0x10000);
itv->dma_data_req_offset = data[1]; itv->dma_data_req_offset = data[1];
s = &itv->streams[IVTV_DEC_STREAM_TYPE_MPG]; s = &itv->streams[IVTV_DEC_STREAM_TYPE_MPG];
} }
......
...@@ -572,10 +572,10 @@ int ivtv_start_v4l2_encode_stream(struct ivtv_stream *s) ...@@ -572,10 +572,10 @@ int ivtv_start_v4l2_encode_stream(struct ivtv_stream *s)
clear_bit(IVTV_F_I_EOS, &itv->i_flags); clear_bit(IVTV_F_I_EOS, &itv->i_flags);
/* Initialize Digitizer for Capture */ /* Initialize Digitizer for Capture */
itv->video_dec_func(itv, VIDIOC_STREAMOFF, 0); itv->video_dec_func(itv, VIDIOC_STREAMOFF, NULL);
ivtv_msleep_timeout(300, 1); ivtv_msleep_timeout(300, 1);
ivtv_vapi(itv, CX2341X_ENC_INITIALIZE_INPUT, 0); ivtv_vapi(itv, CX2341X_ENC_INITIALIZE_INPUT, 0);
itv->video_dec_func(itv, VIDIOC_STREAMON, 0); itv->video_dec_func(itv, VIDIOC_STREAMON, NULL);
} }
/* begin_capture */ /* begin_capture */
......
...@@ -1057,7 +1057,7 @@ static int ivtvfb_init_card(struct ivtv *itv) ...@@ -1057,7 +1057,7 @@ static int ivtvfb_init_card(struct ivtv *itv)
} }
itv->osd_info = kzalloc(sizeof(struct osd_info), GFP_ATOMIC); itv->osd_info = kzalloc(sizeof(struct osd_info), GFP_ATOMIC);
if (itv->osd_info == 0) { if (itv->osd_info == NULL) {
IVTVFB_ERR("Failed to allocate memory for osd_info\n"); IVTVFB_ERR("Failed to allocate memory for osd_info\n");
return -ENOMEM; return -ENOMEM;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册