Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp401507img; Wed, 20 Mar 2019 03:07:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqxbcAUw9/0zLmsC7sBMnsnlAtNXVp2/uLFjF1AR/sfDaUcqh4s4Rc+zAfmXQrA4LiIxY8Sk X-Received: by 2002:a17:902:9a0b:: with SMTP id v11mr7076296plp.194.1553076460521; Wed, 20 Mar 2019 03:07:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553076460; cv=none; d=google.com; s=arc-20160816; b=S9lj9a/vkCrs6nnTuTJheHVFFUXrFdD/n1krcQlmGaHYUjVOYu5XU4+K4kt690LWX4 Q7mRKMR3cC2fTkSX7m9QfiSyqUnzDHS909tVA+9uzIrAl/CJqdF/8Wc1z0shDHhbulI2 /Gxw8BmW2mSMRhcHAmvrQw+z2K/lqII7SIgO1QMgAW9puniEWO/yluVxbMiUT9+ArtNE NgewaHrAkVdPKAx4+BHsmZuiSc/5Ix9EVfZxwIgYmydyTVhtQAO8hyxQhiXiNT6jhOlD SGyPLwZUA7XvripZtFRQv4DH4mpsdGzdhH6WdfVfy45cKgMiHbTL8N6qb5K1ZuSm3feY HVHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:date:cc:to:subject:from:references :in-reply-to:message-id:dkim-signature; bh=gH27Q+wsMPSBaRBEw7DzthC9Zw2X1H7Bu5deFN9OacU=; b=pQcEBSAb5msp6MpheAMz+q3MIIQjYEYLpy6F3XVAE0eXLDByZTwG3TX0Ki76R9MN50 o8ewZnPIhW/+dlsJhZY/eVkIm87SG3oetx6biIUsLWnrRZul2T7qZWvY/JqgADQxumNH oGyaUUPJ3RqdOXTkA056HOmIHuezotG8+LZe2GmSPVig1h6+8RvsE3qFoDUmhx/5ffLP ouPswwBOXBfGwgUD07Y7RUmzkTzQathLyAW3eJ9SCeVfHWln7vVya6kJVKu4aATS3jj0 eq/XNP25hCPJL5sL7tp34dkbuj6DChKnZqvINnlbgh3WduPZPlrU9jMh++alEcEU5Jdw MdfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@c-s.fr header.s=mail header.b=UXQAx9tl; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f89si1609496plb.20.2019.03.20.03.07.25; Wed, 20 Mar 2019 03:07:40 -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; dkim=pass header.i=@c-s.fr header.s=mail header.b=UXQAx9tl; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727627AbfCTKGl (ORCPT + 99 others); Wed, 20 Mar 2019 06:06:41 -0400 Received: from pegase1.c-s.fr ([93.17.236.30]:44331 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726020AbfCTKGj (ORCPT ); Wed, 20 Mar 2019 06:06:39 -0400 Received: from localhost (mailhub1-int [192.168.12.234]) by localhost (Postfix) with ESMTP id 44PQYm4ywgz9vC02; Wed, 20 Mar 2019 11:06:36 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=UXQAx9tl; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id PBIsXpi5yepw; Wed, 20 Mar 2019 11:06:36 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 44PQYm3k2Rz9vC01; Wed, 20 Mar 2019 11:06:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1553076396; bh=gH27Q+wsMPSBaRBEw7DzthC9Zw2X1H7Bu5deFN9OacU=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=UXQAx9tl7EM9OIGIDgu/eIn5tMey1OCmB5J0sC4bAcSzbJxRKJMNZzGMqHqxHtb+m JEk5A/lP5JKj8pKMA1PwZlc2AxX1gWgGe0gGlyNJKW7QsGSjTzMNjhwPEOgfvMH534 PasXKf3SgaSsLaZUjdRwDR/qQV2ndiZwa9VSJykI= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 9FDC38B91B; Wed, 20 Mar 2019 11:06:37 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id r7mFnrvyGixu; Wed, 20 Mar 2019 11:06:37 +0100 (CET) Received: from po16846vm.idsi0.si.c-s.fr (unknown [172.25.231.2]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 8570D8B919; Wed, 20 Mar 2019 11:06:37 +0100 (CET) Received: by po16846vm.idsi0.si.c-s.fr (Postfix, from userid 0) id 7AF1163AEF; Wed, 20 Mar 2019 10:06:37 +0000 (UTC) Message-Id: <02e312b13129a9bf96f0cd4a30b1802be0644900.1553076180.git.christophe.leroy@c-s.fr> In-Reply-To: References: From: Christophe Leroy Subject: [PATCH v1 02/27] powerpc/mm: don't BUG in add_huge_page_size() To: Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , aneesh.kumar@linux.ibm.com Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Date: Wed, 20 Mar 2019 10:06:37 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org No reason to BUG() in add_huge_page_size(). Just WARN and reject the add. Signed-off-by: Christophe Leroy --- arch/powerpc/mm/hugetlbpage.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c index 9e732bb2c84a..cf2978e235f3 100644 --- a/arch/powerpc/mm/hugetlbpage.c +++ b/arch/powerpc/mm/hugetlbpage.c @@ -634,7 +634,8 @@ static int __init add_huge_page_size(unsigned long long size) } #endif - BUG_ON(mmu_psize_defs[mmu_psize].shift != shift); + if (WARN_ON(mmu_psize_defs[mmu_psize].shift != shift)) + return -EINVAL; /* Return if huge page size has already been setup */ if (size_to_hstate(size)) -- 2.13.3