lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu,  8 Nov 2018 20:28:01 -0600
From:   "Darryl T. Agostinelli" <dagostinelli@...il.com>
To:     linux-mm@...ck.org
Cc:     cl@...ux.com, bvanassche@....org, akpm@...ux-foundation.org,
        penberg@...nel.org, vbabka@...e.cz, rientjes@...gle.com,
        iamjoonsoo.kim@....com, linux-kernel@...r.kernel.org,
        "Darryl T. Agostinelli" <dagostinelli@...il.com>
Subject: [PATCH] Suppress the sparse warning ./include/linux/slab.h:332:43: warning: dubious: x & !y

Signed-off-by: Darryl T. Agostinelli <dagostinelli@...il.com>
---
 include/linux/slab.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/linux/slab.h b/include/linux/slab.h
index 918f374e7156..883b7f56bf35 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -317,6 +317,7 @@ static __always_inline enum kmalloc_cache_type kmalloc_type(gfp_t flags)
 	int is_dma = 0;
 	int type_dma = 0;
 	int is_reclaimable;
+	int y;
 
 #ifdef CONFIG_ZONE_DMA
 	is_dma = !!(flags & __GFP_DMA);
@@ -329,7 +330,10 @@ static __always_inline enum kmalloc_cache_type kmalloc_type(gfp_t flags)
 	 * If an allocation is both __GFP_DMA and __GFP_RECLAIMABLE, return
 	 * KMALLOC_DMA and effectively ignore __GFP_RECLAIMABLE
 	 */
-	return type_dma + (is_reclaimable & !is_dma) * KMALLOC_RECLAIM;
+
+	y = (is_reclaimable & (is_dma == 0 ? 1 : 0));
+
+	return type_dma + y * KMALLOC_RECLAIM;
 }
 
 /*
-- 
2.17.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ