From patchwork Mon Jan 4 07:02:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1421999 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmx.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.a=rsa-sha256 header.s=badeba3b8450 header.b=ZhfRQ9WS; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4D8RRr0LRqz9sVk for ; Mon, 4 Jan 2021 18:03:28 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1EA6182462; Mon, 4 Jan 2021 08:03:15 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.b="ZhfRQ9WS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id CA73C80404; Mon, 4 Jan 2021 08:03:13 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 65D5180404 for ; Mon, 4 Jan 2021 08:03:11 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1609743788; bh=LWF25fqKlx8E9HqYUxJcvSjK4xxsw1KaEypxiCdea/0=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=ZhfRQ9WSBL9NBnd0v80j+TMXLX8IKq/1YnEa+4o9/95huNhenWPI4Rfy/dDouD5sG LM7Yy+Phf9HXd0Vu3XxEAO6gpgxf2o7NanoahQ9RfAiASx+VMfXUICGkBkATT2dl6H tTUXiabqlQBU9ad5gLcjT2FqsuQTTp17G0l216j4= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from LT02.fritz.box ([62.143.246.89]) by mail.gmx.com (mrgmx104 [212.227.17.174]) with ESMTPSA (Nemesis) id 1MLR1f-1keW3r0t5n-00IUMh; Mon, 04 Jan 2021 08:03:08 +0100 From: Heinrich Schuchardt To: Simon Glass Cc: Lokesh Vutla , Bin Meng , Vignesh Raghavendra , Grygorii Strashko , Sean Anderson , u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH 0/5] log: convert pr_*() to logging Date: Mon, 4 Jan 2021 08:02:51 +0100 Message-Id: <20210104070256.260002-1-xypron.glpk@gmx.de> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 X-Provags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9ROX0HJRLauyRKrOfrmg 4vx4La5FttSzlXjBmrQd42JjAm3dSTEUDC17tQJMzBDBFP7eD6JsdD3CLABn5j+Lzs1rACKXU YwrynC/gcobrI44sfYug== X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.3 at phobos.denx.de X-Virus-Status: Clean In drivers we use a family of printing functions including pr_err() and pr_cont(). CONFIG_LOGLEVEL is used to control which of these lead to output via printf(). Our logging functions allow finer grained control of output. So replace printf() by the matching logging functions. The usage of CONFIG_LOGLEVEL remains unchanged. The first patch changes the k3-j721e RAM driver to avoid a duplicate use of the macro name BIT_MASK(). The second patch ensures that debug_cond() can be used like a function. The third patch provides macros for logging at levels EMERGENCY, ALERT, CRITICAL and for message continuation. The fourth patch uses the logging macros to implement the pr_*() macros. The fifth patch provices a unit test. Heinrich Schuchardt (5): ram: k3-j721e: rename BIT_MASK() log: make debug_cond() function like log: provide missing macros log: convert pr_*() to logging test: unit test for pr_err(), pr_cont() drivers/ram/k3-j721e/lpddr4.c | 14 ++--- drivers/ram/k3-j721e/lpddr4_private.h | 20 ++++--- include/linux/bitops.h | 4 +- include/linux/printk.h | 82 +++++++++++++++------------ include/log.h | 25 +++++--- test/log/Makefile | 1 + test/log/pr_cont_test.c | 45 +++++++++++++++ 7 files changed, 129 insertions(+), 62 deletions(-) create mode 100644 test/log/pr_cont_test.c --- 2.29.2