Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp335779rdb; Thu, 25 Jan 2024 17:51:50 -0800 (PST) X-Google-Smtp-Source: AGHT+IGf4vAroqidyQNPvzaMLnM/kuVKh2AupLR7TTeS4hN4CD31Br7hpTm6CKHrkO5heSmtNL46 X-Received: by 2002:a05:6a20:2d08:b0:19a:1cff:f574 with SMTP id g8-20020a056a202d0800b0019a1cfff574mr685216pzl.36.1706233909909; Thu, 25 Jan 2024 17:51:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706233909; cv=pass; d=google.com; s=arc-20160816; b=C421PzyEQ8s3dpdsF6e4NPqBxQ7f0M1TPHnh9bXzokOQLPIL2Mowmir+57EEO+GLPT ju5noHyNIl9SilHVG8ZvZlZ3CJksAJ6/Yt+qZwllXBZL0iHHPxgXhMPspaywEWX4h/3C 0dEGdQn8SqrNJJrbZQnlbZuBGOjNybxSFrvNsm9Prgd6wvqtLCNVPK6+uM6ZmX0Xjqw0 tM5I4FkzERYp/qH8FDWPlNFlemrIz0C/YeG7xUqDpQub7B6ktFJsiEvSs3oFFlVd8fPR EmRjhKwrO4a+gXMWx/NugcNYAwdojE5JS0CFcoYJ5hM6kP6zLD3XlyvWPdCUT+k9k4jS +J6Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=TwBTDhScx7lx/kZrlqaxppuzvZcoS6cXa4LZBL9FqZ0=; fh=TAov2zjsUvm00JOLzPHEHqvyWWDe6I5kU4mKnjBi1hc=; b=A0Eq2hbdUzMFge1jPV/W06sb5hPLmLzMfZNcFW3tfkQ3toVrQfIn33maYWkvc/5NxR n2ara4fBjD5bARqaGfYLjq4+H46oSLOpRf/Iejtp4fGm2YyMqIsfdEJ+T0/NbnHZO/UI 70PleuaSLiBqo9NFs1QfPc66Sh0GwheQVZpF2h9erwgzqdlCCrkjay4lrhSVrd6YtVRj ZVUa7IMjJ9tuzQ5ssSJSiyrBt3ERXNHA15ZWycSAkag+JYI2vpOBXtRmUngF2meNf3nl DtB//4i/j4wW3Tp4T04nN1FGvZhZaS9LpojNMNcTUSqka2KrIHP/hyvaQAkV8ZkCZ/vl heqQ== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-39518-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39518-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id q16-20020a170902789000b001d3fbe6900dsi220016pll.622.2024.01.25.17.51.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 17:51:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39518-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=kylinos.cn); spf=pass (google.com: domain of linux-kernel+bounces-39518-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39518-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 8BA6628F265 for ; Fri, 26 Jan 2024 01:51:49 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AB0BD1C11; Fri, 26 Jan 2024 01:51:42 +0000 (UTC) Received: from mailgw.kylinos.cn (mailgw.kylinos.cn [124.126.103.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B679D79C1 for ; Fri, 26 Jan 2024 01:51:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=124.126.103.232 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706233902; cv=none; b=O4EIf1WQL4tTp/krdqr8tIH+7lconMd/WDUl+KliOqZiggpjm3z3UQFilKP4lY5M+XnAWKLoJYHcgSyF5jVzUOvI0A/gUy4AXpztqhX9Y6oxYY6zxhDXfkhkQO+R2Z1WxrJZGkWt0INYV304VGkvXEthkh5lXivSb2mCsAL0UZA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706233902; c=relaxed/simple; bh=Y4osc/ruCnhjCW5uJHM9uYUe2NSVUbIsuaySsQwMffU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=oc/gUqiZ+BsTy0bCgrAGqazAAfihDN//hOD/DbQYssW1cOThKCbiOQh+JVfJuHNFxaNo9hllYV9D9vEPjESF9pKc6iaKGdusQex83eQs3CP2hw5tmpI7KX9zRW3MPLXkYSHaLc1EwK6RGzRHx60HHo26F/yYuO1w7cUxF/vz5Zg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=kylinos.cn; arc=none smtp.client-ip=124.126.103.232 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kylinos.cn X-UUID: 6a7b8463e0a645f28ededf1d58389596-20240126 X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.35,REQID:59037ac4-36cb-470d-b716-35c6b8b38542,IP:10, URL:0,TC:0,Content:0,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:-5 X-CID-INFO: VERSION:1.1.35,REQID:59037ac4-36cb-470d-b716-35c6b8b38542,IP:10,UR L:0,TC:0,Content:0,EDM:0,RT:0,SF:-15,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:5d391d7,CLOUDID:96a14483-8d4f-477b-89d2-1e3bdbef96d1,B ulkID:240125214804HZSUUVB8,BulkQuantity:5,Recheck:0,SF:38|24|17|19|44|64|6 6|102,TC:nil,Content:0,EDM:-3,IP:-2,URL:0,File:nil,Bulk:40,QS:nil,BEC:nil, COL:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0,NGT X-CID-BAS: 0,NGT,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_FAS,TF_CID_SPAM_FSD,TF_CID_SPAM_FSI X-UUID: 6a7b8463e0a645f28ededf1d58389596-20240126 Received: from mail.kylinos.cn [(39.156.73.10)] by mailgw (envelope-from ) (Generic MTA) with ESMTP id 446807232; Fri, 26 Jan 2024 09:51:23 +0800 Received: from mail.kylinos.cn (localhost [127.0.0.1]) by mail.kylinos.cn (NSMail) with SMTP id 3F65EE000EB9; Fri, 26 Jan 2024 09:51:23 +0800 (CST) X-ns-mid: postfix-65B3101B-180436399 Received: from [172.20.15.234] (unknown [172.20.15.234]) by mail.kylinos.cn (NSMail) with ESMTPA id E878EE000EB9; Fri, 26 Jan 2024 09:51:15 +0800 (CST) Message-ID: Date: Fri, 26 Jan 2024 09:51:15 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] powerpc/mm/hash: Code cleanup To: "Aneesh Kumar K.V" , mpe@ellerman.id.au, npiggin@gmail.com, christophe.leroy@csgroup.eu, naveen.n.rao@linux.ibm.com Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <20240125094636.539372-1-chentao@kylinos.cn> Content-Language: en-US From: Kunwu Chan In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2024/1/25 21:47, Aneesh Kumar K.V wrote: > On 1/25/24 3:16 PM, Kunwu Chan wrote: >> This part was commented in about 17 years before. >> If there are no plans to enable this part code in the future, >> we can remove this dead code. >> >> Signed-off-by: Kunwu Chan >> --- >> arch/powerpc/include/asm/book3s/64/mmu-hash.h | 22 ------------------- >> 1 file changed, 22 deletions(-) >> >> diff --git a/arch/powerpc/include/asm/book3s/64/mmu-hash.h b/arch/powerpc/include/asm/book3s/64/mmu-hash.h >> index 1c4eebbc69c9..d39ec7134a78 100644 >> --- a/arch/powerpc/include/asm/book3s/64/mmu-hash.h >> +++ b/arch/powerpc/include/asm/book3s/64/mmu-hash.h >> @@ -731,26 +731,6 @@ struct hash_mm_context { >> #endif /* CONFIG_PPC_SUBPAGE_PROT */ >> }; >> >> -#if 0 >> -/* >> - * The code below is equivalent to this function for arguments >> - * < 2^VSID_BITS, which is all this should ever be called >> - * with. However gcc is not clever enough to compute the >> - * modulus (2^n-1) without a second multiply. >> - */ >> -#define vsid_scramble(protovsid, size) \ >> - ((((protovsid) * VSID_MULTIPLIER_##size) % VSID_MODULUS_##size)) >> - >> -/* simplified form avoiding mod operation */ >> -#define vsid_scramble(protovsid, size) \ >> - ({ \ >> - unsigned long x; \ >> - x = (protovsid) * VSID_MULTIPLIER_##size; \ >> - x = (x >> VSID_BITS_##size) + (x & VSID_MODULUS_##size); \ >> - (x + ((x+1) >> VSID_BITS_##size)) & VSID_MODULUS_##size; \ >> - }) >> - >> -#else /* 1 */ >> static inline unsigned long vsid_scramble(unsigned long protovsid, >> unsigned long vsid_multiplier, int vsid_bits) >> { >> @@ -764,8 +744,6 @@ static inline unsigned long vsid_scramble(unsigned long protovsid, >> return (vsid + ((vsid + 1) >> vsid_bits)) & vsid_modulus; >> } >> >> -#endif /* 1 */ >> - >> /* Returns the segment size indicator for a user address */ >> static inline int user_segment_size(unsigned long addr) >> { > > That was done to make sure one can follow the actual compiled code better. Thanks for your explanation. It's my bad. > > -aneesh > -- Thanks, Kunwu