video: fbdev: ssd1307fb: Simplify ssd1307fb_update_display()
authorGeert Uytterhoeven <geert@linux-m68k.org>
Tue, 27 Jul 2021 13:47:27 +0000 (15:47 +0200)
committerSam Ravnborg <sam@ravnborg.org>
Tue, 27 Jul 2021 15:18:18 +0000 (17:18 +0200)
commitef9d793825b56ec4289d2b848c9318352fa2cd13
tree69e488ed8aa05a0d322eecb23e1a18cbf7289a99
parent7b4b3733fd68d986c3f790e47aa6116d229e949e
video: fbdev: ssd1307fb: Simplify ssd1307fb_update_display()

Simplify the nested loops to handle conversion from linear frame buffer
to ssd1307 page layout:
  1. Move last page handling one level up, as the value of "m" is the
     same inside a page,
  2. array->data[] is filled linearly, so there is no need to
     recalculate array_idx over and over again; a simple increment is
     sufficient.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210727134730.3765898-3-geert@linux-m68k.org
drivers/video/fbdev/ssd1307fb.c