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=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 B0FA5FA3728 for ; Wed, 16 Oct 2019 16:39:16 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 58B922168B for ; Wed, 16 Oct 2019 16:39:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 58B922168B 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 C805D8E000A; Wed, 16 Oct 2019 12:39:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C301A8E0005; Wed, 16 Oct 2019 12:39:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B44E78E000A; Wed, 16 Oct 2019 12:39:15 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0179.hostedemail.com [216.40.44.179]) by kanga.kvack.org (Postfix) with ESMTP id 8DEE48E0005 for ; Wed, 16 Oct 2019 12:39:15 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 3D6B382FAD43 for ; Wed, 16 Oct 2019 16:39:15 +0000 (UTC) X-FDA: 76050207870.19.fold15_8ae78ef9b5a18 X-HE-Tag: fold15_8ae78ef9b5a18 X-Filterd-Recvd-Size: 2548 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Wed, 16 Oct 2019 16:39:14 +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 95ADC28; Wed, 16 Oct 2019 09:39:12 -0700 (PDT) Received: from [192.168.1.103] (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B24C73F68E; Wed, 16 Oct 2019 09:39:11 -0700 (PDT) Subject: Re: [PATCH] hugetlb: Fix clang compilation warning To: Mike Kravetz , linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20191016142324.52250-1-vincenzo.frascino@arm.com> <29fdadee-2e0c-0886-73b3-358f983fd1fd@oracle.com> From: Vincenzo Frascino Message-ID: Date: Wed, 16 Oct 2019 17:41:02 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <29fdadee-2e0c-0886-73b3-358f983fd1fd@oracle.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit 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: Hi Mike, On 10/16/19 4:21 PM, Mike Kravetz wrote: > On 10/16/19 7:23 AM, Vincenzo Frascino wrote: >> 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 > > Thanks, > > However, this is already addressed in Andrew's tree. > https://ozlabs.org/~akpm/mmotm/broken-out/hugetlbfs-hugetlb_fault_mutex_hash-cleanup.patch > Thank you for pointing this out. -- Regards, Vincenzo