Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1728642ybi; Fri, 12 Jul 2019 23:04:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqxF6TCoTRipv9hhpMmBIT+TCK4++qFGZa14WzHgP1jQFFhHdAnhy0Ll8djT6PwR22IgNftX X-Received: by 2002:a63:553:: with SMTP id 80mr15747394pgf.280.1562997856441; Fri, 12 Jul 2019 23:04:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562997856; cv=none; d=google.com; s=arc-20160816; b=0Yc5dK4wOtNYnIVSNbpwAT/AbM4s/8HTjQo5/koTThUdNYfVQIJj0Y1Xn1S3fgNwuK 9vHTQpM7KICLAuSqQ2sdWO19ohsS3AtZQJWy6yD0GBbL2KJCVwDHt1c3vUBjTBu6tlHV NFi2xnUsaotL+DECNZtR4gbxC1JwmlGhH7HJdYnh7oFRCjhpRYmOX2veYPFBOi9mr4iE yZnSV933NxT8KD1oVveb1Os9ilDVO4wxVKi9wDqvOAjxut1Rz1d0aetFasGz0equFS/R OrMSQhwYyHJS1TTcqSehq5vQccuxyzplU4Frbw04Tqju+Futyi5mAIKPjhF04xxRYxaS 1FEA== 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:date:subject:cc:to:from; bh=1Xf3vL5DZYe0PVKgR3bazF9U5+hJ651Wo48z4yojY6o=; b=yvSou1kSOskgcBDuDYCuBULMY/wigZED7SoN3PJNBBGn6OT2Z8A81PGDhytyPhYpQV TLyRQRmK3yZUxoEIEkNEyuCY3LdMgt0a6qruBXmv+NN4gojS7N4v4bsWx5Xkq5wOhPya +hvs5w+Ibgu2DMS4ndz5kVS9Xix+mrfbjv5+61/he6fCqcPBhPf+tnjN0WmzWGkLvDzd W2QsMOouxKBIl8lWOdT+MYQ0qgQa/kRmQJOo1rD4cNI3hPcTictXBb9m0eqjYCzLpiAf olS1qAYMRhy8VcL9dspaPkCXGaHdYcQbKjvIq3Q8Xs8vuUnUcPW8LHKZF3bb0koq3RfH /HLg== 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b35si4620443plb.249.2019.07.12.23.04.01; Fri, 12 Jul 2019 23:04:16 -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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726412AbfGMGDT (ORCPT + 99 others); Sat, 13 Jul 2019 02:03:19 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:53924 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726009AbfGMGDS (ORCPT ); Sat, 13 Jul 2019 02:03:18 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x6D5uOAI087324; Sat, 13 Jul 2019 02:00:59 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 2tq3k2rp46-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 13 Jul 2019 02:00:59 -0400 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id x6D5uuIM088168; Sat, 13 Jul 2019 02:00:58 -0400 Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0a-001b2d01.pphosted.com with ESMTP id 2tq3k2rp3n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 13 Jul 2019 02:00:58 -0400 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id x6D608Da001000; Sat, 13 Jul 2019 06:00:57 GMT Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by ppma04dal.us.ibm.com with ESMTP id 2tq6x68t13-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 13 Jul 2019 06:00:57 +0000 Received: from b03ledav006.gho.boulder.ibm.com (b03ledav006.gho.boulder.ibm.com [9.17.130.237]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x6D60uY761342074 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sat, 13 Jul 2019 06:00:56 GMT Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E0AEDC605A; Sat, 13 Jul 2019 06:00:55 +0000 (GMT) Received: from b03ledav006.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D5AB7C6061; Sat, 13 Jul 2019 06:00:52 +0000 (GMT) Received: from morokweng.localdomain.com (unknown [9.85.135.203]) by b03ledav006.gho.boulder.ibm.com (Postfix) with ESMTP; Sat, 13 Jul 2019 06:00:52 +0000 (GMT) From: Thiago Jung Bauermann To: linuxppc-dev@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, Alexey Kardashevskiy , Anshuman Khandual , Benjamin Herrenschmidt , Christoph Hellwig , Michael Ellerman , Mike Anderson , Paul Mackerras , Ram Pai , Claudio Carvalho , Thiago Jung Bauermann , Alexey Kardashevskiy Subject: [PATCH v2 05/13] powerpc/pseries: Add and use LPPACA_SIZE constant Date: Sat, 13 Jul 2019 03:00:15 -0300 Message-Id: <20190713060023.8479-6-bauerman@linux.ibm.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190713060023.8479-1-bauerman@linux.ibm.com> References: <20190713060023.8479-1-bauerman@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-07-13_01:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1907130070 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Helps document what the hard-coded number means. Also take the opportunity to fix an #endif comment. Suggested-by: Alexey Kardashevskiy Signed-off-by: Thiago Jung Bauermann --- arch/powerpc/kernel/paca.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c index 9cc91d03ab62..854105db5cff 100644 --- a/arch/powerpc/kernel/paca.c +++ b/arch/powerpc/kernel/paca.c @@ -56,6 +56,8 @@ static void *__init alloc_paca_data(unsigned long size, unsigned long align, #ifdef CONFIG_PPC_PSERIES +#define LPPACA_SIZE 0x400 + /* * See asm/lppaca.h for more detail. * @@ -69,7 +71,7 @@ static inline void init_lppaca(struct lppaca *lppaca) *lppaca = (struct lppaca) { .desc = cpu_to_be32(0xd397d781), /* "LpPa" */ - .size = cpu_to_be16(0x400), + .size = cpu_to_be16(LPPACA_SIZE), .fpregs_in_use = 1, .slb_count = cpu_to_be16(64), .vmxregs_in_use = 0, @@ -79,19 +81,18 @@ static inline void init_lppaca(struct lppaca *lppaca) static struct lppaca * __init new_lppaca(int cpu, unsigned long limit) { struct lppaca *lp; - size_t size = 0x400; - BUILD_BUG_ON(size < sizeof(struct lppaca)); + BUILD_BUG_ON(sizeof(struct lppaca) > LPPACA_SIZE); if (early_cpu_has_feature(CPU_FTR_HVMODE)) return NULL; - lp = alloc_paca_data(size, 0x400, limit, cpu); + lp = alloc_paca_data(LPPACA_SIZE, 0x400, limit, cpu); init_lppaca(lp); return lp; } -#endif /* CONFIG_PPC_BOOK3S */ +#endif /* CONFIG_PPC_PSERIES */ #ifdef CONFIG_PPC_BOOK3S_64