From patchwork Wed Oct 16 14:23:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincenzo Frascino X-Patchwork-Id: 11193439 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 526BC76 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 0ACA021A49 for ; Wed, 16 Oct 2019 14:23:43 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0ACA021A49 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) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 25CDF8E0001; Wed, 16 Oct 2019 10:23:42 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org 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-Original-To: linux-mm@kvack.org 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-Spam-Summary: 2,0,0,71afea5c68ca4b8f,d41d8cd98f00b204,vincenzo.frascino@arm.com,::linux-kernel@vger.kernel.org:mike.kravetz@oracle.com:vincenzo.frascino@arm.com,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1261:1311:1314:1345:1437:1515:1534:1541:1711:1730:1747:1777:1792:1801:2393:2559:2562:3138:3139:3140:3141:3142:3352:3865:3866:3867:3870:3871:4321:4605:5007:6261:8634:9121:10004:11026:11233:11658:11914:12043:12295:12296:12297:12438:12517:12519:12555:12679:12895:12986:13069:13311:13357:13894:14181:14384:14394:14721:21067:21080:21451:21627:30034:30054:30064,0,RBL:217.140.110.172:@arm.com:.lbl8.mailshell.net-62.2.0.100 64.100.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:27,LUA_SUMMARY:none 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 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 = 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 = 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, struct address_space *mapping, key[0] = (unsigned long) mapping; key[1] = idx; - hash = jhash2((u32 *)&key, sizeof(key)/sizeof(u32), 0); + hash = jhash2((u32 *)&key, sizeof(key)/(sizeof(u32)), 0); return hash & (num_fault_mutexes - 1); }