exa: fix "comparison is always false"

Both functions has a check at the beginning to return when h > 32767.

Fixes LGTM 2 warnings "Comparison is always false because h <= 32767."

Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
This commit is contained in:
Konstantin Kharlamov 2019-03-24 01:37:27 +03:00 committed by Alan Coopersmith
parent a79bd188fe
commit 1d80db55dd
2 changed files with 2 additions and 4 deletions

View File

@ -87,7 +87,7 @@ exaCreatePixmap_driver(ScreenPtr pScreen, int w, int h, int depth,
}
else {
paddedWidth = ((w * bpp + FB_MASK) >> FB_SHIFT) * sizeof(FbBits);
if (paddedWidth / 4 > 32767 || h > 32767)
if (paddedWidth / 4 > 32767)
return NullPixmap;
exaSetFbPitch(pExaScr, pExaPixmap, w, h, bpp);

View File

@ -72,7 +72,7 @@ exaCreatePixmap_mixed(ScreenPtr pScreen, int w, int h, int depth,
bpp = pPixmap->drawable.bitsPerPixel;
paddedWidth = ((w * bpp + FB_MASK) >> FB_SHIFT) * sizeof(FbBits);
if (paddedWidth / 4 > 32767 || h > 32767)
if (paddedWidth / 4 > 32767)
return NullPixmap;
/* We will allocate the system pixmap later if needed. */
@ -326,5 +326,3 @@ exaSetSharedPixmapBacking_mixed(PixmapPtr pPixmap, void *handle)
return ret;
}