Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp954397ybk; Wed, 20 May 2020 16:49:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzhnUu/nCBvi8Cf5gH+hCTbMNUYjbhEhn8bwNsnrmvp2r11OvE049u52KsRag2+/TZcpNJ X-Received: by 2002:a50:9547:: with SMTP id v7mr6028244eda.78.1590018545829; Wed, 20 May 2020 16:49:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590018545; cv=none; d=google.com; s=arc-20160816; b=ZRMwJGMzy2vyzVVOUelntoZB78ObR8Vaer5PY9nftXxGhNVf/cSEqSOOLKHGIwPBQh Z59S2daInSykNzovTVfUidij+JF2wDdRdNe/nMYqiqwS/QOJXFlNBMFmRi84voU2N60h 4VI8pCLbIhEeYK+IKgJmGJkcI2moKGFzgTVqvg+iu7zb+5Gy/BNWFQtDQRY0A50IpuPq CKjgT2HOjObZXA3bAcQBb5yuQEazGHyrUi3+VRm9ZHfPTacmI+IIJVcIqXex15UPwSx2 LyWV2hEbwyqegl99vgp+TNf9CLCNX8uexMPR3MBOlwXeyHoZP56UaE6REIssBeV1BDCE hXgA== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=HLsmvMWszFpQ6+2S0ORxNyu3Zmm5W8wSFmBi7GLJXJg=; b=GnyBBme1P5cH1HdSXJO2IA2O61+4al52oTUtwguIPeRedrO4cZPzgcI60c3CKWL1yO QwKJn6aszYxsl2eYUr3V9U0AucmRuusFgLcul7eR2DDB7WrKSH+C5ZaGHccWrhzitYi1 x++VofPG/beMQaDfI8JR5Nf1nr+jzB1gSpddhVgkOkJI44w75ktYTIi/Pa2/LlDPyVG/ 9QCl/eNIjMwhigX+MEZbfvoddSTDamj2QQ49ixJ9MxsdQAKIVS/54/EVO9hrNQ1kDliM fZ+kKB1+XK0ZkwcvMdcFw41kmL67QTLU3zd2guOPOQosWuL8VLdFzo9MFORPNaNY8yH7 F2FA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cmyy1rpZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d1si2442690edl.266.2020.05.20.16.48.43; Wed, 20 May 2020 16:49:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cmyy1rpZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726836AbgETXq3 (ORCPT + 99 others); Wed, 20 May 2020 19:46:29 -0400 Received: from mail.kernel.org ([198.145.29.99]:37768 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726566AbgETXq3 (ORCPT ); Wed, 20 May 2020 19:46:29 -0400 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 356812072C; Wed, 20 May 2020 23:46:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590018389; bh=UKbQAHmEfC9mkte28yLtBrav7B0MDclF17mYfAh92ec=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=cmyy1rpZhufq5eY5YrwCpjq6gzFp6UGrPGPrlx1tSvtfwHUN4i/XsAAtZKU7eWIfc zAsXUxt0WVxxY3rXs+JFFBrzQfbJUxgMmmTKVzPZK5LghjaAICKol+ZpwOrO2pFDCI ZGpP1EzFaBvvbsiynQyceo3y1OQSYLde4APj5MzM= Date: Wed, 20 May 2020 16:46:28 -0700 From: Andrew Morton To: Mike Rapoport Cc: kbuild test robot , kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, Linux Memory Management List Subject: Re: arch/sparc/mm/srmmu.c:300:9: error: variable 'pud' set but not used Message-Id: <20200520164628.fda1af0c681bbae498dd7ba7@linux-foundation.org> In-Reply-To: <20200520132005.GM1059226@linux.ibm.com> References: <20200520005733.GB3101@intel.com> <20200520132005.GM1059226@linux.ibm.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 20 May 2020 16:20:05 +0300 Mike Rapoport wrote: > The kbuild test robot reported the following warning: > > arch/sparc/mm/srmmu.c: In function 'srmmu_nocache_init': > >> arch/sparc/mm/srmmu.c:300:9: error: variable 'pud' set but not used > >> [-Werror=unused-but-set-variable] > 300 | pud_t *pud; > > This warning is caused by misprint in the page table traversal in > srmmu_nocache_init() function which accessed a PMD entry using PGD rather > than PUD. > Since sparc32 has only 3 page table levels, the PGD and PUD are essentially > the same and usage of __nocache_fix() removed the type checking. > > Use PUD for the consistency and to silence the compiler warning. > > ... > > --- a/arch/sparc/mm/srmmu.c > +++ b/arch/sparc/mm/srmmu.c > @@ -304,7 +304,7 @@ static void __init srmmu_nocache_init(void) > pgd = pgd_offset_k(vaddr); > p4d = p4d_offset(__nocache_fix(pgd), vaddr); > pud = pud_offset(__nocache_fix(p4d), vaddr); > - pmd = pmd_offset(__nocache_fix(pgd), vaddr); > + pmd = pmd_offset(__nocache_fix(pud), vaddr); > pte = pte_offset_kernel(__nocache_fix(pmd), vaddr); > > pteval = ((paddr >> 4) | SRMMU_ET_PTE | SRMMU_PRIV); I added Fixes: 7235db268a2777bc38 ("sparc32: use pgtable-nopud instead of 4level-fixup") and, after a bit of thought, Cc: Because that's a fairly scary-looking warning.