Commit afabbe6d authored by facugaich's avatar facugaich Committed by Greg Kroah-Hartman

Staging: solo6x10: Fix checkpatch errors and most warnings

This patch fixes all errors and most warnings reported by
checkpatch.pl for all the files in the driver.
v2: Fix a typo and update the patch against the latest HEAD
Signed-off-by: default avatarFacundo Gaich <facugaich@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 16618c20
......@@ -164,21 +164,21 @@ static int __devinit solo6010_pci_probe(struct pci_dev *pdev,
chip_id = solo_reg_read(solo_dev, SOLO_CHIP_OPTION) &
SOLO_CHIP_ID_MASK;
switch (chip_id) {
case 7:
solo_dev->nr_chans = 16;
solo_dev->nr_ext = 5;
break;
case 6:
solo_dev->nr_chans = 8;
solo_dev->nr_ext = 2;
break;
default:
dev_warn(&pdev->dev, "Invalid chip_id 0x%02x, "
"defaulting to 4 channels\n",
chip_id);
case 5:
solo_dev->nr_chans = 4;
solo_dev->nr_ext = 1;
case 7:
solo_dev->nr_chans = 16;
solo_dev->nr_ext = 5;
break;
case 6:
solo_dev->nr_chans = 8;
solo_dev->nr_ext = 2;
break;
default:
dev_warn(&pdev->dev, "Invalid chip_id 0x%02x, "
"defaulting to 4 channels\n",
chip_id);
case 5:
solo_dev->nr_chans = 4;
solo_dev->nr_ext = 1;
}
/* Disable all interrupts to start */
......
......@@ -203,7 +203,7 @@ static void solo_motion_config(struct solo6010_dev *solo_dev)
solo_reg_write(solo_dev, SOLO_VI_MOT_CTRL,
SOLO_VI_MOTION_FRAME_COUNT(3) |
SOLO_VI_MOTION_SAMPLE_LENGTH(solo_dev->video_hsize / 16)
| //SOLO_VI_MOTION_INTR_START_STOP |
| /* SOLO_VI_MOTION_INTR_START_STOP | */
SOLO_VI_MOTION_SAMPLE_COUNT(10));
solo_reg_write(solo_dev, SOLO_VI_MOTION_BORDER, 0);
......@@ -264,7 +264,7 @@ void solo_disp_exit(struct solo6010_dev *solo_dev)
solo_reg_write(solo_dev, SOLO_VO_RECTANGLE_CTRL(0), 0);
solo_reg_write(solo_dev, SOLO_VO_RECTANGLE_START(0), 0);
solo_reg_write(solo_dev, SOLO_VO_RECTANGLE_STOP(0), 0);
solo_reg_write(solo_dev, SOLO_VO_RECTANGLE_CTRL(1), 0);
solo_reg_write(solo_dev, SOLO_VO_RECTANGLE_START(1), 0);
solo_reg_write(solo_dev, SOLO_VO_RECTANGLE_STOP(1), 0);
......
......@@ -22,7 +22,7 @@
#include "solo6010.h"
#include "solo6010-osd-font.h"
#define CAPTURE_MAX_BANDWIDTH 32 // D1 4channel (D1 == 4)
#define CAPTURE_MAX_BANDWIDTH 32 /* D1 4channel (D1 == 4) */
#define OSG_BUFFER_SIZE 1024
#define VI_PROG_HSIZE (1280 - 16)
......
......@@ -47,7 +47,7 @@
* is broken down to 20 * 48 byte regions (one for each channel possible)
* with the rest of the page being dummy data. */
#define MAX_BUFFER (G723_PERIOD_BYTES * PERIODS_MAX)
#define IRQ_PAGES 4 // 0 - 4
#define IRQ_PAGES 4 /* 0 - 4 */
#define PERIODS_MIN (1 << IRQ_PAGES)
#define PERIODS_MAX G723_FDMA_PAGES
......@@ -372,10 +372,12 @@ int solo_g723_init(struct solo6010_dev *solo_dev)
if (ret < 0)
return ret;
if ((ret = solo_snd_pcm_init(solo_dev)) < 0)
ret = solo_snd_pcm_init(solo_dev);
if (ret < 0)
goto snd_error;
if ((ret = snd_card_register(card)) < 0)
ret = snd_card_register(card);
if (ret < 0)
goto snd_error;
solo_g723_config(solo_dev);
......
......@@ -225,7 +225,7 @@ static int solo_i2c_master_xfer(struct i2c_adapter *adap,
}
if (i == SOLO_I2C_ADAPTERS)
return num; // XXX Right return value for failure?
return num; /* XXX Right return value for failure? */
mutex_lock(&solo_dev->i2c_mutex);
solo_dev->i2c_id = i;
......@@ -296,7 +296,8 @@ int solo_i2c_init(struct solo6010_dev *solo_dev)
adap->retries = 1;
adap->dev.parent = &solo_dev->pdev->dev;
if ((ret = i2c_add_adapter(adap))) {
ret = i2c_add_adapter(adap);
if (ret) {
adap->algo_data = NULL;
break;
}
......
......@@ -22,7 +22,7 @@
static const unsigned int solo_osd_font[] = {
0x00000000, 0x0000c0c8, 0xccfefe0c, 0x08000000,
0x00000000, 0x10103838, 0x7c7cfefe, 0x00000000, // 0
0x00000000, 0x10103838, 0x7c7cfefe, 0x00000000, /* 0 */
0x00000000, 0xfefe7c7c, 0x38381010, 0x10000000,
0x00000000, 0x7c82fefe, 0xfefefe7c, 0x00000000,
0x00000000, 0x00001038, 0x10000000, 0x00000000,
......@@ -54,67 +54,67 @@ static const unsigned int solo_osd_font[] = {
0x0000003f, 0x7f404c52, 0x524c407f, 0x00000000,
0x0000007c, 0x82ba82ba, 0x82ba82fe, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00000000,
0x00000000, 0x183c3c3c, 0x18180018, 0x18000000, // 32 !
0x00000000, 0x183c3c3c, 0x18180018, 0x18000000, /* 32 ! */
0x00000066, 0x66240000, 0x00000000, 0x00000000,
0x00000000, 0x6c6cfe6c, 0x6c6cfe6c, 0x6c000000, // 34 " #
0x00000000, 0x6c6cfe6c, 0x6c6cfe6c, 0x6c000000, /* 34 " # */
0x00001010, 0x7cd6d616, 0x7cd0d6d6, 0x7c101000,
0x00000000, 0x0086c660, 0x30180cc6, 0xc2000000, // 36 $ %
0x00000000, 0x0086c660, 0x30180cc6, 0xc2000000, /* 36 $ % */
0x00000000, 0x386c6c38, 0xdc766666, 0xdc000000,
0x0000000c, 0x0c0c0600, 0x00000000, 0x00000000, // 38 & '
0x0000000c, 0x0c0c0600, 0x00000000, 0x00000000, /* 38 & ' */
0x00000000, 0x30180c0c, 0x0c0c0c18, 0x30000000,
0x00000000, 0x0c183030, 0x30303018, 0x0c000000, // 40 ( )
0x00000000, 0x0c183030, 0x30303018, 0x0c000000, /* 40 ( ) */
0x00000000, 0x0000663c, 0xff3c6600, 0x00000000,
0x00000000, 0x00001818, 0x7e181800, 0x00000000, // 42 * +
0x00000000, 0x00001818, 0x7e181800, 0x00000000, /* 42 * + */
0x00000000, 0x00000000, 0x00000e0e, 0x0c060000,
0x00000000, 0x00000000, 0x7e000000, 0x00000000, // 44 , -
0x00000000, 0x00000000, 0x7e000000, 0x00000000, /* 44 , - */
0x00000000, 0x00000000, 0x00000006, 0x06000000,
0x00000000, 0x80c06030, 0x180c0602, 0x00000000, // 46 . /
0x00000000, 0x80c06030, 0x180c0602, 0x00000000, /* 46 . / */
0x0000007c, 0xc6e6f6de, 0xcec6c67c, 0x00000000,
0x00000030, 0x383c3030, 0x303030fc, 0x00000000, // 48 0 1
0x00000030, 0x383c3030, 0x303030fc, 0x00000000, /* 48 0 1 */
0x0000007c, 0xc6c06030, 0x180cc6fe, 0x00000000,
0x0000007c, 0xc6c0c07c, 0xc0c0c67c, 0x00000000, // 50 2 3
0x0000007c, 0xc6c0c07c, 0xc0c0c67c, 0x00000000, /* 50 2 3 */
0x00000060, 0x70786c66, 0xfe6060f0, 0x00000000,
0x000000fe, 0x0606067e, 0xc0c0c67c, 0x00000000, // 52 4 5
0x000000fe, 0x0606067e, 0xc0c0c67c, 0x00000000, /* 52 4 5 */
0x00000038, 0x0c06067e, 0xc6c6c67c, 0x00000000,
0x000000fe, 0xc6c06030, 0x18181818, 0x00000000, // 54 6 7
0x000000fe, 0xc6c06030, 0x18181818, 0x00000000, /* 54 6 7 */
0x0000007c, 0xc6c6c67c, 0xc6c6c67c, 0x00000000,
0x0000007c, 0xc6c6c6fc, 0xc0c06038, 0x00000000, // 56 8 9
0x0000007c, 0xc6c6c6fc, 0xc0c06038, 0x00000000, /* 56 8 9 */
0x00000000, 0x18180000, 0x00181800, 0x00000000,
0x00000000, 0x18180000, 0x0018180c, 0x00000000, // 58 : ;
0x00000000, 0x18180000, 0x0018180c, 0x00000000, /* 58 : ; */
0x00000060, 0x30180c06, 0x0c183060, 0x00000000,
0x00000000, 0x007e0000, 0x007e0000, 0x00000000,
0x00000006, 0x0c183060, 0x30180c06, 0x00000000,
0x0000007c, 0xc6c66030, 0x30003030, 0x00000000,
0x0000007c, 0xc6f6d6d6, 0x7606067c, 0x00000000,
0x00000010, 0x386cc6c6, 0xfec6c6c6, 0x00000000, // 64 @ A
0x00000010, 0x386cc6c6, 0xfec6c6c6, 0x00000000, /* 64 @ A */
0x0000007e, 0xc6c6c67e, 0xc6c6c67e, 0x00000000,
0x00000078, 0xcc060606, 0x0606cc78, 0x00000000, // 66
0x00000078, 0xcc060606, 0x0606cc78, 0x00000000, /* 66 */
0x0000003e, 0x66c6c6c6, 0xc6c6663e, 0x00000000,
0x000000fe, 0x0606063e, 0x060606fe, 0x00000000, // 68
0x000000fe, 0x0606063e, 0x060606fe, 0x00000000, /* 68 */
0x000000fe, 0x0606063e, 0x06060606, 0x00000000,
0x00000078, 0xcc060606, 0xf6c6ccb8, 0x00000000, // 70
0x00000078, 0xcc060606, 0xf6c6ccb8, 0x00000000, /* 70 */
0x000000c6, 0xc6c6c6fe, 0xc6c6c6c6, 0x00000000,
0x0000003c, 0x18181818, 0x1818183c, 0x00000000, // 72
0x0000003c, 0x18181818, 0x1818183c, 0x00000000, /* 72 */
0x00000060, 0x60606060, 0x6066663c, 0x00000000,
0x000000c6, 0xc666361e, 0x3666c6c6, 0x00000000, // 74
0x000000c6, 0xc666361e, 0x3666c6c6, 0x00000000, /* 74 */
0x00000006, 0x06060606, 0x060606fe, 0x00000000,
0x000000c6, 0xeefed6c6, 0xc6c6c6c6, 0x00000000, // 76
0x000000c6, 0xeefed6c6, 0xc6c6c6c6, 0x00000000, /* 76 */
0x000000c6, 0xcedefef6, 0xe6c6c6c6, 0x00000000,
0x00000038, 0x6cc6c6c6, 0xc6c66c38, 0x00000000, // 78
0x00000038, 0x6cc6c6c6, 0xc6c66c38, 0x00000000, /* 78 */
0x0000007e, 0xc6c6c67e, 0x06060606, 0x00000000,
0x00000038, 0x6cc6c6c6, 0xc6d67c38, 0x60000000, // 80
0x00000038, 0x6cc6c6c6, 0xc6d67c38, 0x60000000, /* 80 */
0x0000007e, 0xc6c6c67e, 0x66c6c6c6, 0x00000000,
0x0000007c, 0xc6c60c38, 0x60c6c67c, 0x00000000, // 82
0x0000007c, 0xc6c60c38, 0x60c6c67c, 0x00000000, /* 82 */
0x0000007e, 0x18181818, 0x18181818, 0x00000000,
0x000000c6, 0xc6c6c6c6, 0xc6c6c67c, 0x00000000, // 84
0x000000c6, 0xc6c6c6c6, 0xc6c6c67c, 0x00000000, /* 84 */
0x000000c6, 0xc6c6c6c6, 0xc66c3810, 0x00000000,
0x000000c6, 0xc6c6c6c6, 0xd6d6fe6c, 0x00000000, // 86
0x000000c6, 0xc6c6c6c6, 0xd6d6fe6c, 0x00000000, /* 86 */
0x000000c6, 0xc6c66c38, 0x6cc6c6c6, 0x00000000,
0x00000066, 0x66666666, 0x3c181818, 0x00000000, // 88
0x00000066, 0x66666666, 0x3c181818, 0x00000000, /* 88 */
0x000000fe, 0xc0603018, 0x0c0606fe, 0x00000000,
0x0000003c, 0x0c0c0c0c, 0x0c0c0c3c, 0x00000000, // 90
0x0000003c, 0x0c0c0c0c, 0x0c0c0c3c, 0x00000000, /* 90 */
0x00000002, 0x060c1830, 0x60c08000, 0x00000000,
0x0000003c, 0x30303030, 0x3030303c, 0x00000000, // 92
0x0000003c, 0x30303030, 0x3030303c, 0x00000000, /* 92 */
0x00001038, 0x6cc60000, 0x00000000, 0x00000000,
0x00000000, 0x00000000, 0x00000000, 0x00fe0000,
0x00001818, 0x30000000, 0x00000000, 0x00000000,
......
......@@ -22,7 +22,7 @@
#include "solo6010.h"
// #define SOLO_TEST_P2M
/* #define SOLO_TEST_P2M */
int solo_p2m_dma(struct solo6010_dev *solo_dev, u8 id, int wr,
void *sys_addr, u32 ext_addr, u32 size)
......@@ -244,7 +244,7 @@ static void run_p2m_test(struct solo6010_dev *solo_dev)
return;
}
#else
#define run_p2m_test(__solo) do{}while(0)
#define run_p2m_test(__solo) do {} while (0)
#endif
void solo_p2m_isr(struct solo6010_dev *solo_dev, int id)
......
This diff is collapsed.
......@@ -598,7 +598,8 @@ static void solo_enc_fillbuf(struct solo_enc_fh *fh,
goto buf_err;
}
if (WARN_ON_ONCE(!(vbuf = videobuf_to_dma(vb))))
vbuf = videobuf_to_dma(vb);
if (WARN_ON_ONCE(!vbuf))
goto buf_err;
if (fh->fmt == V4L2_PIX_FMT_MPEG)
......@@ -731,7 +732,8 @@ void solo_enc_v4l2_isr(struct solo6010_dev *solo_dev)
jpeg_next = solo_reg_read(solo_dev,
SOLO_VE_JPEG_QUE(solo_dev->enc_idx));
if ((ch = (mpeg_current >> 24) & 0x1f) >= SOLO_MAX_CHANNELS) {
ch = (mpeg_current >> 24) & 0x1f;
if (ch >= SOLO_MAX_CHANNELS) {
ch -= SOLO_MAX_CHANNELS;
enc_type = SOLO_ENC_TYPE_EXT;
} else
......@@ -872,7 +874,8 @@ static int solo_enc_open(struct file *file)
struct solo_enc_dev *solo_enc = video_drvdata(file);
struct solo_enc_fh *fh;
if ((fh = kzalloc(sizeof(*fh), GFP_KERNEL)) == NULL)
fh = kzalloc(sizeof(*fh), GFP_KERNEL);
if (fh == NULL)
return -ENOMEM;
fh->enc = solo_enc;
......@@ -1042,9 +1045,8 @@ static int solo_enc_try_fmt_cap(struct file *file, void *priv,
if (pix->field == V4L2_FIELD_ANY)
pix->field = V4L2_FIELD_INTERLACED;
else if (pix->field != V4L2_FIELD_INTERLACED) {
else if (pix->field != V4L2_FIELD_INTERLACED)
pix->field = V4L2_FIELD_INTERLACED;
}
/* Just set these */
pix->colorspace = V4L2_COLORSPACE_SMPTE170M;
......@@ -1064,7 +1066,8 @@ static int solo_enc_set_fmt_cap(struct file *file, void *priv,
spin_lock(&solo_enc->lock);
if ((ret = solo_enc_try_fmt_cap(file, priv, f))) {
ret = solo_enc_try_fmt_cap(file, priv, f);
if (ret) {
spin_unlock(&solo_enc->lock);
return ret;
}
......@@ -1107,7 +1110,7 @@ static int solo_enc_get_fmt_cap(struct file *file, void *priv,
return 0;
}
static int solo_enc_reqbufs(struct file *file, void *priv,
static int solo_enc_reqbufs(struct file *file, void *priv,
struct v4l2_requestbuffers *req)
{
struct solo_enc_fh *fh = priv;
......@@ -1388,7 +1391,8 @@ static int solo_querymenu(struct file *file, void *priv,
int err;
qctrl.id = qmenu->id;
if ((err = solo_queryctrl(file, priv, &qctrl)))
err = solo_queryctrl(file, priv, &qctrl);
if (err)
return err;
return v4l2_ctrl_query_menu(qmenu, &qctrl, NULL);
......
......@@ -245,15 +245,16 @@ static void solo_fillbuf(struct solo_filehandle *fh,
struct videobuf_buffer *vb)
{
struct solo6010_dev *solo_dev = fh->solo_dev;
struct videobuf_dmabuf* vbuf;
struct videobuf_dmabuf *vbuf;
unsigned int fdma_addr;
int error = 1;
int i;
struct scatterlist* sg;
struct scatterlist *sg;
dma_addr_t sg_dma;
int sg_size_left;
if (!(vbuf = videobuf_to_dma(vb)))
vbuf = videobuf_to_dma(vb);
if (!vbuf)
goto finish_buf;
if (erase_off(solo_dev)) {
......@@ -524,7 +525,8 @@ static int solo_v4l2_open(struct file *file)
struct solo_filehandle *fh;
int ret;
if ((fh = kzalloc(sizeof(*fh), GFP_KERNEL)) == NULL)
fh = kzalloc(sizeof(*fh), GFP_KERNEL);
if (fh == NULL)
return -ENOMEM;
spin_lock_init(&fh->slock);
......@@ -532,7 +534,8 @@ static int solo_v4l2_open(struct file *file)
fh->solo_dev = solo_dev;
file->private_data = fh;
if ((ret = solo_start_thread(fh))) {
ret = solo_start_thread(fh);
if (ret) {
kfree(fh);
return ret;
}
......@@ -726,7 +729,7 @@ static int solo_get_fmt_cap(struct file *file, void *priv,
return 0;
}
static int solo_reqbufs(struct file *file, void *priv,
static int solo_reqbufs(struct file *file, void *priv,
struct v4l2_requestbuffers *req)
{
struct solo_filehandle *fh = priv;
......@@ -940,13 +943,13 @@ int solo_v4l2_init(struct solo6010_dev *solo_dev)
for (i = 0; i < solo_dev->nr_chans; i++) {
solo_v4l2_set_ch(solo_dev, i);
while (erase_off(solo_dev))
;// Do nothing
;/* Do nothing */
}
/* Set the default display channel */
solo_v4l2_set_ch(solo_dev, 0);
while (erase_off(solo_dev))
;// Do nothing
;/* Do nothing */
solo6010_irq_on(solo_dev, SOLO_IRQ_VIDEO_IN);
......
......@@ -68,7 +68,7 @@
#define SOLO6010_VER_MINOR 0
#define SOLO6010_VER_SUB 0
#define SOLO6010_VER_NUM \
KERNEL_VERSION(SOLO6010_VER_MAJOR, SOLO6010_VER_MINOR, SOLO6010_VER_SUB)
KERNEL_VERSION(SOLO6010_VER_MAJOR, SOLO6010_VER_MINOR, SOLO6010_VER_SUB)
/*
* The SOLO6010 actually has 8 i2c channels, but we only use 2.
......@@ -221,7 +221,7 @@ struct solo6010_dev {
struct solo_enc_buf enc_buf[SOLO_NR_RING_BUFS];
/* Current video settings */
u32 video_type;
u32 video_type;
u16 video_hsize, video_vsize;
u16 vout_hstart, vout_vstart;
u16 vin_hstart, vin_vstart;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment