]> git.baikalelectronics.ru Git - kernel.git/commit
drm/vmwgfx: Fix order of operation
authorSinclair Yeh <syeh@vmware.com>
Thu, 21 Apr 2016 18:29:31 +0000 (11:29 -0700)
committerSinclair Yeh <syeh@vmware.com>
Thu, 28 Apr 2016 18:07:30 +0000 (11:07 -0700)
commit9f009c7172552f229eff61581ff6c4a4ef2d3acc
tree3115350947df1fcf593116917c7d9c4bbb0f8aa1
parentbe03096a88229148c1ba8fc31d403332c4ca5279
drm/vmwgfx: Fix order of operation

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>
drivers/gpu/drm/vmwgfx/vmwgfx_fb.c