From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2470EFA372B for ; Wed, 16 Oct 2019 14:23:43 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id ADDF6218DE for ; Wed, 16 Oct 2019 14:23:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ADDF6218DE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 2AC858E0032; Wed, 16 Oct 2019 10:23:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 25CDF8E0001; Wed, 16 Oct 2019 10:23:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1730E8E0032; Wed, 16 Oct 2019 10:23:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0131.hostedemail.com [216.40.44.131]) by kanga.kvack.org (Postfix) with ESMTP id E9BBF8E0001 for ; Wed, 16 Oct 2019 10:23:41 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with SMTP id 8D9F018233661 for ; Wed, 16 Oct 2019 14:23:41 +0000 (UTC) X-FDA: 76049866242.16.yard16_776f122e2f561 X-HE-Tag: yard16_776f122e2f561 X-Filterd-Recvd-Size: 2446 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf07.hostedemail.com (Postfix) with ESMTP for ; Wed, 16 Oct 2019 14:23:40 +0000 (UTC) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 6B1F4142F; Wed, 16 Oct 2019 07:23:39 -0700 (PDT) Received: from e119884-lin.cambridge.arm.com (e119884-lin.cambridge.arm.com [10.1.196.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A62433F68E; Wed, 16 Oct 2019 07:23:38 -0700 (PDT) From: Vincenzo Frascino To: linux-mm@kvack.org, linux-kernel@vger.kernel.org Cc: mike.kravetz@oracle.com, vincenzo.frascino@arm.com Subject: [PATCH] hugetlb: Fix clang compilation warning Date: Wed, 16 Oct 2019 15:23:24 +0100 Message-Id: <20191016142324.52250-1-vincenzo.frascino@arm.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Building the kernel with a recent version of clang I noticed the warning below: mm/hugetlb.c:4055:40: warning: expression does not compute the number of elements in this array; element type is 'unsigned long', not 'u32' (aka 'unsigned int') [-Wsizeof-array-div] hash =3D jhash2((u32 *)&key, sizeof(key)/sizeof(u32), 0); ~~~ ^ mm/hugetlb.c:4049:16: note: array 'key' declared here unsigned long key[2]; ^ mm/hugetlb.c:4055:40: note: place parentheses around the 'sizeof(u32)' expression to silence this warning hash =3D jhash2((u32 *)&key, sizeof(key)/sizeof(u32), 0); ^ CC fs/ext4/ialloc.o Fix the warning adding parentheses around the sizeof(u32) expression. Cc: Mike Kravetz Signed-off-by: Vincenzo Frascino --- mm/hugetlb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index ef37c85423a5..ce9ff2b35962 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -4052,7 +4052,7 @@ u32 hugetlb_fault_mutex_hash(struct hstate *h, stru= ct address_space *mapping, key[0] =3D (unsigned long) mapping; key[1] =3D idx; =20 - hash =3D jhash2((u32 *)&key, sizeof(key)/sizeof(u32), 0); + hash =3D jhash2((u32 *)&key, sizeof(key)/(sizeof(u32)), 0); =20 return hash & (num_fault_mutexes - 1); } --=20 2.23.0