@@ -41,7 +41,7 @@ static int uvc_ioctl_ctrl_map(struct uvc_video_chain *chain,
int ret;
map = kzalloc(sizeof *map, GFP_KERNEL);
- if (map == NULL)
+ if (!map)
return -ENOMEM;
map->id = xmap->id;
@@ -211,7 +211,7 @@ static int uvc_v4l2_try_format(struct uvc_streaming *stream,
break;
}
- if (frame == NULL) {
+ if (!frame) {
uvc_trace(UVC_TRACE_FORMAT, "Unsupported size %ux%u.\n",
fmt->fmt.pix.width, fmt->fmt.pix.height);
return -EINVAL;
@@ -260,9 +260,9 @@ static int uvc_v4l2_try_format(struct uvc_streaming *stream,
fmt->fmt.pix.colorspace = format->colorspace;
fmt->fmt.pix.priv = 0;
- if (uvc_format != NULL)
+ if (uvc_format)
*uvc_format = format;
- if (uvc_frame != NULL)
+ if (uvc_frame)
*uvc_frame = frame;
done:
@@ -282,8 +282,7 @@ static int uvc_v4l2_get_format(struct uvc_streaming *stream,
mutex_lock(&stream->mutex);
format = stream->cur_format;
frame = stream->cur_frame;
-
- if (format == NULL || frame == NULL) {
+ if (!format || !frame) {
ret = -EINVAL;
goto done;
}
@@ -499,7 +498,7 @@ static int uvc_v4l2_open(struct file *file)
/* Create the device handle. */
handle = kzalloc(sizeof *handle, GFP_KERNEL);
- if (handle == NULL) {
+ if (!handle) {
usb_autopm_put_interface(stream->dev->intf);
return -ENOMEM;
}
@@ -811,7 +810,7 @@ static int uvc_ioctl_enum_input(struct file *file, void *fh,
u32 index = input->index;
int pin = 0;
- if (selector == NULL ||
+ if (!selector ||
(chain->dev->quirks & UVC_QUIRK_IGNORE_SELECTOR_UNIT)) {
if (index != 0)
return -EINVAL;
@@ -830,7 +829,7 @@ static int uvc_ioctl_enum_input(struct file *file, void *fh,
}
}
- if (iterm == NULL || iterm->id != pin)
+ if (!iterm || iterm->id != pin)
return -EINVAL;
memset(input, 0, sizeof(*input));
@@ -849,7 +848,7 @@ static int uvc_ioctl_g_input(struct file *file, void *fh, unsigned int *input)
int ret;
u8 i;
- if (chain->selector == NULL ||
+ if (!chain->selector ||
(chain->dev->quirks & UVC_QUIRK_IGNORE_SELECTOR_UNIT)) {
*input = 0;
return 0;
@@ -876,7 +875,7 @@ static int uvc_ioctl_s_input(struct file *file, void *fh, unsigned int input)
if (ret < 0)
return ret;
- if (chain->selector == NULL ||
+ if (!chain->selector ||
(chain->dev->quirks & UVC_QUIRK_IGNORE_SELECTOR_UNIT)) {
if (input)
return -EINVAL;
@@ -1160,7 +1159,7 @@ static int uvc_ioctl_enum_framesizes(struct file *file, void *fh,
break;
}
}
- if (format == NULL)
+ if (!format)
return -EINVAL;
if (fsize->index >= format->nframes)
@@ -1189,7 +1188,7 @@ static int uvc_ioctl_enum_frameintervals(struct file *file, void *fh,
break;
}
}
- if (format == NULL)
+ if (!format)
return -EINVAL;
for (i = 0; i < format->nframes; i++) {
@@ -1199,7 +1198,7 @@ static int uvc_ioctl_enum_frameintervals(struct file *file, void *fh,
break;
}
}
- if (frame == NULL)
+ if (!frame)
return -EINVAL;
if (frame->bFrameIntervalType) {