summaryrefslogtreecommitdiff
path: root/drivers/staging/asus_oled/asus_oled.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/asus_oled/asus_oled.c')
-rw-r--r--drivers/staging/asus_oled/asus_oled.c38
1 files changed, 21 insertions, 17 deletions
diff --git a/drivers/staging/asus_oled/asus_oled.c b/drivers/staging/asus_oled/asus_oled.c
index d0a5a28a8fe2..3654dc32a0c6 100644
--- a/drivers/staging/asus_oled/asus_oled.c
+++ b/drivers/staging/asus_oled/asus_oled.c
@@ -50,9 +50,9 @@
#define ASUS_OLED_DISP_HEIGHT 32
#define ASUS_OLED_PACKET_BUF_SIZE 256
-#define USB_VENDOR_ID_ASUS 0x0b05
-#define USB_DEVICE_ID_ASUS_LCM 0x1726
-#define USB_DEVICE_ID_ASUS_LCM2 0x175b
+#define USB_VENDOR_ID_ASUS 0x0b05
+#define USB_DEVICE_ID_ASUS_LCM 0x1726
+#define USB_DEVICE_ID_ASUS_LCM2 0x175b
MODULE_AUTHOR("Jakub Schmidtke, sjakub@gmail.com");
MODULE_DESCRIPTION("Asus OLED Driver");
@@ -324,9 +324,11 @@ static void send_data(struct asus_oled_dev *odev)
return;
if (odev->pack_mode == PACK_MODE_G1) {
- /* When sending roll-mode data the display updated only
- first packet. I have no idea why, but when static picture
- is sent just before rolling picture everything works fine. */
+ /*
+ * When sending roll-mode data the display updated only
+ * first packet. I have no idea why, but when static picture
+ * is sent just before rolling picture everything works fine.
+ */
if (odev->pic_mode == ASUS_OLED_ROLL)
send_packets(odev->udev, packet, odev->buf,
ASUS_OLED_STATIC, 2);
@@ -363,9 +365,11 @@ static int append_values(struct asus_oled_dev *odev, uint8_t val, size_t count)
switch (odev->pack_mode) {
case PACK_MODE_G1:
- /* i = (x/128)*640 + 127 - x + (y/8)*128;
- This one for 128 is the same, but might be better
- for different widths? */
+ /*
+ * i = (x/128)*640 + 127 - x + (y/8)*128;
+ * This one for 128 is the same, but might be better
+ * for different widths?
+ */
i = (x/odev->dev_width)*640 +
odev->dev_width - 1 - x +
(y/8)*odev->dev_width;
@@ -383,10 +387,8 @@ static int append_values(struct asus_oled_dev *odev, uint8_t val, size_t count)
}
if (i >= odev->buf_size) {
- dev_err(odev->dev, "Buffer overflow! Report a bug:"
- "offs: %d >= %d i: %d (x: %d y: %d)\n",
- (int) odev->buf_offs, (int) odev->buf_size,
- (int) i, (int) x, (int) y);
+ dev_err(odev->dev, "Buffer overflow! Report a bug: offs: %zu >= %zu i: %zu (x: %zu y: %zu)\n",
+ odev->buf_offs, odev->buf_size, i, x, y);
return -EIO;
}
@@ -401,7 +403,7 @@ static int append_values(struct asus_oled_dev *odev, uint8_t val, size_t count)
default:
/* cannot get here; stops gcc complaining*/
- ;
+ break;
}
odev->buf_offs++;
@@ -566,9 +568,11 @@ static ssize_t odev_set_picture(struct asus_oled_dev *odev,
if (ret < 0)
return ret;
} else if (buf[offs] == '\n') {
- /* New line detected. Lets assume, that all characters
- till the end of the line were equal to the last
- character in this line.*/
+ /*
+ * New line detected. Lets assume, that all characters
+ * till the end of the line were equal to the last
+ * character in this line.
+ */
if (odev->buf_offs % odev->width != 0)
ret = append_values(odev, odev->last_val,
odev->width -