Commit 118015c4 authored by Andre Haupt's avatar Andre Haupt Committed by Greg Kroah-Hartman

Staging: asus_oled: fix various checkpatch.pl issues regarding missing or obsolete spaces

Signed-off-by: default avatarAndre Haupt <andre@bitwigglers.org>
Cc: Jakub Schmidtke <sjakub@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 526fd20a
...@@ -80,20 +80,20 @@ struct oled_dev_desc_str { ...@@ -80,20 +80,20 @@ struct oled_dev_desc_str {
}; };
/* table of devices that work with this driver */ /* table of devices that work with this driver */
static struct usb_device_id id_table [] = { static struct usb_device_id id_table[] = {
{ USB_DEVICE(0x0b05, 0x1726) }, // Asus G1/G2 (and variants) { USB_DEVICE(0x0b05, 0x1726) }, // Asus G1/G2 (and variants)
{ USB_DEVICE(0x0b05, 0x175b) }, // Asus G50V (and possibly others - G70? G71?) { USB_DEVICE(0x0b05, 0x175b) }, // Asus G50V (and possibly others - G70? G71?)
{ }, { },
}; };
/* parameters of specific devices */ /* parameters of specific devices */
static struct oled_dev_desc_str oled_dev_desc_table [] = { static struct oled_dev_desc_str oled_dev_desc_table[] = {
{ 0x0b05, 0x1726, 128, PACK_MODE_G1, "G1/G2" }, { 0x0b05, 0x1726, 128, PACK_MODE_G1, "G1/G2" },
{ 0x0b05, 0x175b, 256, PACK_MODE_G50, "G50" }, { 0x0b05, 0x175b, 256, PACK_MODE_G50, "G50" },
{ }, { },
}; };
MODULE_DEVICE_TABLE (usb, id_table); MODULE_DEVICE_TABLE(usb, id_table);
#define SETUP_PACKET_HEADER(packet, val1, val2, val3, val4, val5, val6, val7) \ #define SETUP_PACKET_HEADER(packet, val1, val2, val3, val4, val5, val6, val7) \
do { \ do { \
...@@ -107,7 +107,7 @@ MODULE_DEVICE_TABLE (usb, id_table); ...@@ -107,7 +107,7 @@ MODULE_DEVICE_TABLE (usb, id_table);
packet->header.value6 = val5; \ packet->header.value6 = val5; \
packet->header.value7 = val6; \ packet->header.value7 = val6; \
packet->header.value8 = val7; \ packet->header.value8 = val7; \
} while(0); } while (0);
struct asus_oled_header { struct asus_oled_header {
uint8_t magic1; uint8_t magic1;
...@@ -165,7 +165,7 @@ static void enable_oled(struct asus_oled_dev *odev, uint8_t enabl) ...@@ -165,7 +165,7 @@ static void enable_oled(struct asus_oled_dev *odev, uint8_t enabl)
else else
packet->bitmap[0] = 0xae; packet->bitmap[0] = 0xae;
for (a=0; a<1; a++) { for (a = 0; a < 1; a++) {
retval = usb_bulk_msg(odev->udev, retval = usb_bulk_msg(odev->udev,
usb_sndbulkpipe(odev->udev, 2), usb_sndbulkpipe(odev->udev, 2),
packet, packet,
...@@ -254,7 +254,7 @@ static void send_packets(struct usb_device *udev, struct asus_oled_packet *packe ...@@ -254,7 +254,7 @@ static void send_packets(struct usb_device *udev, struct asus_oled_packet *packe
} }
} }
static void send_packet(struct usb_device *udev, struct asus_oled_packet *packet, size_t offset, size_t len, char *buf, uint8_t b1, uint8_t b2, uint8_t b3, uint8_t b4, uint8_t b5, uint8_t b6){ static void send_packet(struct usb_device *udev, struct asus_oled_packet *packet, size_t offset, size_t len, char *buf, uint8_t b1, uint8_t b2, uint8_t b3, uint8_t b4, uint8_t b5, uint8_t b6) {
int retval; int retval;
int act_len; int act_len;
...@@ -296,7 +296,7 @@ static void send_data(struct asus_oled_dev *odev) ...@@ -296,7 +296,7 @@ static void send_data(struct asus_oled_dev *odev)
return; return;
} }
if (odev->pack_mode==PACK_MODE_G1){ if (odev->pack_mode == PACK_MODE_G1) {
// When sending roll-mode data the display updated only first packet. // When sending roll-mode data the display updated only first packet.
// I have no idea why, but when static picture is send just before // I have no idea why, but when static picture is send just before
// rolling picture - everything works fine. // rolling picture - everything works fine.
...@@ -310,7 +310,7 @@ static void send_data(struct asus_oled_dev *odev) ...@@ -310,7 +310,7 @@ static void send_data(struct asus_oled_dev *odev)
send_packets(odev->udev, packet, odev->buf, odev->pic_mode, packet_num); send_packets(odev->udev, packet, odev->buf, odev->pic_mode, packet_num);
} }
else else
if (odev->pack_mode==PACK_MODE_G50){ if (odev->pack_mode == PACK_MODE_G50) {
send_packets_g50(odev->udev, packet, odev->buf); send_packets_g50(odev->udev, packet, odev->buf);
} }
...@@ -328,7 +328,7 @@ static int append_values(struct asus_oled_dev *odev, uint8_t val, size_t count) ...@@ -328,7 +328,7 @@ static int append_values(struct asus_oled_dev *odev, uint8_t val, size_t count)
x += odev->x_shift; x += odev->x_shift;
y += odev->y_shift; y += odev->y_shift;
switch(odev->pack_mode) switch (odev->pack_mode)
{ {
case PACK_MODE_G1: case PACK_MODE_G1:
// i = (x/128)*640 + 127 - x + (y/8)*128; // i = (x/128)*640 + 127 - x + (y/8)*128;
...@@ -382,7 +382,7 @@ static ssize_t odev_set_picture(struct asus_oled_dev *odev, const char *buf, siz ...@@ -382,7 +382,7 @@ static ssize_t odev_set_picture(struct asus_oled_dev *odev, const char *buf, siz
if (count < 1) if (count < 1)
return 0; return 0;
if (tolower(buf[0]) == 'b'){ if (tolower(buf[0]) == 'b') {
// binary mode, set the entire memory // binary mode, set the entire memory
size_t i; size_t i;
...@@ -395,16 +395,16 @@ static ssize_t odev_set_picture(struct asus_oled_dev *odev, const char *buf, siz ...@@ -395,16 +395,16 @@ static ssize_t odev_set_picture(struct asus_oled_dev *odev, const char *buf, siz
memset(odev->buf, 0xff, odev->buf_size); memset(odev->buf, 0xff, odev->buf_size);
for (i=1; i < count && i<=32*32; i++){ for (i = 1; i < count && i <= 32 * 32; i++) {
odev->buf[i-1] = buf[i]; odev->buf[i-1] = buf[i];
odev->buf_offs = i-1; odev->buf_offs = i-1;
} }
odev->width=odev->dev_width / 8; odev->width = odev->dev_width / 8;
odev->height=ASUS_OLED_DISP_HEIGHT; odev->height = ASUS_OLED_DISP_HEIGHT;
odev->x_shift=0; odev->x_shift = 0;
odev->y_shift=0; odev->y_shift = 0;
odev->last_val=0; odev->last_val = 0;
send_data(odev); send_data(odev);
...@@ -420,7 +420,7 @@ static ssize_t odev_set_picture(struct asus_oled_dev *odev, const char *buf, siz ...@@ -420,7 +420,7 @@ static ssize_t odev_set_picture(struct asus_oled_dev *odev, const char *buf, siz
goto error_header; goto error_header;
} }
switch(tolower(buf[1])) { switch (tolower(buf[1])) {
case ASUS_OLED_STATIC: case ASUS_OLED_STATIC:
case ASUS_OLED_ROLL: case ASUS_OLED_ROLL:
case ASUS_OLED_FLASH: case ASUS_OLED_FLASH:
...@@ -519,18 +519,18 @@ static ssize_t odev_set_picture(struct asus_oled_dev *odev, const char *buf, siz ...@@ -519,18 +519,18 @@ static ssize_t odev_set_picture(struct asus_oled_dev *odev, const char *buf, siz
int ret; int ret;
if (buf[offs] == '1' || buf[offs] == '#') { if (buf[offs] == '1' || buf[offs] == '#') {
if ( (ret = append_values(odev, 1, 1)) < 0) if ((ret = append_values(odev, 1, 1)) < 0)
return ret; return ret;
} }
else if (buf[offs] == '0' || buf[offs] == ' ') { else if (buf[offs] == '0' || buf[offs] == ' ') {
if ( (ret = append_values(odev, 0, 1)) < 0) if ((ret = append_values(odev, 0, 1)) < 0)
return ret; return ret;
} }
else if (buf[offs] == '\n') { else if (buf[offs] == '\n') {
// New line detected. Lets assume, that all characters till the end of the // New line detected. Lets assume, that all characters till the end of the
// line were equal to the last character in this line. // line were equal to the last character in this line.
if (odev->buf_offs % odev->width != 0) if (odev->buf_offs % odev->width != 0)
if ( (ret = append_values(odev, odev->last_val, if ((ret = append_values(odev, odev->last_val,
odev->width - (odev->buf_offs % odev->width))) < 0) odev->width - (odev->buf_offs % odev->width))) < 0)
return ret; return ret;
} }
...@@ -604,7 +604,7 @@ static int asus_oled_probe(struct usb_interface *interface, const struct usb_dev ...@@ -604,7 +604,7 @@ static int asus_oled_probe(struct usb_interface *interface, const struct usb_dev
} }
} }
if ( !desc || dev_width < 1 || pack_mode == PACK_MODE_LAST) { if (!desc || dev_width < 1 || pack_mode == PACK_MODE_LAST) {
dev_err(&interface->dev, "Missing or incomplete device description!\n"); dev_err(&interface->dev, "Missing or incomplete device description!\n");
return -ENODEV; return -ENODEV;
} }
...@@ -631,7 +631,7 @@ static int asus_oled_probe(struct usb_interface *interface, const struct usb_dev ...@@ -631,7 +631,7 @@ static int asus_oled_probe(struct usb_interface *interface, const struct usb_dev
odev->enabled = 1; odev->enabled = 1;
odev->dev = NULL; odev->dev = NULL;
usb_set_intfdata (interface, odev); usb_set_intfdata(interface, odev);
if ((retval = device_create_file(&interface->dev, &ASUS_OLED_DEVICE_ATTR(enabled)))) { if ((retval = device_create_file(&interface->dev, &ASUS_OLED_DEVICE_ATTR(enabled)))) {
goto err_files; goto err_files;
...@@ -641,8 +641,8 @@ static int asus_oled_probe(struct usb_interface *interface, const struct usb_dev ...@@ -641,8 +641,8 @@ static int asus_oled_probe(struct usb_interface *interface, const struct usb_dev
goto err_files; goto err_files;
} }
odev->dev = device_create(oled_class, &interface->dev, MKDEV(0,0), odev->dev = device_create(oled_class, &interface->dev, MKDEV(0, 0),
NULL,"oled_%d", ++oled_num); NULL, "oled_%d", ++oled_num);
if (IS_ERR(odev->dev)) { if (IS_ERR(odev->dev)) {
retval = PTR_ERR(odev->dev); retval = PTR_ERR(odev->dev);
...@@ -651,11 +651,11 @@ static int asus_oled_probe(struct usb_interface *interface, const struct usb_dev ...@@ -651,11 +651,11 @@ static int asus_oled_probe(struct usb_interface *interface, const struct usb_dev
dev_set_drvdata(odev->dev, odev); dev_set_drvdata(odev->dev, odev);
if ( (retval = device_create_file(odev->dev, &dev_attr_enabled))) { if ((retval = device_create_file(odev->dev, &dev_attr_enabled))) {
goto err_class_enabled; goto err_class_enabled;
} }
if ( (retval = device_create_file(odev->dev, &dev_attr_picture))) { if ((retval = device_create_file(odev->dev, &dev_attr_picture))) {
goto err_class_picture; goto err_class_picture;
} }
...@@ -677,7 +677,7 @@ static int asus_oled_probe(struct usb_interface *interface, const struct usb_dev ...@@ -677,7 +677,7 @@ static int asus_oled_probe(struct usb_interface *interface, const struct usb_dev
device_remove_file(&interface->dev, &ASUS_OLED_DEVICE_ATTR(enabled)); device_remove_file(&interface->dev, &ASUS_OLED_DEVICE_ATTR(enabled));
device_remove_file(&interface->dev, &ASUS_OLED_DEVICE_ATTR(picture)); device_remove_file(&interface->dev, &ASUS_OLED_DEVICE_ATTR(picture));
usb_set_intfdata (interface, NULL); usb_set_intfdata(interface, NULL);
usb_put_dev(odev->udev); usb_put_dev(odev->udev);
kfree(odev); kfree(odev);
...@@ -688,15 +688,15 @@ static void asus_oled_disconnect(struct usb_interface *interface) ...@@ -688,15 +688,15 @@ static void asus_oled_disconnect(struct usb_interface *interface)
{ {
struct asus_oled_dev *odev; struct asus_oled_dev *odev;
odev = usb_get_intfdata (interface); odev = usb_get_intfdata(interface);
usb_set_intfdata (interface, NULL); usb_set_intfdata(interface, NULL);
device_remove_file(odev->dev, &dev_attr_picture); device_remove_file(odev->dev, &dev_attr_picture);
device_remove_file(odev->dev, &dev_attr_enabled); device_remove_file(odev->dev, &dev_attr_enabled);
device_unregister(odev->dev); device_unregister(odev->dev);
device_remove_file(&interface->dev, & ASUS_OLED_DEVICE_ATTR(picture)); device_remove_file(&interface->dev, &ASUS_OLED_DEVICE_ATTR(picture));
device_remove_file(&interface->dev, & ASUS_OLED_DEVICE_ATTR(enabled)); device_remove_file(&interface->dev, &ASUS_OLED_DEVICE_ATTR(enabled));
usb_put_dev(odev->udev); usb_put_dev(odev->udev);
...@@ -759,6 +759,6 @@ static void __exit asus_oled_exit(void) ...@@ -759,6 +759,6 @@ static void __exit asus_oled_exit(void)
usb_deregister(&oled_driver); usb_deregister(&oled_driver);
} }
module_init (asus_oled_init); module_init(asus_oled_init);
module_exit (asus_oled_exit); module_exit(asus_oled_exit);
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