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=-2.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 30A53C4CECF for ; Mon, 23 Sep 2019 20:30:07 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E4713205F4 for ; Mon, 23 Sep 2019 20:30:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="VHmi5aYg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E4713205F4 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9109E6B0273; Mon, 23 Sep 2019 16:30:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8BFF06B027C; Mon, 23 Sep 2019 16:30:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7D5B96B027E; Mon, 23 Sep 2019 16:30:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0171.hostedemail.com [216.40.44.171]) by kanga.kvack.org (Postfix) with ESMTP id 5618C6B0273 for ; Mon, 23 Sep 2019 16:30:06 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id 035F8906F for ; Mon, 23 Sep 2019 20:30:06 +0000 (UTC) X-FDA: 75967327212.16.trees14_581e014d08246 X-HE-Tag: trees14_581e014d08246 X-Filterd-Recvd-Size: 3524 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) by imf33.hostedemail.com (Postfix) with ESMTP for ; Mon, 23 Sep 2019 20:30:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=u1yCnI6sH3Gw9Qw23qli99d/VVO9CPeV83k5czCD2Ao=; b=VHmi5aYgjKyErAWDeWOvlEntU LfbTawitsUMRLZN+LxfIPl2tws5Fb7khgrgBcqnpFrgEyUHS/hfCGvA+1G3Aj+fpGsGSS3gErxNph MlmZ1/UFc/s95XMzDMEdUDytZAODqhO6PQJ1BMD/XTho3caTmvwjRgNbO/8v30w27AUu2QDH6oM6c 8EeeLC2Kb6+LKeOXIk1Q7AoILeHNdki7m+/NL3b/AG9xSbXdhaJOPr2tZzlKS7yumaYDlF7YRMaG7 TLyWG+njrWqMDorCxoFy8esNzahcanXRroBewysCHvpqL2Q7L/KB3h6prJROZysL7ZQ04VOm0yrre wrtuBOxVw==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.2 #3 (Red Hat Linux)) id 1iCUy9-0000oa-Rx; Mon, 23 Sep 2019 20:30:01 +0000 Date: Mon, 23 Sep 2019 13:30:01 -0700 From: Matthew Wilcox To: Ira Weiny Cc: Andrew Morton , kbuild test robot , kbuild-all@01.org, linux-mm@kvack.org Subject: Re: [PATCH v2 2/3] mm: Introduce page_shift() Message-ID: <20190923203001.GD1855@bombadil.infradead.org> References: <20190721104612.19120-3-willy@infradead.org> <201907241853.yNQTrJWd%lkp@intel.com> <20190724173055.d3c6993bfdad0f49f95b311c@linux-foundation.org> <20190725203011.GA7362@iweiny-DESK2.sc.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190725203011.GA7362@iweiny-DESK2.sc.intel.com> User-Agent: Mutt/1.12.1 (2019-06-15) 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: On Thu, Jul 25, 2019 at 01:30:12PM -0700, Ira Weiny wrote: > On Wed, Jul 24, 2019 at 05:30:55PM -0700, Andrew Morton wrote: > > On Wed, 24 Jul 2019 18:40:25 +0800 kbuild test robot wrote: > > > drivers/vfio/vfio_iommu_spapr_tce.c: In function 'tce_page_is_contained': > > > >> drivers/vfio/vfio_iommu_spapr_tce.c:193:9: error: called object 'page_shift' is not a function or function pointer > > > return page_shift(compound_head(page)) >= page_shift; > > > ^~~~~~~~~~ > > > drivers/vfio/vfio_iommu_spapr_tce.c:179:16: note: declared here > > > unsigned int page_shift) > > > ^~~~~~~~~~ > > > > This? > > Looks reasonable to me. But checking around it does seem like "page_shift" is > used as a parameter or variable in quite a few other places. > > Is this something to be concerned with? Sorry, I missed this earlier. It's not currently a warning because we don't enable -Wshadow. For functions which have a parameter or variable named page_shift, the local definition overrides the global function. They continue to work "as expected". The only reason this particular function has an issue is that it also wants to call the function page_shift(). The compiler resolves the symbol 'page_shift' to be the parameter, and says "This is an int, not a function, you're clearly mistaken". We don't need to mass-rename all the local variables called page_shift, unless we want to enable -Wshadow. Which I would actually like to do, but I don't have time.