Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fbdev/core: simplify cursor_state setting in fbcon_ops::cursor()

There is a switch decicing if cursor should be drawn or not. The whole
switch can be simplified to one line. Do this cleanup as a preparatory
work for the next patch. There, all the CM_* constants are removed.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Helge Deller <deller@gmx.de>
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Tested-by: Helge Deller <deller@gmx.de> # parisc STI console
Link: https://lore.kernel.org/r/20240122110401.7289-29-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
9aefbaeb 7c5337c9

+4 -40
+1 -10
drivers/video/fbdev/core/bitblit.c
··· 348 348 mask[i++] = msk; 349 349 } 350 350 351 - switch (mode) { 352 - case CM_ERASE: 353 - ops->cursor_state.enable = 0; 354 - break; 355 - case CM_DRAW: 356 - case CM_MOVE: 357 - default: 358 - ops->cursor_state.enable = (use_sw) ? 0 : 1; 359 - break; 360 - } 351 + ops->cursor_state.enable = (mode != CM_ERASE) && !use_sw; 361 352 362 353 cursor.image.data = src; 363 354 cursor.image.fg_color = ops->cursor_state.image.fg_color;
+1 -10
drivers/video/fbdev/core/fbcon_ccw.c
··· 349 349 kfree(tmp); 350 350 } 351 351 352 - switch (mode) { 353 - case CM_ERASE: 354 - ops->cursor_state.enable = 0; 355 - break; 356 - case CM_DRAW: 357 - case CM_MOVE: 358 - default: 359 - ops->cursor_state.enable = (use_sw) ? 0 : 1; 360 - break; 361 - } 352 + ops->cursor_state.enable = (mode != CM_ERASE) && !use_sw; 362 353 363 354 cursor.image.data = src; 364 355 cursor.image.fg_color = ops->cursor_state.image.fg_color;
+1 -10
drivers/video/fbdev/core/fbcon_cw.c
··· 332 332 kfree(tmp); 333 333 } 334 334 335 - switch (mode) { 336 - case CM_ERASE: 337 - ops->cursor_state.enable = 0; 338 - break; 339 - case CM_DRAW: 340 - case CM_MOVE: 341 - default: 342 - ops->cursor_state.enable = (use_sw) ? 0 : 1; 343 - break; 344 - } 335 + ops->cursor_state.enable = (mode != CM_ERASE) && !use_sw; 345 336 346 337 cursor.image.data = src; 347 338 cursor.image.fg_color = ops->cursor_state.image.fg_color;
+1 -10
drivers/video/fbdev/core/fbcon_ud.c
··· 372 372 mask[i++] = ~msk; 373 373 } 374 374 375 - switch (mode) { 376 - case CM_ERASE: 377 - ops->cursor_state.enable = 0; 378 - break; 379 - case CM_DRAW: 380 - case CM_MOVE: 381 - default: 382 - ops->cursor_state.enable = (use_sw) ? 0 : 1; 383 - break; 384 - } 375 + ops->cursor_state.enable = (mode != CM_ERASE) && !use_sw; 385 376 386 377 cursor.image.data = src; 387 378 cursor.image.fg_color = ops->cursor_state.image.fg_color;