unsigned long size;
/* refuse queue setup if port is not configured */
- if (dev->capture.port == NULL) {
+ if (!dev->capture.port) {
v4l2_err(&dev->v4l2_dev,
"%s: capture port not configured\n", __func__);
return -EINVAL;
v4l2_dbg(1, bcm2835_v4l2_debug, &dev->v4l2_dev, "%s: dev:%p\n",
__func__, dev);
- BUG_ON(dev->capture.port == NULL);
- BUG_ON(dev->capture.fmt == NULL);
+ BUG_ON(!dev->capture.port);
+ BUG_ON(!dev->capture.fmt);
size = dev->capture.stride * dev->capture.height;
if (vb2_plane_size(vb, 0) < size) {
if (status != 0) {
/* error in transfer */
- if (buf != NULL) {
+ if (buf) {
/* there was a buffer with the error so return it */
vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR);
}
return;
} else if (length == 0) {
/* stream ended */
- if (buf != NULL) {
+ if (buf) {
/* this should only ever happen if the port is
* disabled and there are buffers still queued
*/
__func__, dev);
/* ensure a format has actually been set */
- if (dev->capture.port == NULL)
+ if (!dev->capture.port)
return -EINVAL;
if (enable_camera(dev) < 0) {
dev->capture.frame_count = 0;
/* ensure a format has actually been set */
- if (dev->capture.port == NULL) {
+ if (!dev->capture.port) {
v4l2_err(&dev->v4l2_dev,
"no capture port - stream not started?\n");
return;
{ \
v4l2_dbg(level, debug, dev, \
"%s: w %u h %u field %u pfmt 0x%x bpl %u sz_img %u colorspace 0x%x priv %u\n", \
- desc == NULL ? "" : desc, \
+ !desc ? "" : desc, \
(pix_fmt)->width, (pix_fmt)->height, (pix_fmt)->field, \
(pix_fmt)->pixelformat, (pix_fmt)->bytesperline, \
(pix_fmt)->sizeimage, (pix_fmt)->colorspace, (pix_fmt)->priv); \
v4l2_dbg(level, debug, dev, \
"%s: w %u h %u l %u t %u field %u chromakey %06X clip %p " \
"clipcount %u bitmap %p\n", \
- desc == NULL ? "" : desc, \
+ !desc ? "" : desc, \
(win_fmt)->w.width, (win_fmt)->w.height, \
(win_fmt)->w.left, (win_fmt)->w.top, \
(win_fmt)->field, \
const struct bm2835_mmal_v4l2_ctrl *mmal_ctrl = ctrl->priv;
int ret;
- if ((mmal_ctrl == NULL) ||
- (mmal_ctrl->id != ctrl->id) ||
- (mmal_ctrl->setter == NULL)) {
+ if (!mmal_ctrl || mmal_ctrl->id != ctrl->id || !mmal_ctrl->setter) {
pr_warn("mmal_ctrl:%p ctrl id:%d\n", mmal_ctrl, ctrl->id);
return -EINVAL;
}
* should be verified the address lies in the kernel
* address space.
*/
- if (msg->h.context == NULL) {
+ if (!msg->h.context) {
pr_err("received message context was null!\n");
vchi_held_msg_release(&msg_handle);
break;
return 0;
/* ensure there are enough buffers queued to cover the buffer headers */
- if (port->buffer_cb != NULL) {
+ if (port->buffer_cb) {
hdr_count = 0;
list_for_each(buf_head, &port->buffers) {
hdr_count++;
return -EINTR;
/* disconnect ports if connected */
- if (src->connected != NULL) {
+ if (src->connected) {
ret = port_disable(instance, src);
if (ret) {
pr_err("failed disabling src port(%d)\n", ret);
src->connected = NULL;
}
- if (dst == NULL) {
+ if (!dst) {
/* do not make new connection */
ret = 0;
pr_debug("not making new connection\n");
{
int status = 0;
- if (instance == NULL)
+ if (!instance)
return -EINVAL;
if (mutex_lock_interruptible(&instance->vchiq_mutex))