drm/vmwgfx: Fix order of operation
authorSinclair Yeh <syeh@vmware.com>
Thu, 21 Apr 2016 18:29:31 +0000 (11:29 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Jun 2016 01:18:51 +0000 (18:18 -0700)
commit0238907f5506a7c2dab3c9bc6b875034017c4fad
tree318516c652dd29c30cee0cf44293fcf6555170d7
parent21da473b6f906b5faa0043872f121b74f3602523
drm/vmwgfx: Fix order of operation

commit 7851496a32319237456919575e5f4ba62f74cc7d upstream.

mode->hdisplay * (var->bits_per_pixel + 7) gets evaluated before
the division, potentially making the pitch larger than it should
be.

Since the original intention is to do a div-round-up, just use
the macro instead.

Signed-off-by: Sinclair Yeh <syeh@vmware.com>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/vmwgfx/vmwgfx_fb.c