media: usb: cpia2: Fixed Coding Style issues

Fixed all the Coding style issues generated by checkpatch.pl.
The changes made considering the --strict option.

Signed-off-by: Piyush Thange <pthange19@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Piyush Thange 2021-05-26 17:26:19 +02:00 committed by Mauro Carvalho Chehab
parent 5d11e6aad1
commit 584b2373ee

View File

@ -153,7 +153,6 @@ static ssize_t cpia2_v4l_read(struct file *file, char __user *buf, size_t count,
return ret; return ret;
} }
/****************************************************************************** /******************************************************************************
* *
* cpia2_v4l_poll * cpia2_v4l_poll
@ -170,7 +169,6 @@ static __poll_t cpia2_v4l_poll(struct file *filp, struct poll_table_struct *wait
return res; return res;
} }
static int sync(struct camera_data *cam, int frame_nr) static int sync(struct camera_data *cam, int frame_nr)
{ {
struct framebuf *frame = &cam->buffers[frame_nr]; struct framebuf *frame = &cam->buffers[frame_nr];
@ -383,7 +381,8 @@ static int cpia2_s_fmt_vid_cap(struct file *file, void *_fh,
cam->pixelformat = f->fmt.pix.pixelformat; cam->pixelformat = f->fmt.pix.pixelformat;
/* NOTE: This should be set to 1 for MJPEG, but some apps don't handle /* NOTE: This should be set to 1 for MJPEG, but some apps don't handle
* the missing Huffman table properly. */ * the missing Huffman table properly.
*/
cam->params.compression.inhibit_htables = 0; cam->params.compression.inhibit_htables = 0;
/*f->fmt.pix.pixelformat == V4L2_PIX_FMT_MJPEG;*/ /*f->fmt.pix.pixelformat == V4L2_PIX_FMT_MJPEG;*/
@ -549,7 +548,6 @@ static const struct {
static int cpia2_enum_framesizes(struct file *file, void *fh, static int cpia2_enum_framesizes(struct file *file, void *fh,
struct v4l2_frmsizeenum *fsize) struct v4l2_frmsizeenum *fsize)
{ {
if (fsize->pixel_format != V4L2_PIX_FMT_MJPEG && if (fsize->pixel_format != V4L2_PIX_FMT_MJPEG &&
fsize->pixel_format != V4L2_PIX_FMT_JPEG) fsize->pixel_format != V4L2_PIX_FMT_JPEG)
return -EINVAL; return -EINVAL;
@ -665,9 +663,8 @@ static int cpia2_g_jpegcomp(struct file *file, void *fh, struct v4l2_jpegcompres
parms->quality = 80; // TODO: Can this be made meaningful? parms->quality = 80; // TODO: Can this be made meaningful?
parms->jpeg_markers = V4L2_JPEG_MARKER_DQT | V4L2_JPEG_MARKER_DRI; parms->jpeg_markers = V4L2_JPEG_MARKER_DQT | V4L2_JPEG_MARKER_DRI;
if(!cam->params.compression.inhibit_htables) { if (!cam->params.compression.inhibit_htables)
parms->jpeg_markers |= V4L2_JPEG_MARKER_DHT; parms->jpeg_markers |= V4L2_JPEG_MARKER_DHT;
}
parms->APPn = cam->APPn; parms->APPn = cam->APPn;
parms->APP_len = cam->APP_len; parms->APP_len = cam->APP_len;
@ -849,6 +846,7 @@ static int find_earliest_filled_buffer(struct camera_data *cam)
{ {
int i; int i;
int found = -1; int found = -1;
for (i = 0; i < cam->num_frames; i++) { for (i = 0; i < cam->num_frames; i++) {
if (cam->buffers[i].status == FRAME_READY) { if (cam->buffers[i].status == FRAME_READY) {
if (found < 0) { if (found < 0) {
@ -888,6 +886,7 @@ static int cpia2_dqbuf(struct file *file, void *fh, struct v4l2_buffer *buf)
if (frame < 0) { if (frame < 0) {
/* Wait for a frame to become available */ /* Wait for a frame to become available */
struct framebuf *cb = cam->curbuff; struct framebuf *cb = cam->curbuff;
mutex_unlock(&cam->v4l2_lock); mutex_unlock(&cam->v4l2_lock);
wait_event_interruptible(cam->wq_stream, wait_event_interruptible(cam->wq_stream,
!video_is_registered(&cam->vdev) || !video_is_registered(&cam->vdev) ||
@ -900,7 +899,6 @@ static int cpia2_dqbuf(struct file *file, void *fh, struct v4l2_buffer *buf)
frame = cb->num; frame = cb->num;
} }
buf->index = frame; buf->index = frame;
buf->bytesused = cam->buffers[buf->index].length; buf->bytesused = cam->buffers[buf->index].length;
buf->flags = V4L2_BUF_FLAG_MAPPED | V4L2_BUF_FLAG_DONE buf->flags = V4L2_BUF_FLAG_MAPPED | V4L2_BUF_FLAG_DONE
@ -1106,13 +1104,16 @@ int cpia2_register_camera(struct camera_data *cam)
if (cam->params.pnp_id.device_type == DEVICE_STV_672) if (cam->params.pnp_id.device_type == DEVICE_STV_672)
v4l2_ctrl_new_std_menu(hdl, &cpia2_ctrl_ops, v4l2_ctrl_new_std_menu(hdl, &cpia2_ctrl_ops,
V4L2_CID_POWER_LINE_FREQUENCY, V4L2_CID_POWER_LINE_FREQUENCY,
V4L2_CID_POWER_LINE_FREQUENCY_60HZ, 0, 0); V4L2_CID_POWER_LINE_FREQUENCY_60HZ,
0, 0);
/* Light control only valid for the QX5 Microscope */ /* Light control only valid for the QX5 Microscope */
if (cam->params.pnp_id.product == 0x151) { if (cam->params.pnp_id.product == 0x151) {
cam->top_light = v4l2_ctrl_new_std(hdl, &cpia2_ctrl_ops, cam->top_light = v4l2_ctrl_new_std(hdl, &cpia2_ctrl_ops,
V4L2_CID_ILLUMINATORS_1, 0, 1, 1, 0); V4L2_CID_ILLUMINATORS_1,
0, 1, 1, 0);
cam->bottom_light = v4l2_ctrl_new_std(hdl, &cpia2_ctrl_ops, cam->bottom_light = v4l2_ctrl_new_std(hdl, &cpia2_ctrl_ops,
V4L2_CID_ILLUMINATORS_2, 0, 1, 1, 0); V4L2_CID_ILLUMINATORS_2,
0, 1, 1, 0);
v4l2_ctrl_cluster(2, &cam->top_light); v4l2_ctrl_cluster(2, &cam->top_light);
} }
@ -1197,7 +1198,6 @@ static void __init check_parameters(void)
/************ Module Stuff ***************/ /************ Module Stuff ***************/
/****************************************************************************** /******************************************************************************
* *
* cpia2_init/module_init * cpia2_init/module_init
@ -1211,7 +1211,6 @@ static int __init cpia2_init(void)
return cpia2_usb_init(); return cpia2_usb_init();
} }
/****************************************************************************** /******************************************************************************
* *
* cpia2_exit/module_exit * cpia2_exit/module_exit