OSDN Git Service

staging: vboxvideo: Cleanup vbox_set_up_input_mapping()
authorHans de Goede <hdegoede@redhat.com>
Sat, 29 Sep 2018 12:18:11 +0000 (14:18 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 29 Sep 2018 12:31:32 +0000 (05:31 -0700)
commit8568209b5445b3cc2220b3ebbcf089e9207c1745
treeefe7a49049d3d7043b9e86c4e9e0a6ff426ebae6
parentca2c4bee47f8f1d03edd3dad68472abd7752e1e6
staging: vboxvideo: Cleanup vbox_set_up_input_mapping()

This cleanups 2 things:

1) The first time we loop over the crtc-s, to compare framebuffers, fb1 may
get set to NULL by the fb1 = CRTC_FB(crtci); statement and then we call
to_vbox_framebuffer() on it. The result of this call is only used for
an address comparison, so we don't end up dereferencing the bad pointer,
but still it is better to not do this.

2) Since we already figure out the first crtc with a fb in the first loop
and store that in fb1, there is no need to loop over the crtc-s again just
to find the first crtc with a fb again.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vboxvideo/vbox_mode.c