Skip to contentSkip to conversation

zsmalloc: use U suffix for negative literals being shifted

PATCH In review [email protected] 1 participant 1 message Feb 1, 2018

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 100/119 zsmalloc: use U suffix for negative literals being shifted

From: Nick Desaulniers <[email protected]>
Subject: zsmalloc: use U suffix for negative literals being shifted

Fix warning about shifting unsigned literals being undefined behavior.

---

 mm/zsmalloc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/zsmalloc.c renamed from mm/zsmalloc.c~zsmalloc-use-u-suffix-for-negative-literals-being-shifted +1 -1
diff -puN mm/zsmalloc.c~zsmalloc-use-u-suffix-for-negative-literals-being-shifted mm/zsmalloc.c
@@ -1047,7 +1047,7 @@ static void init_zspage(struct size_clas
 			 * Reset OBJ_TAG_BITS bit to last link to tell
 			 * whether it's allocated object or not.
 			 */
-			link->next = -1 << OBJ_TAG_BITS;
+			link->next = -1UL << OBJ_TAG_BITS;
 		}
 		kunmap_atomic(vaddr);
 		page = next_page;

_