Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp512336img; Thu, 21 Mar 2019 03:08:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxcWxnuaZHabaA3Hk0e9uLl4LcUNFurYt/2rAfZtjybx+3ZxzIbPWDLNrkHGto07cXv8GP2 X-Received: by 2002:a62:b517:: with SMTP id y23mr2469143pfe.144.1553162911267; Thu, 21 Mar 2019 03:08:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553162911; cv=none; d=google.com; s=arc-20160816; b=q4qlWLtaxxtVByMOgKMEyk3kvpGqpbzl/c5MFl5LZV0ZUzDtcyGv01YRaPok67IBVa X5ZS1sKQAXVqjdx/HkA5LjzemZCTxPnW7ayJm3mBq55ILfX3TS28fMIXQu7t/8dm+Thx K+K7SQU0lN3FV+kZpmClxqIHoz4acZ/XXL7EyGEN+wDXQVoF+heE/Y5QGF4eWJIg+WAZ KewLiPTRxBhavFSEdSEW2JlGGExg2DucyL/FwRNLvrBP+0NcEt+UDxf6adArCVD9alHi WspjGWHVaEpwqXpz5FUpcAxXeWH7UQLC5GBVYEwVw2CfA63r8E169WBlAwxr0b+4vBp0 Xn4w== 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 :message-id:date:references:in-reply-to:subject:cc:to:from; bh=lU1Qzrzcp89hgdnOaBAEE13vqRGxtZGoBwCx9EhMmYg=; b=SvZJWeheEOWSxvNHUa9d+7n/oSISjwEipsLVlwxng1XVqfq9PUePp41FZRuvSQVLGA LyJUo4tiY1alXdVbtC4B4BUb1ILEASmWfJ8SYdOT3cY3we2wT2/RWePx0klwQh+eBbMT uLsHOoV0gycHytMWCjPsDE6AruunAqMwZw4gwP9tJgslPYQnnKNGIEYKrTxk2PIyzUH/ 50sfnEWVZNgILECtmHMofkDmhngBF1hOUm79spEF2eMs5HOPCdTyf7M/iQv5l3EsXDKh yoX/g51bF0b0zFbRlPGs8HZH3zjLDdRxWQ28Q7aksUb5lIjoqHHj1lI4Ti7FWm0xbYLb wLTQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m6si3800116pgq.24.2019.03.21.03.08.15; Thu, 21 Mar 2019 03:08:31 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728307AbfCUKHj convert rfc822-to-8bit (ORCPT + 99 others); Thu, 21 Mar 2019 06:07:39 -0400 Received: from ozlabs.org ([203.11.71.1]:46007 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728253AbfCUKHj (ORCPT ); Thu, 21 Mar 2019 06:07:39 -0400 Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 44Q2XS58nRz9sQv; Thu, 21 Mar 2019 21:07:36 +1100 (AEDT) From: Michael Ellerman To: Christophe Leroy , Benjamin Herrenschmidt , Paul Mackerras Cc: linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH] powerpc/highmem: change BUG_ON() to WARN_ON() In-Reply-To: <9048ba12-a014-3ebe-c414-26f87401c758@c-s.fr> References: <0365f99ce2b9273e269a241394957cba924f995e.1551951985.git.christophe.leroy@c-s.fr> <87va0c23s8.fsf@concordia.ellerman.id.au> <9048ba12-a014-3ebe-c414-26f87401c758@c-s.fr> Date: Thu, 21 Mar 2019 21:07:35 +1100 Message-ID: <87sgvg1qxk.fsf@concordia.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Christophe Leroy writes: > Le 21/03/2019 à 06:29, Michael Ellerman a écrit : >> Christophe Leroy writes: >>> In arch/powerpc/mm/highmem.c, BUG_ON() is called only when >>> CONFIG_DEBUG_HIGHMEM is selected, this means the BUG_ON() is >>> not vital and can be replaced by a a WARN_ON >>> >>> At the sametime, use IS_ENABLED() instead of #ifdef to clean a bit. >>> >>> Signed-off-by: Christophe Leroy >>> --- >>> arch/powerpc/mm/highmem.c | 12 ++++-------- >>> 1 file changed, 4 insertions(+), 8 deletions(-) >>> >>> diff --git a/arch/powerpc/mm/highmem.c b/arch/powerpc/mm/highmem.c >>> index 82a0e37557a5..b68c9f20fbdf 100644 >>> --- a/arch/powerpc/mm/highmem.c >>> +++ b/arch/powerpc/mm/highmem.c >>> @@ -56,7 +54,7 @@ EXPORT_SYMBOL(kmap_atomic_prot); >>> void __kunmap_atomic(void *kvaddr) >>> { >>> unsigned long vaddr = (unsigned long) kvaddr & PAGE_MASK; >>> - int type __maybe_unused; >>> + int type; >> >> Why don't we move type into the block below. > > Yes you're right, when Mathieu introduced the __maybe_unused, I was > wrongly thinging that kmap_atomic_idx() was doing something important > that had to be done also when DEBUG was not selected, but indeed it does > nothing else than returning the type. > > I'll send a new patch. I can just fix it up when applying. cheers