Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2734292yba; Mon, 8 Apr 2019 03:37:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqx0mbXKacxYWdWB6wRUu5FPJDRReQn7OYfT19tgBwI+Z1+POrQSwcfyLt54DxkVj2bFSBPg X-Received: by 2002:a63:570d:: with SMTP id l13mr27609038pgb.55.1554719855670; Mon, 08 Apr 2019 03:37:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554719855; cv=none; d=google.com; s=arc-20160816; b=tx3AAo2TYFWlG0QkDlBixHbnxTDDJdXeZ9DaLJreXy5p5P9LhnqrLKL5od4WgS2RR6 8yjZlPY+VI77pzS8GLrt02zZ5utRhm1XtH7ypnmE30aFXgX10eXFRc1RLhxZcjj94K8U uf2Nisepv3GkbFZ26bSV840EwLuB/Y93pRtnh4WfwW3yz5svdZD6cspSFHKARun9X1cp ge26YOsIH3kNaUtIK9pAZ0FiKJDx4juTl13d23IzQQFIHTOSy9Z4kSR8NB+iOQB/q55A huiWHFauwVXYUKkHt6jjba6cqgyQwHmxqEp8ka65PItQU4GRmFWL+Oq/G6kM+SLZd8eI gQag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:autocrypt:openpgp:from:references:cc:to :subject; bh=HpEnswgs9Cye5uN7cXSdz5jvEkTa30FajzeMIwX+UPo=; b=xkkMpJiXkFeyGar8PWIf4MEcEQySeqEk6+6ahs69Q3nPNMP0WUq+NILzmNMw1TC9GD pzspRt83/CIjhVcQxrx9uCQ0TJkBusE7U4wUYnWbu5ctX7q++ShVsheUsNsQXwIaHk1y mm/Yl49/8h3o/KBHbGKIb6ZpK+zVaLTVHPoPjiwV3I2xhTHCvcmUKJQP7fwbydMLxHgx v3fxbUp9UiUUXPFb2heoEkMrGlOX1i4uud584vZRXr3BRZN32A+/oUS77QkjWJRBArmd 2xjE6FhW5hrPGSMXNTi23937xGZ/+Gk1Tiga+rAyU67cBRvS5YnQDhvUBSqq7Gzjbx3D vaYw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o12si25218397pgp.94.2019.04.08.03.37.19; Mon, 08 Apr 2019 03:37:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726373AbfDHKgj (ORCPT + 99 others); Mon, 8 Apr 2019 06:36:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46108 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725857AbfDHKgi (ORCPT ); Mon, 8 Apr 2019 06:36:38 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 461B9C04F4D3; Mon, 8 Apr 2019 10:36:38 +0000 (UTC) Received: from thuth.remote.csb (ovpn-116-50.ams2.redhat.com [10.36.116.50]) by smtp.corp.redhat.com (Postfix) with ESMTP id E88D660CD0; Mon, 8 Apr 2019 10:36:33 +0000 (UTC) Subject: Re: [PATCH] s390/mm: Silence compiler warning when compiling without CONFIG_PGSTE To: David Hildenbrand , Martin Schwidefsky , Heiko Carstens , linux-s390@vger.kernel.org Cc: linux-kernel@vger.kernel.org References: <20190407125509.6380-1-thuth@redhat.com> <0e63589f-190f-d3a4-b373-4188dfe54e26@redhat.com> From: Thomas Huth Openpgp: preference=signencrypt Autocrypt: addr=thuth@redhat.com; keydata= xsFNBFH7eUwBEACzyOXKU+5Pcs6wNpKzrlJwzRl3VGZt95VCdb+FgoU9g11m7FWcOafrVRwU yYkTm9+7zBUc0sW5AuPGR/dp3pSLX/yFWsA/UB4nJsHqgDvDU7BImSeiTrnpMOTXb7Arw2a2 4CflIyFqjCpfDM4MuTmzTjXq4Uov1giGE9X6viNo1pxyEpd7PanlKNnf4PqEQp06X4IgUacW tSGj6Gcns1bCuHV8OPWLkf4hkRnu8hdL6i60Yxz4E6TqlrpxsfYwLXgEeswPHOA6Mn4Cso9O 0lewVYfFfsmokfAVMKWzOl1Sr0KGI5T9CpmRfAiSHpthhHWnECcJFwl72NTi6kUcUzG4se81 O6n9d/kTj7pzTmBdfwuOZ0YUSqcqs0W+l1NcASSYZQaDoD3/SLk+nqVeCBB4OnYOGhgmIHNW 0CwMRO/GK+20alxzk//V9GmIM2ACElbfF8+Uug3pqiHkVnKqM7W9/S1NH2qmxB6zMiJUHlTH gnVeZX0dgH27mzstcF786uPcdEqS0KJuxh2kk5IvUSL3Qn3ZgmgdxBMyCPciD/1cb7/Ahazr 3ThHQXSHXkH/aDXdfLsKVuwDzHLVSkdSnZdt5HHh75/NFHxwaTlydgfHmFFwodK8y/TjyiGZ zg2Kje38xnz8zKn9iesFBCcONXS7txENTzX0z80WKBhK+XSFJwARAQABzRxUaG9tYXMgSHV0 aCA8dGguaHV0aEBnbXguZGU+wsF7BBMBAgAlAhsDBgsJCAcDAgYVCAIJCgsEFgIDAQIeAQIX gAUCUfuWKwIZAQAKCRAu2dd0/nAttbe/EACb9hafyOb2FmhUqeAiBORSsUifFacQ7laVjcgR I4um8CSHvxijYftpk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200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <0e63589f-190f-d3a4-b373-4188dfe54e26@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 08 Apr 2019 10:36:38 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/04/2019 09.09, David Hildenbrand wrote: > On 07.04.19 14:55, Thomas Huth wrote: >> If CONFIG_PGSTE is not set (e.g. when compiling without KVM), GCC complains: >> >> CC arch/s390/mm/pgtable.o >> arch/s390/mm/pgtable.c:413:15: warning: ‘pmd_alloc_map’ defined but not >> used [-Wunused-function] >> static pmd_t *pmd_alloc_map(struct mm_struct *mm, unsigned long addr) >> ^~~~~~~~~~~~~ >> >> Wrap the function with "#ifdef CONFIG_PGSTE" to silence the warning. >> >> Signed-off-by: Thomas Huth >> --- >> arch/s390/mm/pgtable.c | 2 ++ >> 1 file changed, 2 insertions(+) >> >> diff --git a/arch/s390/mm/pgtable.c b/arch/s390/mm/pgtable.c >> index 8485d6dc2754..9ebd01219812 100644 >> --- a/arch/s390/mm/pgtable.c >> +++ b/arch/s390/mm/pgtable.c >> @@ -410,6 +410,7 @@ static inline pmd_t pmdp_flush_lazy(struct mm_struct *mm, >> return old; >> } >> >> +#ifdef CONFIG_PGSTE >> static pmd_t *pmd_alloc_map(struct mm_struct *mm, unsigned long addr) >> { >> pgd_t *pgd; >> @@ -427,6 +428,7 @@ static pmd_t *pmd_alloc_map(struct mm_struct *mm, unsigned long addr) >> pmd = pmd_alloc(mm, pud, addr); >> return pmd; >> } >> +#endif >> > > We could also move the function down to the functions where it is used Yeah, I thought about that, too. Both have advantages: - If we keep the code here, "git blame" shows a nicer history of these lines - If we move the code, we need less #ifdefs I'll leave the decision to the maintainers... Martin, Heiko? > Reviewed-by: David Hildenbrand Thanks, Thomas