From 1d80db55ddfa45edc7fae39b3c9382d7b60f8f72 Mon Sep 17 00:00:00 2001 From: Konstantin Kharlamov Date: Sun, 24 Mar 2019 01:37:27 +0300 Subject: [PATCH] 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 --- exa/exa_driver.c | 2 +- exa/exa_mixed.c | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/exa/exa_driver.c b/exa/exa_driver.c index 8799a798e..45acf152c 100644 --- a/exa/exa_driver.c +++ b/exa/exa_driver.c @@ -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); diff --git a/exa/exa_mixed.c b/exa/exa_mixed.c index 1e67ec23a..d926f8033 100644 --- a/exa/exa_mixed.c +++ b/exa/exa_mixed.c @@ -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; } - -