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

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

[media] Staging: cx25821: fix braces and space coding style issues



Errors found by the checkpatch.pl tool.

[mchehab@redhat.com: merged a series of CodingStyle cleanup patches for cx25851. They're all from the same author, and patches the same driver]
Signed-off-by: default avatarRuslan Pisarev <ruslan@rpisarev.org.ua>
Cc: Palash Bandyopadhyay <Palash.Bandyopadhyay@conexant.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 01bc7991
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -764,9 +764,8 @@ int cx25821_audio_upstream_init(struct cx25821_dev *dev, int channel_select)
		       str_length + 1);

		/* Default if filename is empty string */
		if (strcmp(dev->input_audiofilename, "") == 0) {
		if (strcmp(dev->input_audiofilename, "") == 0)
			dev->_audiofilename = "/root/audioGOOD.wav";
		}
	} else {
		str_length = strlen(_defaultAudioName);
		dev->_audiofilename = kmalloc(str_length + 1, GFP_KERNEL);
+5 −5
Original line number Diff line number Diff line
@@ -31,8 +31,8 @@
#define NUMBER_OF_PROGRAMS  8

/*
  Max size of the RISC program for a buffer. - worst case is 2 writes per line
  Space is also added for the 4 no-op instructions added on the end.
 * Max size of the RISC program for a buffer. - worst case is 2 writes per line
 * Space is also added for the 4 no-op instructions added on the end.
 */
#ifndef USE_RISC_NOOP
#define MAX_BUFFER_PROGRAM_SIZE     \
+31 −31
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ static unsigned int card[] = {[0 ... (CX25821_MAXBOARDS - 1)] = UNSET };
module_param_array(card, int, NULL, 0444);
MODULE_PARM_DESC(card, "card type");

static unsigned int cx25821_devcount = 0;
static unsigned int cx25821_devcount;

static DEFINE_MUTEX(devlist);
LIST_HEAD(cx25821_devlist);
@@ -785,8 +785,8 @@ static void cx25821_shutdown(struct cx25821_dev *dev)
		cx_write(dev->channels[i].sram_channels->int_msk, 0);
	}

	for (i = VID_UPSTREAM_SRAM_CHANNEL_I; i <= VID_UPSTREAM_SRAM_CHANNEL_J;
	     i++) {
	for (i = VID_UPSTREAM_SRAM_CHANNEL_I;
		i <= VID_UPSTREAM_SRAM_CHANNEL_J; i++) {
		cx_write(dev->channels[i].sram_channels->dma_ctl, 0);
		cx_write(dev->channels[i].sram_channels->int_msk, 0);
	}
@@ -851,8 +851,8 @@ static void cx25821_initialize(struct cx25821_dev *dev)
	}

	/* Probably only affect Downstream */
	for (i = VID_UPSTREAM_SRAM_CHANNEL_I; i <= VID_UPSTREAM_SRAM_CHANNEL_J;
	     i++) {
	for (i = VID_UPSTREAM_SRAM_CHANNEL_I;
		i <= VID_UPSTREAM_SRAM_CHANNEL_J; i++) {
		cx25821_set_vip_mode(dev, dev->channels[i].sram_channels);
	}

+2 −2
Original line number Diff line number Diff line
@@ -163,8 +163,8 @@
#define  FLD_VID_DST_RISC2         0x00000010
#define  FLD_VID_SRC_RISC1         0x00000002
#define  FLD_VID_DST_RISC1         0x00000001
#define  FLD_VID_SRC_ERRORS		FLD_VID_SRC_OPC_ERR | FLD_VID_SRC_SYNC | FLD_VID_SRC_UF
#define  FLD_VID_DST_ERRORS		FLD_VID_DST_OPC_ERR | FLD_VID_DST_SYNC | FLD_VID_DST_OF
#define  FLD_VID_SRC_ERRORS		(FLD_VID_SRC_OPC_ERR | FLD_VID_SRC_SYNC | FLD_VID_SRC_UF)
#define  FLD_VID_DST_ERRORS		(FLD_VID_DST_OPC_ERR | FLD_VID_DST_SYNC | FLD_VID_DST_OF)

/* ***************************************************************************** */
#define  AUD_A_INT_MSK             0x0400C0	/* Audio Int interrupt mask */
+63 −72
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@
#include <linux/file.h>
#include <linux/fcntl.h>
#include <linux/slab.h>
#include <asm/uaccess.h>
#include <linux/uaccess.h>

MODULE_DESCRIPTION("v4l2 driver module for cx25821 based TV cards");
MODULE_AUTHOR("Hiep Huynh <hiep.huynh@conexant.com>");
@@ -53,10 +53,9 @@ static __le32 *cx25821_update_riscprogram_ch2(struct cx25821_dev *dev,
	*(rp++) = cpu_to_le32(RISC_RESYNC | sync_line);

	if (USE_RISC_NOOP_VIDEO) {
		for (i = 0; i < NUM_NO_OPS; i++) {
		for (i = 0; i < NUM_NO_OPS; i++)
			*(rp++) = cpu_to_le32(RISC_NOOP);
	}
	}

	/* scan lines */
	for (line = 0; line < lines; line++) {
@@ -88,15 +87,13 @@ static __le32 *cx25821_risc_field_upstream_ch2(struct cx25821_dev *dev,
	int dist_betwn_starts = bpl * 2;

	/* sync instruction */
	if (sync_line != NO_SYNC_LINE) {
	if (sync_line != NO_SYNC_LINE)
		*(rp++) = cpu_to_le32(RISC_RESYNC | sync_line);
	}

	if (USE_RISC_NOOP_VIDEO) {
		for (i = 0; i < NUM_NO_OPS; i++) {
		for (i = 0; i < NUM_NO_OPS; i++)
			*(rp++) = cpu_to_le32(RISC_NOOP);
	}
	}

	/* scan lines */
	for (line = 0; line < lines; line++) {
@@ -250,9 +247,8 @@ void cx25821_stop_upstream_video_ch2(struct cx25821_dev *dev)

void cx25821_free_mem_upstream_ch2(struct cx25821_dev *dev)
{
	if (dev->_is_running_ch2) {
	if (dev->_is_running_ch2)
		cx25821_stop_upstream_video_ch2(dev);
	}

	if (dev->_dma_virt_addr_ch2) {
		pci_free_consistent(dev->pci, dev->_risc_size_ch2,
@@ -303,7 +299,6 @@ int cx25821_get_frame_ch2(struct cx25821_dev *dev, struct sram_channel *sram_ch)
	file_offset = dev->_frame_count_ch2 * frame_size;

	myfile = filp_open(dev->_filename_ch2, O_RDONLY | O_LARGEFILE, 0);

	if (IS_ERR(myfile)) {
		const int open_errno = -PTR_ERR(myfile);
		printk("%s(): ERROR opening file(%s) with errno = %d!\n",
@@ -450,10 +445,9 @@ int cx25821_openfile_ch2(struct cx25821_dev *dev, struct sram_channel *sram_ch)
			if (i > 0)
				dev->_frame_count_ch2++;

			if (vfs_read_retval < line_size) {
			if (vfs_read_retval < line_size)
				break;
		}
		}

		dev->_file_status_ch2 =
		    (vfs_read_retval == line_size) ? IN_PROGRESS : END_OF_FILE;
@@ -554,8 +548,8 @@ int cx25821_video_upstream_irq_ch2(struct cx25821_dev *dev, int chan_num,
		u32 prog_cnt = cx_read(channel->gpcnt);

		/*
		  Since we've identified our IRQ, clear our bits from the
		  interrupt mask and interrupt status registers
		 *  Since we've identified our IRQ, clear our bits from the
		 *  interrupt mask and interrupt status registers
		 */
		int_msk_tmp = cx_read(channel->int_msk);
		cx_write(channel->int_msk, int_msk_tmp & ~_intr_msk);
@@ -631,7 +625,6 @@ static irqreturn_t cx25821_upstream_irq_ch2(int irq, void *dev_id)
		return -1;

	channel_num = VID_UPSTREAM_SRAM_CHANNEL_J;

	sram_ch = dev->channels[channel_num].sram_channels;

	msk_stat = cx_read(sram_ch->int_mstat);
@@ -644,11 +637,10 @@ static irqreturn_t cx25821_upstream_irq_ch2(int irq, void *dev_id)
						   vid_status);
	}

	if (handled < 0) {
	if (handled < 0)
		cx25821_stop_upstream_video_ch2(dev);
	} else {
	else
		handled += handled;
	}

	return IRQ_RETVAL(handled);
}
@@ -668,17 +660,16 @@ static void cx25821_set_pixelengine_ch2(struct cx25821_dev *dev,
	cx_write(ch->vid_fmt_ctl, value);

	/*
	  set number of active pixels in each line. Default is 720
	  pixels in both NTSC and PAL format
	 *  set number of active pixels in each line. Default is 720
	 * pixels in both NTSC and PAL format
	 */
	cx_write(ch->vid_active_ctl1, width);

	num_lines = (height / 2) & 0x3FF;
	odd_num_lines = num_lines;

	if (dev->_isNTSC_ch2) {
	if (dev->_isNTSC_ch2)
		odd_num_lines += 1;
	}

	value = (num_lines << 16) | odd_num_lines;

@@ -695,15 +686,15 @@ int cx25821_start_video_dma_upstream_ch2(struct cx25821_dev *dev,
	int err = 0;

	/*
	  656/VIP SRC Upstream Channel I & J and 7 - Host Bus Interface
	  for channel A-C
	 *  656/VIP SRC Upstream Channel I & J and 7 - Host Bus Interface
	 * for channel A-C
	 */
	tmp = cx_read(VID_CH_MODE_SEL);
	cx_write(VID_CH_MODE_SEL, tmp | 0x1B0001FF);

	/*
	  Set the physical start address of the RISC program in the initial
	  program counter(IPC) member of the cmds.
	 *  Set the physical start address of the RISC program in the initial
	 *  program counter(IPC) member of the cmds.
	 */
	cx_write(sram_ch->cmds_start + 0, dev->_dma_phys_addr_ch2);
	cx_write(sram_ch->cmds_start + 4, 0); /* Risc IPC High 64 bits 63-32 */
@@ -770,8 +761,8 @@ int cx25821_vidupstream_init_ch2(struct cx25821_dev *dev, int channel_select,
		return -ENOMEM;
	}
	/*
	  656/VIP SRC Upstream Channel I & J and 7 -
	  Host Bus Interface for channel A-C
	 * 656/VIP SRC Upstream Channel I & J and 7 -
	 * Host Bus Interface for channel A-C
	 */
	tmp = cx_read(VID_CH_MODE_SEL);
	cx_write(VID_CH_MODE_SEL, tmp | 0x1B0001FF);
Loading