From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B107FC433DF for ; Wed, 19 Aug 2020 20:49:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 851CE2083B for ; Wed, 19 Aug 2020 20:49:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597870145; bh=qGoMJNQU47bi4Lr27Xvnh0/Sq60m3eAX4xqpvHpl7z0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=Cqi5Vk14mES/dzL8GQjopb9EZ15VAN/HkXghc/zbiSAm90oVJ2YFWwkg/OfrleGbO x6yoMDk59lMWS+oB+vXsVbRh0nuLf8rvrHqjMQ0VjOZkz4AKqhibMTPzAOUohEEFvs pytyof70t5WCs8EKL2IDeVbM+6puKxAp+nvbZ5I0= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727070AbgHSUtE (ORCPT ); Wed, 19 Aug 2020 16:49:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:49906 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727050AbgHSUtE (ORCPT ); Wed, 19 Aug 2020 16:49:04 -0400 Received: from kernel.org (unknown [87.70.91.42]) (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 4559022B43; Wed, 19 Aug 2020 20:48:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597870143; bh=qGoMJNQU47bi4Lr27Xvnh0/Sq60m3eAX4xqpvHpl7z0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EDED5GsJw4zUuBdGb05pEvujvo8C6rUQNmDr6tFajHgKyq8u0aC1JhmrGGKixlNzr iJK0JwajiHl4HBTkAxVXhkjy+fJ4SSitgCYA/knE1HAPx9DykSi5zvv7ufmh3aqaBj /RQUWYvoEHKL6x5oDDNaW/gHGb6Yyk2UI/DMzVR8= Date: Wed, 19 Aug 2020 23:48:48 +0300 From: Mike Rapoport To: Andrew Morton Cc: Andy Lutomirski , Baoquan He , Benjamin Herrenschmidt , Borislav Petkov , Catalin Marinas , Christoph Hellwig , Daniel Axtens , Dave Hansen , Emil Renner Berthing , Ingo Molnar , Hari Bathini , Marek Szyprowski , Max Filippov , Michael Ellerman , Michal Simek , Mike Rapoport , Palmer Dabbelt , Paul Mackerras , Paul Walmsley , Peter Zijlstra , Russell King , Stafford Horne , Thomas Gleixner , Will Deacon , Yoshinori Sato , clang-built-linux@googlegroups.com, iommu@lists.linux-foundation.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-xtensa@linux-xtensa.org, linuxppc-dev@lists.ozlabs.org, openrisc@lists.librecores.org, sparclinux@vger.kernel.org, uclinux-h8-devel@lists.sourceforge.jp, x86@kernel.org Subject: Re: [PATCH v3 09/17] memblock: make memblock_debug and related functionality private Message-ID: <20200819204848.GX752365@kernel.org> References: <20200818151634.14343-1-rppt@kernel.org> <20200818151634.14343-10-rppt@kernel.org> <20200819122405.88e9719e86ac7c3c44b4db32@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200819122405.88e9719e86ac7c3c44b4db32@linux-foundation.org> Sender: linux-arch-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org On Wed, Aug 19, 2020 at 12:24:05PM -0700, Andrew Morton wrote: > On Tue, 18 Aug 2020 18:16:26 +0300 Mike Rapoport wrote: > > > From: Mike Rapoport > > > > The only user of memblock_dbg() outside memblock was s390 setup code and it > > is converted to use pr_debug() instead. > > This allows to stop exposing memblock_debug and memblock_dbg() to the rest > > of the kernel. > > > > --- a/mm/memblock.c > > +++ b/mm/memblock.c > > @@ -137,7 +137,10 @@ struct memblock_type physmem = { > > i < memblock_type->cnt; \ > > i++, rgn = &memblock_type->regions[i]) > > > > -int memblock_debug __initdata_memblock; > > +#define memblock_dbg(fmt, ...) \ > > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > + > > checkpatch doesn't like this much. > > ERROR: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects > #101: FILE: mm/memblock.c:140: > +#define memblock_dbg(fmt, ...) \ > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ... > #102: FILE: mm/memblock.c:141: > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > ERROR: trailing statements should be on next line > #102: FILE: mm/memblock.c:141: > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > > The first one is significant: > > if (foo) > memblock_dbg(...); > else > save_the_world(); > > could end up inadvertently destroying the planet. Well, it didn't till now ;-) > This? > > --- a/mm/memblock.c~memblock-make-memblock_debug-and-related-functionality-private-fix > +++ a/mm/memblock.c > @@ -137,8 +137,11 @@ struct memblock_type physmem = { > i < memblock_type->cnt; \ > i++, rgn = &memblock_type->regions[i]) > > -#define memblock_dbg(fmt, ...) \ > - if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > +#define memblock_dbg(fmt, ...) \ > + do { \ > + if (memblock_debug) \ > + pr_info(fmt, ##__VA_ARGS__); \ > + } while (0) Sure, thanks! > static int memblock_debug __initdata_memblock; > static bool system_has_some_mirror __initdata_memblock = false; > _ > -- Sincerely yours, Mike. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0113DC433E4 for ; Wed, 19 Aug 2020 20:49:07 +0000 (UTC) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C063222CBB for ; Wed, 19 Aug 2020 20:49:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="EDED5GsJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C063222CBB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 97CAD88075; Wed, 19 Aug 2020 20:49:07 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KKFCqqkRNTcB; Wed, 19 Aug 2020 20:49:06 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by hemlock.osuosl.org (Postfix) with ESMTP id 85DB887FD8; Wed, 19 Aug 2020 20:49:06 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 663BEC07FF; Wed, 19 Aug 2020 20:49:06 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id A29C9C0051 for ; Wed, 19 Aug 2020 20:49:05 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8BCF48619E for ; Wed, 19 Aug 2020 20:49:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id XUsBHUKAs48F for ; Wed, 19 Aug 2020 20:49:05 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 14EE686141 for ; Wed, 19 Aug 2020 20:49:05 +0000 (UTC) Received: from kernel.org (unknown [87.70.91.42]) (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 4559022B43; Wed, 19 Aug 2020 20:48:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597870143; bh=qGoMJNQU47bi4Lr27Xvnh0/Sq60m3eAX4xqpvHpl7z0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EDED5GsJw4zUuBdGb05pEvujvo8C6rUQNmDr6tFajHgKyq8u0aC1JhmrGGKixlNzr iJK0JwajiHl4HBTkAxVXhkjy+fJ4SSitgCYA/knE1HAPx9DykSi5zvv7ufmh3aqaBj /RQUWYvoEHKL6x5oDDNaW/gHGb6Yyk2UI/DMzVR8= Date: Wed, 19 Aug 2020 23:48:48 +0300 From: Mike Rapoport To: Andrew Morton Subject: Re: [PATCH v3 09/17] memblock: make memblock_debug and related functionality private Message-ID: <20200819204848.GX752365@kernel.org> References: <20200818151634.14343-1-rppt@kernel.org> <20200818151634.14343-10-rppt@kernel.org> <20200819122405.88e9719e86ac7c3c44b4db32@linux-foundation.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200819122405.88e9719e86ac7c3c44b4db32@linux-foundation.org> Cc: Thomas Gleixner , Emil Renner Berthing , linux-sh@vger.kernel.org, Peter Zijlstra , Benjamin Herrenschmidt , Dave Hansen , linux-mips@vger.kernel.org, Max Filippov , Paul Mackerras , sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org, Will Deacon , Christoph Hellwig , linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, linux-c6x-dev@linux-c6x.org, Michael Ellerman , x86@kernel.org, Russell King , Mike Rapoport , clang-built-linux@googlegroups.com, Ingo Molnar , linux-arm-kernel@lists.infradead.org, Catalin Marinas , uclinux-h8-devel@lists.sourceforge.jp, linux-xtensa@linux-xtensa.org, openrisc@lists.librecores.org, Borislav Petkov , Andy Lutomirski , Paul Walmsley , Stafford Horne , Hari Bathini , Daniel Axtens , Michal Simek , Yoshinori Sato , linux-mm@kvack.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Palmer Dabbelt , linuxppc-dev@lists.ozlabs.org X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Wed, Aug 19, 2020 at 12:24:05PM -0700, Andrew Morton wrote: > On Tue, 18 Aug 2020 18:16:26 +0300 Mike Rapoport wrote: > > > From: Mike Rapoport > > > > The only user of memblock_dbg() outside memblock was s390 setup code and it > > is converted to use pr_debug() instead. > > This allows to stop exposing memblock_debug and memblock_dbg() to the rest > > of the kernel. > > > > --- a/mm/memblock.c > > +++ b/mm/memblock.c > > @@ -137,7 +137,10 @@ struct memblock_type physmem = { > > i < memblock_type->cnt; \ > > i++, rgn = &memblock_type->regions[i]) > > > > -int memblock_debug __initdata_memblock; > > +#define memblock_dbg(fmt, ...) \ > > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > + > > checkpatch doesn't like this much. > > ERROR: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects > #101: FILE: mm/memblock.c:140: > +#define memblock_dbg(fmt, ...) \ > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ... > #102: FILE: mm/memblock.c:141: > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > ERROR: trailing statements should be on next line > #102: FILE: mm/memblock.c:141: > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > > The first one is significant: > > if (foo) > memblock_dbg(...); > else > save_the_world(); > > could end up inadvertently destroying the planet. Well, it didn't till now ;-) > This? > > --- a/mm/memblock.c~memblock-make-memblock_debug-and-related-functionality-private-fix > +++ a/mm/memblock.c > @@ -137,8 +137,11 @@ struct memblock_type physmem = { > i < memblock_type->cnt; \ > i++, rgn = &memblock_type->regions[i]) > > -#define memblock_dbg(fmt, ...) \ > - if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > +#define memblock_dbg(fmt, ...) \ > + do { \ > + if (memblock_debug) \ > + pr_info(fmt, ##__VA_ARGS__); \ > + } while (0) Sure, thanks! > static int memblock_debug __initdata_memblock; > static bool system_has_some_mirror __initdata_memblock = false; > _ > -- Sincerely yours, Mike. _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8DC3EC433DF for ; Wed, 19 Aug 2020 20:49:29 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 48AD32083B for ; Wed, 19 Aug 2020 20:49:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="b3dL4Fg+"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="EDED5GsJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 48AD32083B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=HX+uKaTJ6RYv57MSH0C9fJhluEqpFvgbQkUeHOHY5is=; b=b3dL4Fg++JoykSp3DAWJnmi1k DUdmjL/2yf9JtGFI6C3GigeyiPVI7Ld25gSGMfUPTY1xOaoeKES0oQl9n+W4nXnok3+crG/4THT4T b3b6DQx3kKIHrViJxQo0QZovvSdb94x0BjZYO6qz6+rulNNaHvbetaB3UswX1DKb8Dsah9m8yx1d1 Anu5Dz2xbckUiaBI7aePA42jEInuJW4ftipZi4mevRKJzS65FrqPFri91rLwJCWELZdFFjVfLXmek lm9Jc7+A1BUxBNQ+WJjkY72JLdDyhQS9GPTClvWKq+GGLJ+n+J6cUE7uQ1rmVCvgQSHsP0XBHE02w 2+/3nrTcw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k8V1E-00029i-0t; Wed, 19 Aug 2020 20:49:12 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k8V15-00025U-VF; Wed, 19 Aug 2020 20:49:04 +0000 Received: from kernel.org (unknown [87.70.91.42]) (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 4559022B43; Wed, 19 Aug 2020 20:48:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597870143; bh=qGoMJNQU47bi4Lr27Xvnh0/Sq60m3eAX4xqpvHpl7z0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EDED5GsJw4zUuBdGb05pEvujvo8C6rUQNmDr6tFajHgKyq8u0aC1JhmrGGKixlNzr iJK0JwajiHl4HBTkAxVXhkjy+fJ4SSitgCYA/knE1HAPx9DykSi5zvv7ufmh3aqaBj /RQUWYvoEHKL6x5oDDNaW/gHGb6Yyk2UI/DMzVR8= Date: Wed, 19 Aug 2020 23:48:48 +0300 From: Mike Rapoport To: Andrew Morton Subject: Re: [PATCH v3 09/17] memblock: make memblock_debug and related functionality private Message-ID: <20200819204848.GX752365@kernel.org> References: <20200818151634.14343-1-rppt@kernel.org> <20200818151634.14343-10-rppt@kernel.org> <20200819122405.88e9719e86ac7c3c44b4db32@linux-foundation.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200819122405.88e9719e86ac7c3c44b4db32@linux-foundation.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200819_164904_196373_EBA7CE3D X-CRM114-Status: GOOD ( 23.24 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Gleixner , Emil Renner Berthing , linux-sh@vger.kernel.org, Peter Zijlstra , Benjamin Herrenschmidt , Dave Hansen , linux-mips@vger.kernel.org, Max Filippov , Paul Mackerras , sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org, Will Deacon , Christoph Hellwig , Marek Szyprowski , linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, linux-c6x-dev@linux-c6x.org, Baoquan He , Michael Ellerman , x86@kernel.org, Russell King , Mike Rapoport , clang-built-linux@googlegroups.com, Ingo Molnar , linux-arm-kernel@lists.infradead.org, Catalin Marinas , uclinux-h8-devel@lists.sourceforge.jp, linux-xtensa@linux-xtensa.org, openrisc@lists.librecores.org, Borislav Petkov , Andy Lutomirski , Paul Walmsley , Stafford Horne , Hari Bathini , Daniel Axtens , Michal Simek , Yoshinori Sato , linux-mm@kvack.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Palmer Dabbelt , linuxppc-dev@lists.ozlabs.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Wed, Aug 19, 2020 at 12:24:05PM -0700, Andrew Morton wrote: > On Tue, 18 Aug 2020 18:16:26 +0300 Mike Rapoport wrote: > > > From: Mike Rapoport > > > > The only user of memblock_dbg() outside memblock was s390 setup code and it > > is converted to use pr_debug() instead. > > This allows to stop exposing memblock_debug and memblock_dbg() to the rest > > of the kernel. > > > > --- a/mm/memblock.c > > +++ b/mm/memblock.c > > @@ -137,7 +137,10 @@ struct memblock_type physmem = { > > i < memblock_type->cnt; \ > > i++, rgn = &memblock_type->regions[i]) > > > > -int memblock_debug __initdata_memblock; > > +#define memblock_dbg(fmt, ...) \ > > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > + > > checkpatch doesn't like this much. > > ERROR: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects > #101: FILE: mm/memblock.c:140: > +#define memblock_dbg(fmt, ...) \ > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ... > #102: FILE: mm/memblock.c:141: > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > ERROR: trailing statements should be on next line > #102: FILE: mm/memblock.c:141: > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > > The first one is significant: > > if (foo) > memblock_dbg(...); > else > save_the_world(); > > could end up inadvertently destroying the planet. Well, it didn't till now ;-) > This? > > --- a/mm/memblock.c~memblock-make-memblock_debug-and-related-functionality-private-fix > +++ a/mm/memblock.c > @@ -137,8 +137,11 @@ struct memblock_type physmem = { > i < memblock_type->cnt; \ > i++, rgn = &memblock_type->regions[i]) > > -#define memblock_dbg(fmt, ...) \ > - if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > +#define memblock_dbg(fmt, ...) \ > + do { \ > + if (memblock_debug) \ > + pr_info(fmt, ##__VA_ARGS__); \ > + } while (0) Sure, thanks! > static int memblock_debug __initdata_memblock; > static bool system_has_some_mirror __initdata_memblock = false; > _ > -- Sincerely yours, Mike. _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Rapoport Date: Wed, 19 Aug 2020 20:48:48 +0000 Subject: Re: [PATCH v3 09/17] memblock: make memblock_debug and related functionality private Message-Id: <20200819204848.GX752365@kernel.org> List-Id: References: <20200818151634.14343-1-rppt@kernel.org> <20200818151634.14343-10-rppt@kernel.org> <20200819122405.88e9719e86ac7c3c44b4db32@linux-foundation.org> In-Reply-To: <20200819122405.88e9719e86ac7c3c44b4db32@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Andrew Morton Cc: Andy Lutomirski , Baoquan He , Benjamin Herrenschmidt , Borislav Petkov , Catalin Marinas , Christoph Hellwig , Daniel Axtens , Dave Hansen , Emil Renner Berthing , Ingo Molnar , Hari Bathini , Marek Szyprowski , Max Filippov , Michael Ellerman , Michal Simek , Mike Rapoport , Palmer Dabbelt , Paul Mackerras , Paul Walmsley , Peter Zijlstra , Russell King , Stafford Horne , Thomas Gleixner , Will Deacon , Yoshinori Sato , clang-built-linux@googlegroups.com, iommu@lists.linux-foundation.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-c6x-dev@linux-c6x.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-xtensa@linux-xtensa.org, linuxppc-dev@lists.ozlabs.org, openrisc@lists.librecores.org, sparclinux@vger.kernel.org, uclinux-h8-devel@lists.sourceforge.jp, x86@kernel.org On Wed, Aug 19, 2020 at 12:24:05PM -0700, Andrew Morton wrote: > On Tue, 18 Aug 2020 18:16:26 +0300 Mike Rapoport wrote: > > > From: Mike Rapoport > > > > The only user of memblock_dbg() outside memblock was s390 setup code and it > > is converted to use pr_debug() instead. > > This allows to stop exposing memblock_debug and memblock_dbg() to the rest > > of the kernel. > > > > --- a/mm/memblock.c > > +++ b/mm/memblock.c > > @@ -137,7 +137,10 @@ struct memblock_type physmem = { > > i < memblock_type->cnt; \ > > i++, rgn = &memblock_type->regions[i]) > > > > -int memblock_debug __initdata_memblock; > > +#define memblock_dbg(fmt, ...) \ > > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > + > > checkpatch doesn't like this much. > > ERROR: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects > #101: FILE: mm/memblock.c:140: > +#define memblock_dbg(fmt, ...) \ > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ... > #102: FILE: mm/memblock.c:141: > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > ERROR: trailing statements should be on next line > #102: FILE: mm/memblock.c:141: > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > > The first one is significant: > > if (foo) > memblock_dbg(...); > else > save_the_world(); > > could end up inadvertently destroying the planet. Well, it didn't till now ;-) > This? > > --- a/mm/memblock.c~memblock-make-memblock_debug-and-related-functionality-private-fix > +++ a/mm/memblock.c > @@ -137,8 +137,11 @@ struct memblock_type physmem = { > i < memblock_type->cnt; \ > i++, rgn = &memblock_type->regions[i]) > > -#define memblock_dbg(fmt, ...) \ > - if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > +#define memblock_dbg(fmt, ...) \ > + do { \ > + if (memblock_debug) \ > + pr_info(fmt, ##__VA_ARGS__); \ > + } while (0) Sure, thanks! > static int memblock_debug __initdata_memblock; > static bool system_has_some_mirror __initdata_memblock = false; > _ > -- Sincerely yours, Mike. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mike Rapoport Date: Wed, 19 Aug 2020 23:48:48 +0300 Subject: [OpenRISC] [PATCH v3 09/17] memblock: make memblock_debug and related functionality private In-Reply-To: <20200819122405.88e9719e86ac7c3c44b4db32@linux-foundation.org> References: <20200818151634.14343-1-rppt@kernel.org> <20200818151634.14343-10-rppt@kernel.org> <20200819122405.88e9719e86ac7c3c44b4db32@linux-foundation.org> Message-ID: <20200819204848.GX752365@kernel.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: openrisc@lists.librecores.org On Wed, Aug 19, 2020 at 12:24:05PM -0700, Andrew Morton wrote: > On Tue, 18 Aug 2020 18:16:26 +0300 Mike Rapoport wrote: > > > From: Mike Rapoport > > > > The only user of memblock_dbg() outside memblock was s390 setup code and it > > is converted to use pr_debug() instead. > > This allows to stop exposing memblock_debug and memblock_dbg() to the rest > > of the kernel. > > > > --- a/mm/memblock.c > > +++ b/mm/memblock.c > > @@ -137,7 +137,10 @@ struct memblock_type physmem = { > > i < memblock_type->cnt; \ > > i++, rgn = &memblock_type->regions[i]) > > > > -int memblock_debug __initdata_memblock; > > +#define memblock_dbg(fmt, ...) \ > > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > + > > checkpatch doesn't like this much. > > ERROR: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects > #101: FILE: mm/memblock.c:140: > +#define memblock_dbg(fmt, ...) \ > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ... > #102: FILE: mm/memblock.c:141: > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > ERROR: trailing statements should be on next line > #102: FILE: mm/memblock.c:141: > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > > The first one is significant: > > if (foo) > memblock_dbg(...); > else > save_the_world(); > > could end up inadvertently destroying the planet. Well, it didn't till now ;-) > This? > > --- a/mm/memblock.c~memblock-make-memblock_debug-and-related-functionality-private-fix > +++ a/mm/memblock.c > @@ -137,8 +137,11 @@ struct memblock_type physmem = { > i < memblock_type->cnt; \ > i++, rgn = &memblock_type->regions[i]) > > -#define memblock_dbg(fmt, ...) \ > - if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > +#define memblock_dbg(fmt, ...) \ > + do { \ > + if (memblock_debug) \ > + pr_info(fmt, ##__VA_ARGS__); \ > + } while (0) Sure, thanks! > static int memblock_debug __initdata_memblock; > static bool system_has_some_mirror __initdata_memblock = false; > _ > -- Sincerely yours, Mike. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7AD56C433DF for ; Wed, 19 Aug 2020 20:51:41 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C49172083B for ; Wed, 19 Aug 2020 20:51:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="EDED5GsJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C49172083B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4BX0Ly3d2pzDr0L for ; Thu, 20 Aug 2020 06:51:38 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=198.145.29.99; helo=mail.kernel.org; envelope-from=rppt@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=default header.b=EDED5GsJ; dkim-atps=neutral Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4BX0J13yXtzDqgD for ; Thu, 20 Aug 2020 06:49:05 +1000 (AEST) Received: from kernel.org (unknown [87.70.91.42]) (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 4559022B43; Wed, 19 Aug 2020 20:48:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597870143; bh=qGoMJNQU47bi4Lr27Xvnh0/Sq60m3eAX4xqpvHpl7z0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EDED5GsJw4zUuBdGb05pEvujvo8C6rUQNmDr6tFajHgKyq8u0aC1JhmrGGKixlNzr iJK0JwajiHl4HBTkAxVXhkjy+fJ4SSitgCYA/knE1HAPx9DykSi5zvv7ufmh3aqaBj /RQUWYvoEHKL6x5oDDNaW/gHGb6Yyk2UI/DMzVR8= Date: Wed, 19 Aug 2020 23:48:48 +0300 From: Mike Rapoport To: Andrew Morton Subject: Re: [PATCH v3 09/17] memblock: make memblock_debug and related functionality private Message-ID: <20200819204848.GX752365@kernel.org> References: <20200818151634.14343-1-rppt@kernel.org> <20200818151634.14343-10-rppt@kernel.org> <20200819122405.88e9719e86ac7c3c44b4db32@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200819122405.88e9719e86ac7c3c44b4db32@linux-foundation.org> X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Gleixner , Emil Renner Berthing , linux-sh@vger.kernel.org, Peter Zijlstra , Dave Hansen , linux-mips@vger.kernel.org, Max Filippov , Paul Mackerras , sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org, Will Deacon , Christoph Hellwig , Marek Szyprowski , linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, linux-c6x-dev@linux-c6x.org, Baoquan He , x86@kernel.org, Russell King , Mike Rapoport , clang-built-linux@googlegroups.com, Ingo Molnar , linux-arm-kernel@lists.infradead.org, Catalin Marinas , uclinux-h8-devel@lists.sourceforge.jp, linux-xtensa@linux-xtensa.org, openrisc@lists.librecores.org, Borislav Petkov , Andy Lutomirski , Paul Walmsley , Stafford Horne , Hari Bathini , Daniel Axtens , Michal Simek , Yoshinori Sato , linux-mm@kvack.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Palmer Dabbelt , linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Wed, Aug 19, 2020 at 12:24:05PM -0700, Andrew Morton wrote: > On Tue, 18 Aug 2020 18:16:26 +0300 Mike Rapoport wrote: > > > From: Mike Rapoport > > > > The only user of memblock_dbg() outside memblock was s390 setup code and it > > is converted to use pr_debug() instead. > > This allows to stop exposing memblock_debug and memblock_dbg() to the rest > > of the kernel. > > > > --- a/mm/memblock.c > > +++ b/mm/memblock.c > > @@ -137,7 +137,10 @@ struct memblock_type physmem = { > > i < memblock_type->cnt; \ > > i++, rgn = &memblock_type->regions[i]) > > > > -int memblock_debug __initdata_memblock; > > +#define memblock_dbg(fmt, ...) \ > > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > + > > checkpatch doesn't like this much. > > ERROR: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects > #101: FILE: mm/memblock.c:140: > +#define memblock_dbg(fmt, ...) \ > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ... > #102: FILE: mm/memblock.c:141: > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > ERROR: trailing statements should be on next line > #102: FILE: mm/memblock.c:141: > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > > The first one is significant: > > if (foo) > memblock_dbg(...); > else > save_the_world(); > > could end up inadvertently destroying the planet. Well, it didn't till now ;-) > This? > > --- a/mm/memblock.c~memblock-make-memblock_debug-and-related-functionality-private-fix > +++ a/mm/memblock.c > @@ -137,8 +137,11 @@ struct memblock_type physmem = { > i < memblock_type->cnt; \ > i++, rgn = &memblock_type->regions[i]) > > -#define memblock_dbg(fmt, ...) \ > - if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > +#define memblock_dbg(fmt, ...) \ > + do { \ > + if (memblock_debug) \ > + pr_info(fmt, ##__VA_ARGS__); \ > + } while (0) Sure, thanks! > static int memblock_debug __initdata_memblock; > static bool system_has_some_mirror __initdata_memblock = false; > _ > -- Sincerely yours, Mike. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1C0E1C433DF for ; Wed, 19 Aug 2020 20:50:26 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CFEE52083B for ; Wed, 19 Aug 2020 20:50:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="yMdx7ZGE"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="EDED5GsJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CFEE52083B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=urHosf9vGm4XkoRmct0ZBOkw36oTWACw0uE6sQAvz4Y=; b=yMdx7ZGEem+4HCGdMyQ+Fr+Jn jbMnBUmZD46IiCSfy9cwyqlpzXNY+XBRL5G9SXDEarUolheQPnv8/m85uAtGPR68MAtQaf9N1TV7R RpsjbbafxIEymz+XtNLdZH4Jg12b1w5O+BYOI0oHSMXrTjcjz+eXEWp9eCu1gB1LCMZ9QaSn8ei1S 3NESbmuW0KOCFjXwuF+C2cgSyvhEZvf6T7p/EFFYYoQwcPEqcqPNLyXbQsYMrapoboaZQU/IM6S2U crEdYtYJYrRu1Y6OwYEWNeEDqE7QuDHZJ3sg3xVWdLVt8vnVbVkYeNVtuOyeik7ervvGYAi+cLRzJ Gnbhw0G8Q==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k8V19-00027A-2F; Wed, 19 Aug 2020 20:49:07 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k8V15-00025U-VF; Wed, 19 Aug 2020 20:49:04 +0000 Received: from kernel.org (unknown [87.70.91.42]) (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 4559022B43; Wed, 19 Aug 2020 20:48:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597870143; bh=qGoMJNQU47bi4Lr27Xvnh0/Sq60m3eAX4xqpvHpl7z0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=EDED5GsJw4zUuBdGb05pEvujvo8C6rUQNmDr6tFajHgKyq8u0aC1JhmrGGKixlNzr iJK0JwajiHl4HBTkAxVXhkjy+fJ4SSitgCYA/knE1HAPx9DykSi5zvv7ufmh3aqaBj /RQUWYvoEHKL6x5oDDNaW/gHGb6Yyk2UI/DMzVR8= Date: Wed, 19 Aug 2020 23:48:48 +0300 From: Mike Rapoport To: Andrew Morton Subject: Re: [PATCH v3 09/17] memblock: make memblock_debug and related functionality private Message-ID: <20200819204848.GX752365@kernel.org> References: <20200818151634.14343-1-rppt@kernel.org> <20200818151634.14343-10-rppt@kernel.org> <20200819122405.88e9719e86ac7c3c44b4db32@linux-foundation.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200819122405.88e9719e86ac7c3c44b4db32@linux-foundation.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200819_164904_196373_EBA7CE3D X-CRM114-Status: GOOD ( 23.24 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Gleixner , Emil Renner Berthing , linux-sh@vger.kernel.org, Peter Zijlstra , Benjamin Herrenschmidt , Dave Hansen , linux-mips@vger.kernel.org, Max Filippov , Paul Mackerras , sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org, Will Deacon , Christoph Hellwig , Marek Szyprowski , linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, linux-c6x-dev@linux-c6x.org, Baoquan He , Michael Ellerman , x86@kernel.org, Russell King , Mike Rapoport , clang-built-linux@googlegroups.com, Ingo Molnar , linux-arm-kernel@lists.infradead.org, Catalin Marinas , uclinux-h8-devel@lists.sourceforge.jp, linux-xtensa@linux-xtensa.org, openrisc@lists.librecores.org, Borislav Petkov , Andy Lutomirski , Paul Walmsley , Stafford Horne , Hari Bathini , Daniel Axtens , Michal Simek , Yoshinori Sato , linux-mm@kvack.org, linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Palmer Dabbelt , linuxppc-dev@lists.ozlabs.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Aug 19, 2020 at 12:24:05PM -0700, Andrew Morton wrote: > On Tue, 18 Aug 2020 18:16:26 +0300 Mike Rapoport wrote: > > > From: Mike Rapoport > > > > The only user of memblock_dbg() outside memblock was s390 setup code and it > > is converted to use pr_debug() instead. > > This allows to stop exposing memblock_debug and memblock_dbg() to the rest > > of the kernel. > > > > --- a/mm/memblock.c > > +++ b/mm/memblock.c > > @@ -137,7 +137,10 @@ struct memblock_type physmem = { > > i < memblock_type->cnt; \ > > i++, rgn = &memblock_type->regions[i]) > > > > -int memblock_debug __initdata_memblock; > > +#define memblock_dbg(fmt, ...) \ > > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > + > > checkpatch doesn't like this much. > > ERROR: Macros starting with if should be enclosed by a do - while loop to avoid possible if/else logic defects > #101: FILE: mm/memblock.c:140: > +#define memblock_dbg(fmt, ...) \ > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ... > #102: FILE: mm/memblock.c:141: > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > ERROR: trailing statements should be on next line > #102: FILE: mm/memblock.c:141: > + if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > > > The first one is significant: > > if (foo) > memblock_dbg(...); > else > save_the_world(); > > could end up inadvertently destroying the planet. Well, it didn't till now ;-) > This? > > --- a/mm/memblock.c~memblock-make-memblock_debug-and-related-functionality-private-fix > +++ a/mm/memblock.c > @@ -137,8 +137,11 @@ struct memblock_type physmem = { > i < memblock_type->cnt; \ > i++, rgn = &memblock_type->regions[i]) > > -#define memblock_dbg(fmt, ...) \ > - if (memblock_debug) printk(KERN_INFO pr_fmt(fmt), ##__VA_ARGS__) > +#define memblock_dbg(fmt, ...) \ > + do { \ > + if (memblock_debug) \ > + pr_info(fmt, ##__VA_ARGS__); \ > + } while (0) Sure, thanks! > static int memblock_debug __initdata_memblock; > static bool system_has_some_mirror __initdata_memblock = false; > _ > -- Sincerely yours, Mike. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel