Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753611AbeAKDlF (ORCPT + 1 other); Wed, 10 Jan 2018 22:41:05 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:37719 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753131AbeAKDlE (ORCPT ); Wed, 10 Jan 2018 22:41:04 -0500 X-Google-Smtp-Source: ACJfBotLO1NB0G5a93tU7YtloYuIsmIitFo56iMnMVf/Q4QySllNmO52VI64nawmfDdpKcr7z568iA== From: Nick Desaulniers To: akpm@linux-foundation.org Cc: Andy Shevchenko , Matthew Wilcox , Nick Desaulniers , Minchan Kim , Nitin Gupta , Sergey Senozhatsky , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] zsmalloc: use U suffix for negative literals being shifted Date: Wed, 10 Jan 2018 19:41:18 -0800 Message-Id: <1515642078-4259-1-git-send-email-nick.desaulniers@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <20180110055338.h3cs5hw7mzsdtcad@eng-minchan1.roam.corp.google.com> References: <20180110055338.h3cs5hw7mzsdtcad@eng-minchan1.roam.corp.google.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: Fixes warnings about shifting unsigned literals being undefined behavior. Suggested-by: Minchan Kim Signed-off-by: Nick Desaulniers --- Changes since v1: * Use L suffix in addition to U, as suggested (link->next is unsigned long). mm/zsmalloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index 683c065..b9040bd 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -1057,7 +1057,7 @@ static void init_zspage(struct size_class *class, struct zspage *zspage) * 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; -- 2.7.4