usb-misc: sisusbvga: Fix coding style: horizontal whitespace changes

This patch fixes whitespace coding style issues that can be fixed
within a single line. This patch fixes the following checkpatch
warnings:
 - 83 ERROR: space required after that ','
 - 13 ERROR: switch and case should be at the same indent
 - 08 WARNING: please, no spaces at the start of a line
 - 03 ERROR: space required before the open parenthesis '('
 - 04 WARNING: suspect code indent for conditional statements
 - 01 WARNING: space prohibited between function name and open parenthesis
 - 01 ERROR: spaces required around that '='
 - 01 ERROR: code indent should use tabs where possible

Signed-off-by: Peter Senna Tschudin <peter.senna@collabora.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Peter Senna Tschudin 2016-01-15 18:41:28 +01:00 committed by Greg Kroah-Hartman
parent 20db5513b4
commit f74a039c7e

View File

@ -803,9 +803,7 @@ static int sisusb_write_mem_bulk(struct sisusb_usb_data *sisusb, u32 addr,
length &= 0x00ffffff;
while (length) {
switch (length) {
case 1:
if (userbuffer) {
if (get_user(swap8, (u8 __user *)userbuffer))
@ -947,8 +945,8 @@ static int sisusb_write_mem_bulk(struct sisusb_usb_data *sisusb, u32 addr,
packet.header = 0x001f;
packet.address = 0x00000180;
packet.data = flag | 0x16;
ret |= sisusb_send_bridge_packet(sisusb, 10,
&packet, 0);
ret |= sisusb_send_bridge_packet(sisusb,
10, &packet, 0);
sisusb->flagb0 = 0x16;
}
if (userbuffer) {
@ -1152,11 +1150,8 @@ static int sisusb_read_mem_bulk(struct sisusb_usb_data *sisusb, u32 addr,
length &= 0x00ffffff;
while (length) {
switch (length) {
case 1:
ret |= sisusb_read_memio_byte(sisusb, SISUSB_TYPE_MEM,
addr, &buf[0]);
if (!ret) {
@ -1231,7 +1226,6 @@ static int sisusb_read_mem_bulk(struct sisusb_usb_data *sisusb, u32 addr,
length -= 4;
}
}
if (ret)
break;
}
@ -1353,15 +1347,19 @@ sisusb_testreadwrite(struct sisusb_usb_data *sisusb)
static char srcbuffer[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77 };
char destbuffer[10];
size_t dummy;
int i,j;
int i, j;
sisusb_copy_memory(sisusb, srcbuffer, sisusb->vrambase, 7, &dummy);
for(i = 1; i <= 7; i++) {
dev_dbg(&sisusb->sisusb_dev->dev, "sisusb: rwtest %d bytes\n", i);
sisusb_read_memory(sisusb, destbuffer, sisusb->vrambase, i, &dummy);
for(j = 0; j < i; j++) {
dev_dbg(&sisusb->sisusb_dev->dev, "rwtest read[%d] = %x\n", j, destbuffer[j]);
for (i = 1; i <= 7; i++) {
dev_dbg(&sisusb->sisusb_dev->dev,
"sisusb: rwtest %d bytes\n", i);
sisusb_read_memory(sisusb, destbuffer, sisusb->vrambase,
i, &dummy);
for (j = 0; j < i; j++) {
dev_dbg(&sisusb->sisusb_dev->dev,
"rwtest read[%d] = %x\n",
j, destbuffer[j]);
}
}
}
@ -1437,17 +1435,17 @@ sisusb_clear_vram(struct sisusb_usb_data *sisusb, u32 address, int length)
* a defined mode (640x480@60Hz)
*/
#define GETREG(r,d) sisusb_read_memio_byte(sisusb, SISUSB_TYPE_IO, r, d)
#define SETREG(r,d) sisusb_write_memio_byte(sisusb, SISUSB_TYPE_IO, r, d)
#define SETIREG(r,i,d) sisusb_setidxreg(sisusb, r, i, d)
#define GETIREG(r,i,d) sisusb_getidxreg(sisusb, r, i, d)
#define SETIREGOR(r,i,o) sisusb_setidxregor(sisusb, r, i, o)
#define SETIREGAND(r,i,a) sisusb_setidxregand(sisusb, r, i, a)
#define SETIREGANDOR(r,i,a,o) sisusb_setidxregandor(sisusb, r, i, a, o)
#define READL(a,d) sisusb_read_memio_long(sisusb, SISUSB_TYPE_MEM, a, d)
#define WRITEL(a,d) sisusb_write_memio_long(sisusb, SISUSB_TYPE_MEM, a, d)
#define READB(a,d) sisusb_read_memio_byte(sisusb, SISUSB_TYPE_MEM, a, d)
#define WRITEB(a,d) sisusb_write_memio_byte(sisusb, SISUSB_TYPE_MEM, a, d)
#define GETREG(r, d) sisusb_read_memio_byte(sisusb, SISUSB_TYPE_IO, r, d)
#define SETREG(r, d) sisusb_write_memio_byte(sisusb, SISUSB_TYPE_IO, r, d)
#define SETIREG(r, i, d) sisusb_setidxreg(sisusb, r, i, d)
#define GETIREG(r, i, d) sisusb_getidxreg(sisusb, r, i, d)
#define SETIREGOR(r, i, o) sisusb_setidxregor(sisusb, r, i, o)
#define SETIREGAND(r, i, a) sisusb_setidxregand(sisusb, r, i, a)
#define SETIREGANDOR(r, i, a, o) sisusb_setidxregandor(sisusb, r, i, a, o)
#define READL(a, d) sisusb_read_memio_long(sisusb, SISUSB_TYPE_MEM, a, d)
#define WRITEL(a, d) sisusb_write_memio_long(sisusb, SISUSB_TYPE_MEM, a, d)
#define READB(a, d) sisusb_read_memio_byte(sisusb, SISUSB_TYPE_MEM, a, d)
#define WRITEB(a, d) sisusb_write_memio_byte(sisusb, SISUSB_TYPE_MEM, a, d)
static int
sisusb_triggersr16(struct sisusb_usb_data *sisusb, u8 ramtype)
@ -1526,7 +1524,7 @@ sisusb_getbuswidth(struct sisusb_usb_data *sisusb, int *bw, int *chab)
}
if ((t1 != 0x456789ab) || (t0 != 0x01234567)) {
*chab = 1; *bw = 64;
ret |= SETIREGANDOR(SISSR, 0x14, 0xfc,0x01);
ret |= SETIREGANDOR(SISSR, 0x14, 0xfc, 0x01);
ret |= sisusb_triggersr16(sisusb, ramtype);
ret |= WRITEL(ramptr + 0, 0x89abcdef);
@ -1799,23 +1797,23 @@ sisusb_set_default_mode(struct sisusb_usb_data *sisusb, int touchengines)
int ret = 0, i, j, modex, modey, bpp, du;
u8 sr31, cr63, tmp8;
static const char attrdata[] = {
0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,
0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f,
0x01,0x00,0x00,0x00
0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,
0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, 0x0e, 0x0f,
0x01, 0x00, 0x00, 0x00
};
static const char crtcrdata[] = {
0x5f,0x4f,0x50,0x82,0x54,0x80,0x0b,0x3e,
0x00,0x40,0x00,0x00,0x00,0x00,0x00,0x00,
0xea,0x8c,0xdf,0x28,0x40,0xe7,0x04,0xa3,
0x5f, 0x4f, 0x50, 0x82, 0x54, 0x80, 0x0b, 0x3e,
0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xea, 0x8c, 0xdf, 0x28, 0x40, 0xe7, 0x04, 0xa3,
0xff
};
static const char grcdata[] = {
0x00,0x00,0x00,0x00,0x00,0x40,0x05,0x0f,
0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x05, 0x0f,
0xff
};
static const char crtcdata[] = {
0x5f,0x4f,0x4f,0x83,0x55,0x81,0x0b,0x3e,
0xe9,0x8b,0xdf,0xe8,0x0c,0x00,0x00,0x05,
0x5f, 0x4f, 0x4f, 0x83, 0x55, 0x81, 0x0b, 0x3e,
0xe9, 0x8b, 0xdf, 0xe8, 0x0c, 0x00, 0x00, 0x05,
0x00
};
@ -2081,12 +2079,12 @@ sisusb_init_gfxcore(struct sisusb_usb_data *sisusb)
ret |= sisusb_get_sdram_size(sisusb, &iret, bw, chab);
if (iret) {
dev_err(&sisusb->sisusb_dev->dev,"RAM size detection failed, assuming 8MB video RAM\n");
ret |= SETIREG(SISSR,0x14,0x31);
ret |= SETIREG(SISSR, 0x14, 0x31);
/* TODO */
}
} else {
dev_err(&sisusb->sisusb_dev->dev, "DDR RAM device found, assuming 8MB video RAM\n");
ret |= SETIREG(SISSR,0x14,0x31);
ret |= SETIREG(SISSR, 0x14, 0x31);
/* *** TODO *** */
}
@ -2127,7 +2125,7 @@ sisusb_get_ramconfig(struct sisusb_usb_data *sisusb)
static const char ram_dynamictype[4] = {'D', 'G', 'D', 'G'};
static const int busSDR[4] = {64, 64, 128, 128};
static const int busDDR[4] = {32, 32, 64, 64};
static const int busDDRA[4] = {64+32, 64+32 , (64+32)*2, (64+32)*2};
static const int busDDRA[4] = {64+32, 64+32, (64+32)*2, (64+32)*2};
sisusb_getidxreg(sisusb, SISSR, 0x14, &tmp8);
sisusb_getidxreg(sisusb, SISSR, 0x15, &tmp82);
@ -2392,7 +2390,7 @@ sisusb_reset_text_mode(struct sisusb_usb_data *sisusb, int init)
}
slot = sisusb->sisusb_cursor_loc;
if(slot < 0) slot = 0;
if (slot < 0) slot = 0;
sisusb->sisusb_cursor_loc = -1;
sisusb->bad_cursor_pos = 1;
@ -2551,7 +2549,6 @@ sisusb_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
* in machine-endianness.
*/
switch (count) {
case 1:
if (sisusb_read_memio_byte(sisusb,
SISUSB_TYPE_IO,
@ -2694,7 +2691,6 @@ sisusb_write(struct file *file, const char __user *buffer, size_t count,
* in machine-endianness.
*/
switch (count) {
case 1:
if (get_user(buf8, (u8 __user *)buffer))
errno = -EFAULT;
@ -2850,38 +2846,33 @@ sisusb_handle_command(struct sisusb_usb_data *sisusb, struct sisusb_command *y,
switch (y->operation) {
case SUCMD_GET:
retval = sisusb_getidxreg(sisusb, port,
y->data0, &y->data1);
retval = sisusb_getidxreg(sisusb, port, y->data0, &y->data1);
if (!retval) {
if (copy_to_user((void __user *)arg, y,
sizeof(*y)))
if (copy_to_user((void __user *)arg, y, sizeof(*y)))
retval = -EFAULT;
}
break;
case SUCMD_SET:
retval = sisusb_setidxreg(sisusb, port,
y->data0, y->data1);
retval = sisusb_setidxreg(sisusb, port, y->data0, y->data1);
break;
case SUCMD_SETOR:
retval = sisusb_setidxregor(sisusb, port,
y->data0, y->data1);
retval = sisusb_setidxregor(sisusb, port, y->data0, y->data1);
break;
case SUCMD_SETAND:
retval = sisusb_setidxregand(sisusb, port,
y->data0, y->data1);
retval = sisusb_setidxregand(sisusb, port, y->data0, y->data1);
break;
case SUCMD_SETANDOR:
retval = sisusb_setidxregandor(sisusb, port,
y->data0, y->data1, y->data2);
retval = sisusb_setidxregandor(sisusb, port, y->data0,
y->data1, y->data2);
break;
case SUCMD_SETMASK:
retval = sisusb_setidxregmask(sisusb, port,
y->data0, y->data1, y->data2);
retval = sisusb_setidxregmask(sisusb, port, y->data0,
y->data1, y->data2);
break;
case SUCMD_CLRSCR:
@ -2890,8 +2881,7 @@ sisusb_handle_command(struct sisusb_usb_data *sisusb, struct sisusb_command *y,
return -ENODEV;
length = (y->data0 << 16) | (y->data1 << 8) | y->data2;
address = y->data3 -
SISUSB_PCI_PSEUDO_MEMBASE +
address = y->data3 - SISUSB_PCI_PSEUDO_MEMBASE +
SISUSB_PCI_MEMBASE;
retval = sisusb_clear_vram(sisusb, address, length);
break;
@ -2978,7 +2968,6 @@ sisusb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
}
switch (cmd) {
case SISUSB_GET_CONFIG_SIZE:
if (put_user(sizeof(x), argp))
@ -2999,7 +2988,7 @@ sisusb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
x.sisusb_pcibase = SISUSB_PCI_PSEUDO_PCIBASE;
x.sisusb_vramsize = sisusb->vramsize;
x.sisusb_minor = sisusb->minor;
x.sisusb_fbdevactive= 0;
x.sisusb_fbdevactive = 0;
#ifdef INCL_SISUSB_CON
x.sisusb_conactive = sisusb->haveconsole ? 1 : 0;
#else
@ -3254,7 +3243,7 @@ static const struct usb_device_id sisusb_table[] = {
{ }
};
MODULE_DEVICE_TABLE (usb, sisusb_table);
MODULE_DEVICE_TABLE(usb, sisusb_table);
static struct usb_driver sisusb_driver = {
.name = "sisusb",