Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 60fbfdfd authored by Ruslan Pisarev's avatar Ruslan Pisarev Committed by Mauro Carvalho Chehab
Browse files

[media] Staging: tm6000: fix braces, tabs, comments and space coding style issue in tm6000-video.c



This is a patch to the tm6000-video.c file that fixed
up a braces, tabs, comments and space Errors and Warnings found by the checkpatch.pl tools.

[mchehab@redhat.com: some changes didn't apply as it were based to an older version, so used patch -f to apply only the changes that are OK]
Signed-off-by: default avatarRuslan Pisarev <ruslan@rpisarev.org.ua>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent d7fe4a60
Loading
Loading
Loading
Loading
+173 −172
Original line number Diff line number Diff line
/*
   tm6000-video.c - driver for TM5600/TM6000/TM6010 USB video capture devices

   Copyright (C) 2006-2007 Mauro Carvalho Chehab <mchehab@infradead.org>

   Copyright (C) 2007 Michel Ludwig <michel.ludwig@gmail.com>
	- Fixed module load/unload

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation version 2

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *   tm6000-video.c - driver for TM5600/TM6000/TM6010 USB video capture devices
 *
 *  Copyright (C) 2006-2007 Mauro Carvalho Chehab <mchehab@infradead.org>
 *
 *  Copyright (C) 2007 Michel Ludwig <michel.ludwig@gmail.com>
 *	- Fixed module load/unload
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation version 2
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the Free Software
 *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 */
#include <linux/module.h>
#include <linux/delay.h>
@@ -118,8 +118,9 @@ static struct tm6000_fmt format[] = {
};

/* ------------------------------------------------------------------
	DMA and thread functions
   ------------------------------------------------------------------*/
 *	DMA and thread functions
 * ------------------------------------------------------------------
 */

#define norm_maxw(a) 720
#define norm_maxh(a) 576
@@ -361,7 +362,6 @@ static int copy_multiplexed(u8 *ptr, unsigned long len,

	while (len > 0) {
		cpysize = min(len, buf->vb.size-pos);
		//printk("Copying %d bytes (max=%lu) from %p to %p[%u]\n",cpysize,(*buf)->vb.size,ptr,out_p,pos);
		memcpy(&outp[pos], ptr, cpysize);
		pos += cpysize;
		ptr += cpysize;
@@ -385,7 +385,7 @@ static int copy_multiplexed(u8 *ptr, unsigned long len,
	return rc;
}

static void inline print_err_status (struct tm6000_core *dev,
static inline void print_err_status(struct tm6000_core *dev,
				     int packet, int status)
{
	char *errmsg = "Unknown";
@@ -468,8 +468,9 @@ static inline int tm6000_isoc_copy(struct urb *urb)
}

/* ------------------------------------------------------------------
	URB control
   ------------------------------------------------------------------*/
 *	URB control
 * ------------------------------------------------------------------
 */

/*
 * IRQ callback, called by URB callback
@@ -652,8 +653,9 @@ static int tm6000_start_thread( struct tm6000_core *dev)
}

/* ------------------------------------------------------------------
	Videobuf operations
   ------------------------------------------------------------------*/
 *	Videobuf operations
 * ------------------------------------------------------------------
 */

static int
buffer_setup(struct videobuf_queue *vq, unsigned int *count, unsigned int *size)
@@ -664,9 +666,8 @@ buffer_setup(struct videobuf_queue *vq, unsigned int *count, unsigned int *size)
	if (0 == *count)
		*count = TM6000_DEF_BUF;

	if (*count < TM6000_MIN_BUF) {
	if (*count < TM6000_MIN_BUF)
		*count = TM6000_MIN_BUF;
	}

	while (*size * *count > vid_limit * 1024 * 1024)
		(*count)--;
@@ -785,8 +786,9 @@ static struct videobuf_queue_ops tm6000_video_qops = {
};

/* ------------------------------------------------------------------
	IOCTL handling
   ------------------------------------------------------------------*/
 *	IOCTL handling
 * ------------------------------------------------------------------
 */

static bool is_res_read(struct tm6000_core *dev, struct tm6000_fh *fh)
{
@@ -835,16 +837,15 @@ static void res_free(struct tm6000_core *dev, struct tm6000_fh *fh)
}

/* ------------------------------------------------------------------
	IOCTL vidioc handling
   ------------------------------------------------------------------*/
 *	IOCTL vidioc handling
 * ------------------------------------------------------------------
 */
static int vidioc_querycap(struct file *file, void  *priv,
					struct v4l2_capability *cap)
{
	//	struct tm6000_core *dev = ((struct tm6000_fh *)priv)->dev;

	strlcpy(cap->driver, "tm6000", sizeof(cap->driver));
	strlcpy(cap->card, "Trident TVMaster TM5600/6000/6010", sizeof(cap->card));
	//	strlcpy(cap->bus_info, dev->udev->dev.bus_id, sizeof(cap->bus_info));
	cap->version = TM6000_VERSION;
	cap->capabilities =	V4L2_CAP_VIDEO_CAPTURE |
				V4L2_CAP_STREAMING     |
@@ -878,7 +879,7 @@ static int vidioc_g_fmt_vid_cap (struct file *file, void *priv,
	f->fmt.pix.sizeimage =
		f->fmt.pix.height * f->fmt.pix.bytesperline;

	return (0);
	return 0;
}

static struct tm6000_fmt *format_by_fourcc(unsigned int fourcc)
@@ -907,10 +908,9 @@ static int vidioc_try_fmt_vid_cap (struct file *file, void *priv,

	field = f->fmt.pix.field;

	if (field == V4L2_FIELD_ANY) {
//		field=V4L2_FIELD_INTERLACED;
	if (field == V4L2_FIELD_ANY)
		field = V4L2_FIELD_SEQ_TB;
	} else if (V4L2_FIELD_INTERLACED != field) {
	else if (V4L2_FIELD_INTERLACED != field) {
		dprintk(dev, V4L2_DEBUG_IOCTL_ARG, "Field type invalid.\n");
		return -EINVAL;
	}
@@ -940,7 +940,7 @@ static int vidioc_s_fmt_vid_cap (struct file *file, void *priv,
	struct tm6000_core *dev = fh->dev;
	int ret = vidioc_try_fmt_vid_cap(file, fh, f);
	if (ret < 0)
		return (ret);
		return ret;

	fh->fmt           = format_by_fourcc(f->fmt.pix.pixelformat);
	fh->width         = f->fmt.pix.width;
@@ -952,7 +952,7 @@ static int vidioc_s_fmt_vid_cap (struct file *file, void *priv,

	tm6000_set_fourcc_format(dev);

	return (0);
	return 0;
}

static int vidioc_reqbufs(struct file *file, void *priv,
@@ -960,7 +960,7 @@ static int vidioc_reqbufs (struct file *file, void *priv,
{
	struct tm6000_fh  *fh = priv;

	return (videobuf_reqbufs(&fh->vb_vidq, p));
	return videobuf_reqbufs(&fh->vb_vidq, p);
}

static int vidioc_querybuf(struct file *file, void *priv,
@@ -968,22 +968,22 @@ static int vidioc_querybuf (struct file *file, void *priv,
{
	struct tm6000_fh  *fh = priv;

	return (videobuf_querybuf(&fh->vb_vidq, p));
	return videobuf_querybuf(&fh->vb_vidq, p);
}

static int vidioc_qbuf(struct file *file, void *priv, struct v4l2_buffer *p)
{
	struct tm6000_fh  *fh = priv;

	return (videobuf_qbuf(&fh->vb_vidq, p));
	return videobuf_qbuf(&fh->vb_vidq, p);
}

static int vidioc_dqbuf(struct file *file, void *priv, struct v4l2_buffer *p)
{
	struct tm6000_fh  *fh = priv;

	return (videobuf_dqbuf(&fh->vb_vidq, p,
				file->f_flags & O_NONBLOCK));
	return videobuf_dqbuf(&fh->vb_vidq, p,
				file->f_flags & O_NONBLOCK);
}

#ifdef CONFIG_VIDEO_V4L1_COMPAT
@@ -1106,7 +1106,7 @@ static int vidioc_s_input (struct file *file, void *priv, unsigned int i)
		rc = vidioc_s_std(file, priv, &dev->vfd->current_norm);
	}

	return (rc);
	return rc;
}

	/* --- controls ---------------------------------------------- */
@@ -1119,7 +1119,7 @@ static int vidioc_queryctrl (struct file *file, void *priv,
		if (qc->id && qc->id == tm6000_qctrl[i].id) {
			memcpy(qc, &(tm6000_qctrl[i]),
				sizeof(*qc));
			return (0);
			return 0;
		}

	return -EINVAL;
@@ -1452,8 +1452,9 @@ static struct video_device tm6000_template = {
};

/* -----------------------------------------------------------------
	Initialization and module stuff
   ------------------------------------------------------------------*/
 *	Initialization and module stuff
 * ------------------------------------------------------------------
 */

int tm6000_v4l2_register(struct tm6000_core *dev)
{