mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-02 17:26:42 +09:00
Staging: asus_oled: fix image processing
commit635032cb39upstream. Programming an image was broken, because odev->buf_offs was not advanced for val == 0 in append_values(). This regression was introduced in: commit1ff12a4aa3Author: Kevin A. Granade <kevin.granade@gmail.com> Date: Sat Sep 5 01:03:39 2009 -0500 Staging: asus_oled: Cleaned up checkpatch issues. Fix the image processing by special-casing val == 0. I have tested this change on an Asus G50V laptop only. Cc: Jakub Schmidtke <sjakub@gmail.com> Cc: Kevin A. Granade <kevin.granade@gmail.com> Signed-off-by: Pekka Paalanen <pq@iki.fi> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
967a6f42d1
commit
3f64466ca0
@@ -355,7 +355,14 @@ static void send_data(struct asus_oled_dev *odev)
|
||||
|
||||
static int append_values(struct asus_oled_dev *odev, uint8_t val, size_t count)
|
||||
{
|
||||
while (count-- > 0 && val) {
|
||||
odev->last_val = val;
|
||||
|
||||
if (val == 0) {
|
||||
odev->buf_offs += count;
|
||||
return 0;
|
||||
}
|
||||
|
||||
while (count-- > 0) {
|
||||
size_t x = odev->buf_offs % odev->width;
|
||||
size_t y = odev->buf_offs / odev->width;
|
||||
size_t i;
|
||||
@@ -406,7 +413,6 @@ static int append_values(struct asus_oled_dev *odev, uint8_t val, size_t count)
|
||||
;
|
||||
}
|
||||
|
||||
odev->last_val = val;
|
||||
odev->buf_offs++;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user