[1/9] exa: fix "comparison is always false"

Submitted by Konstantin Kharlamov on March 23, 2019, 11:51 p.m.

Details

Message ID 20190323235203.30143-2-Hi-Angel@yandex.ru
State New
Headers show
Series "Fix some of LGTM warnings" ( rev: 2 1 ) in X.org

Not browsing as part of any series.

Commit Message

Konstantin Kharlamov March 23, 2019, 11:51 p.m.
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>
---
 exa/exa_driver.c | 2 +-
 exa/exa_mixed.c  | 4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

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 f618a1ea8..b2b5d3390 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;
 }
-
-