get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/814474/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 814474,
    "url": "http://patchwork.ozlabs.org/api/patches/814474/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/uboot/patch/1505538646-19191-3-git-send-email-yamada.masahiro@socionext.com/",
    "project": {
        "id": 18,
        "url": "http://patchwork.ozlabs.org/api/projects/18/?format=api",
        "name": "U-Boot",
        "link_name": "uboot",
        "list_id": "u-boot.lists.denx.de",
        "list_email": "u-boot@lists.denx.de",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<1505538646-19191-3-git-send-email-yamada.masahiro@socionext.com>",
    "list_archive_url": null,
    "date": "2017-09-16T05:10:40",
    "name": "[U-Boot,v2,2/8] printk: collect printk stuff into <linux/printk.h> with loglevel support",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "452e1beb9cd6a46678b2520f23cb8b99f0abd97b",
    "submitter": {
        "id": 65882,
        "url": "http://patchwork.ozlabs.org/api/people/65882/?format=api",
        "name": "Masahiro Yamada",
        "email": "yamada.masahiro@socionext.com"
    },
    "delegate": {
        "id": 3651,
        "url": "http://patchwork.ozlabs.org/api/users/3651/?format=api",
        "username": "trini",
        "first_name": "Tom",
        "last_name": "Rini",
        "email": "trini@ti.com"
    },
    "mbox": "http://patchwork.ozlabs.org/project/uboot/patch/1505538646-19191-3-git-send-email-yamada.masahiro@socionext.com/mbox/",
    "series": [
        {
            "id": 3418,
            "url": "http://patchwork.ozlabs.org/api/series/3418/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/uboot/list/?series=3418",
            "date": "2017-09-16T05:10:45",
            "name": "Sync and consolidate Linux-derived printk, BUILD_BUG, BUG, WARN, etc.",
            "version": 2,
            "mbox": "http://patchwork.ozlabs.org/series/3418/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/814474/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/814474/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<u-boot-bounces@lists.denx.de>",
        "X-Original-To": "incoming@patchwork.ozlabs.org",
        "Delivered-To": "patchwork-incoming@bilbo.ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=nifty.com header.i=@nifty.com\n\theader.b=\"G/O1F0xk\"; dkim-atps=neutral"
        ],
        "Received": [
            "from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xvL825bjlz9s81\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 16 Sep 2017 15:15:46 +1000 (AEST)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid 7E746C22046; Sat, 16 Sep 2017 05:13:12 +0000 (UTC)",
            "from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 3C01DC21F9D;\n\tSat, 16 Sep 2017 05:11:51 +0000 (UTC)",
            "by lists.denx.de (Postfix, from userid 105)\n\tid 45B21C21F2A; Sat, 16 Sep 2017 05:11:29 +0000 (UTC)",
            "from conuserg-09.nifty.com (conuserg-09.nifty.com [210.131.2.76])\n\tby lists.denx.de (Postfix) with ESMTPS id 2C672C21FE9\n\tfor <u-boot@lists.denx.de>; Sat, 16 Sep 2017 05:11:24 +0000 (UTC)",
            "from grover.sesame (FL1-122-131-185-176.osk.mesh.ad.jp\n\t[122.131.185.176]) (authenticated)\n\tby conuserg-09.nifty.com with ESMTP id v8G5Asom028761;\n\tSat, 16 Sep 2017 14:10:56 +0900"
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=0.0 required=5.0 tests=T_DKIM_INVALID\n\tautolearn=unavailable autolearn_force=no version=3.4.0",
        "DKIM-Filter": "OpenDKIM Filter v2.10.3 conuserg-09.nifty.com v8G5Asom028761",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com;\n\ts=dec2015msa; t=1505538656;\n\tbh=xTUZhBO8DdgW2aSnm4iMEDhbBwobR3k6fdMMnchE3fQ=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=G/O1F0xkYtj70f6Vpc7VjGBU54WrKZ5EXEHOsjWUOyXXyoIn1qae9KGNC7czCTGlb\n\tHKDrNaCPVYmFa+kbcsuxN12shmOTfo4HtLkpJItNn4Ds8ts0JC2HrJ5zUekgxyrUGg\n\ti+XlEfet1agcdKcer+Du4Ip4sq/j9mHsNzr9pe0dscmJlJztSaRe2OtbhQGPJQ8iHV\n\trZlJYpQ/9wKZxp4AAh2AS8sogSThdPkShH6MFySqEM3M6sU2lT/Q7zUrA0A15fv42m\n\tAJgI3SuPzmHUpHBY5JS/krHDc1AqQ8RO53DKk4guU52dDWKHjGeZ1ISmjGO6wuKf4Y\n\tb3N1MhLyoInHA==",
        "X-Nifty-SrcIP": "[122.131.185.176]",
        "From": "Masahiro Yamada <yamada.masahiro@socionext.com>",
        "To": "u-boot@lists.denx.de",
        "Date": "Sat, 16 Sep 2017 14:10:40 +0900",
        "Message-Id": "<1505538646-19191-3-git-send-email-yamada.masahiro@socionext.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1505538646-19191-1-git-send-email-yamada.masahiro@socionext.com>",
        "References": "<1505538646-19191-1-git-send-email-yamada.masahiro@socionext.com>",
        "Cc": "Marek Vasut <marex@denx.de>, Albert Aribaud <albert.u.boot@aribaud.net>, \n\tStefan Agner <stefan.agner@toradex.com>,\n\tPeter Howard <phoward@gme.net.au>",
        "Subject": "[U-Boot] [PATCH v2 2/8] printk: collect printk stuff into\n\t<linux/printk.h> with loglevel support",
        "X-BeenThere": "u-boot@lists.denx.de",
        "X-Mailman-Version": "2.1.18",
        "Precedence": "list",
        "List-Id": "U-Boot discussion <u-boot.lists.denx.de>",
        "List-Unsubscribe": "<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>",
        "List-Archive": "<http://lists.denx.de/pipermail/u-boot/>",
        "List-Post": "<mailto:u-boot@lists.denx.de>",
        "List-Help": "<mailto:u-boot-request@lists.denx.de?subject=help>",
        "List-Subscribe": "<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "Content-Transfer-Encoding": "base64",
        "Errors-To": "u-boot-bounces@lists.denx.de",
        "Sender": "\"U-Boot\" <u-boot-bounces@lists.denx.de>"
    },
    "content": "When we import code from Linux, with regular re-sync planned, we want\nto use printk() and pr_*().  U-Boot does not support them in a clean\nway.  So, people end up with local macros, or compat headers here and\nthere, then we occasionally see build errors of definition conflicts.\n\nWe have include/linux/compat.h, but putting all sorts of unrelated\nthings into a single header is just a temporal workaround.  Hence this\npatch, to find the best home for all printk variants.  If you want to\nuse printk() and friends, please include <linux/printk.h>.  This header\nis self-contained, and pulls in only a few headers.\n\nWhen I was testing this clean-up, I noticed the image size exceeded\nits platform limit on some boards.  This is because all pr_*() that\nwere previously defined as no-op in include/linux/mtd/mtd.h (unless\nCONFIG_MTD_DEBUG is set), are now enabled.\n\nTo make such boards happy, this commit also implements CONFIG_LOGLEVEL.\nThe concept is similar to the kernel parameter \"loglevel\".  (Actually,\nthe Kconfig help message was taken from kernel-paremeter.txt of Linux)\nMessages with a loglevel smaller than console loglevel will be printed.\n\nThe difference is the loglevel is build-time determined.  To save the\nimage size, lower priority pr_*() are compiled out.  I set the default\nof CONFIG_LOGLEVEL to 6, i.e. pr_notice and higher priority messages\nare compiled in.\n\nI adjusted CONFIG_LOGLEVEL to avoid build error for some boards.\n\nSigned-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>\n---\n\nChanges in v2:\n  - Add CONFIG_LOGLEVEL to adjust image size for some boards\n\n arch/arm/mach-uniphier/dram_init.c             |  3 -\n arch/arm/mach-uniphier/init.h                  |  5 --\n common/Kconfig                                 | 17 ++++++\n configs/axm_defconfig                          |  1 +\n configs/colibri_vf_defconfig                   |  1 +\n configs/corvus_defconfig                       |  1 +\n configs/omapl138_lcdk_defconfig                |  1 +\n configs/openrd_base_defconfig                  |  1 +\n configs/openrd_client_defconfig                |  1 +\n configs/openrd_ultimate_defconfig              |  1 +\n configs/taurus_defconfig                       |  1 +\n configs/vf610twr_defconfig                     |  1 +\n configs/vf610twr_nand_defconfig                |  1 +\n drivers/bios_emulator/include/x86emu/x86emui.h |  3 -\n drivers/usb/dwc3/linux-compat.h                |  1 -\n drivers/usb/musb-new/linux-compat.h            |  2 -\n include/common.h                               |  6 +-\n include/linux/compat.h                         | 11 ----\n include/linux/mtd/mtd.h                        | 10 +---\n include/linux/printk.h                         | 79 ++++++++++++++++++++++++++\n 20 files changed, 108 insertions(+), 39 deletions(-)\n create mode 100644 include/linux/printk.h",
    "diff": "diff --git a/arch/arm/mach-uniphier/dram_init.c b/arch/arm/mach-uniphier/dram_init.c\nindex 32d359321ae2..22136855fa1a 100644\n--- a/arch/arm/mach-uniphier/dram_init.c\n+++ b/arch/arm/mach-uniphier/dram_init.c\n@@ -15,9 +15,6 @@\n #include \"sg-regs.h\"\n #include \"soc-info.h\"\n \n-#define pr_warn(fmt, args...)\tprintf(fmt, ##args)\n-#define pr_err(fmt, args...)\tprintf(fmt, ##args)\n-\n DECLARE_GLOBAL_DATA_PTR;\n \n struct uniphier_memif_data {\ndiff --git a/arch/arm/mach-uniphier/init.h b/arch/arm/mach-uniphier/init.h\nindex 29f638d94703..da209354ed50 100644\n--- a/arch/arm/mach-uniphier/init.h\n+++ b/arch/arm/mach-uniphier/init.h\n@@ -104,9 +104,4 @@ int uniphier_have_internal_stm(void);\n int uniphier_boot_from_backend(void);\n int uniphier_pin_init(const char *pinconfig_name);\n \n-#undef pr_warn\n-#define pr_warn(fmt, args...)\tprintf(fmt, ##args)\n-#undef pr_err\n-#define pr_err(fmt, args...)\tprintf(fmt, ##args)\n-\n #endif /* __MACH_INIT_H */\ndiff --git a/common/Kconfig b/common/Kconfig\nindex 4d8cae96109a..79fe781ba59f 100644\n--- a/common/Kconfig\n+++ b/common/Kconfig\n@@ -243,6 +243,23 @@ config IDENT_STRING\n \thelp\n \t  This options adds the board specific name to u-boot version.\n \n+config LOGLEVEL\n+\tint \"loglevel\"\n+\tdefault 6\n+\trange 0 8\n+\thelp\n+\t  All Messages with a loglevel smaller than the console loglevel will\n+\t  be compiled in. The loglevels are defined as follows:\n+\n+\t  0 (KERN_EMERG)          system is unusable\n+\t  1 (KERN_ALERT)          action must be taken immediately\n+\t  2 (KERN_CRIT)           critical conditions\n+\t  3 (KERN_ERR)            error conditions\n+\t  4 (KERN_WARNING)        warning conditions\n+\t  5 (KERN_NOTICE)         normal but significant condition\n+\t  6 (KERN_INFO)           informational\n+\t  7 (KERN_DEBUG)          debug-level messages\n+\n config SILENT_CONSOLE\n \tbool \"Support a silent console\"\n \thelp\ndiff --git a/configs/axm_defconfig b/configs/axm_defconfig\nindex 81654b230431..cd89c2a235ff 100644\n--- a/configs/axm_defconfig\n+++ b/configs/axm_defconfig\n@@ -41,3 +41,4 @@ CONFIG_SPI_FLASH=y\n CONFIG_SPI_FLASH_STMICRO=y\n CONFIG_PHYLIB=y\n CONFIG_USE_TINY_PRINTF=y\n+CONFIG_LOGLEVEL=4\ndiff --git a/configs/colibri_vf_defconfig b/configs/colibri_vf_defconfig\nindex 1ffe86180974..49315d0638ed 100644\n--- a/configs/colibri_vf_defconfig\n+++ b/configs/colibri_vf_defconfig\n@@ -6,6 +6,7 @@ CONFIG_TARGET_COLIBRI_VF=y\n CONFIG_DEFAULT_DEVICE_TREE=\"vf610-colibri\"\n CONFIG_SYS_EXTRA_OPTIONS=\"IMX_CONFIG=board/toradex/colibri_vf/imximage.cfg,IMX_NAND\"\n CONFIG_BOOTDELAY=1\n+CONFIG_LOGLEVEL=3\n CONFIG_VERSION_VARIABLE=y\n # CONFIG_DISPLAY_BOARDINFO is not set\n CONFIG_ARCH_MISC_INIT=y\ndiff --git a/configs/corvus_defconfig b/configs/corvus_defconfig\nindex 705e00145700..059cb5992e92 100644\n--- a/configs/corvus_defconfig\n+++ b/configs/corvus_defconfig\n@@ -14,6 +14,7 @@ CONFIG_SYS_EXTRA_OPTIONS=\"AT91SAM9M10G45,MACH_TYPE=2066,SYS_USE_NANDFLASH\"\n CONFIG_BOOTDELAY=3\n CONFIG_USE_BOOTARGS=y\n CONFIG_BOOTARGS=\"console=ttyS0,115200 earlyprintk mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro,256k(env),256k(env_redundant),256k(spare),512k(dtb),6M(kernel)ro,-(rootfs) root=/dev/mtdblock7 rw rootfstype=jffs2\"\n+CONFIG_LOGLEVEL=4\n # CONFIG_DISPLAY_BOARDINFO is not set\n CONFIG_BOARD_EARLY_INIT_F=y\n CONFIG_SPL=y\ndiff --git a/configs/omapl138_lcdk_defconfig b/configs/omapl138_lcdk_defconfig\nindex c95134bcf990..3e9eb4fa84e2 100644\n--- a/configs/omapl138_lcdk_defconfig\n+++ b/configs/omapl138_lcdk_defconfig\n@@ -8,6 +8,7 @@ CONFIG_SPL_MMC_SUPPORT=y\n CONFIG_SPL_SERIAL_SUPPORT=y\n CONFIG_SPL_NAND_SUPPORT=y\n CONFIG_BOOTDELAY=3\n+CONFIG_LOGLEVEL=4\n CONFIG_VERSION_VARIABLE=y\n # CONFIG_DISPLAY_CPUINFO is not set\n # CONFIG_DISPLAY_BOARDINFO is not set\ndiff --git a/configs/openrd_base_defconfig b/configs/openrd_base_defconfig\nindex b2a0e04d36ce..f31af1c3fe75 100644\n--- a/configs/openrd_base_defconfig\n+++ b/configs/openrd_base_defconfig\n@@ -5,6 +5,7 @@ CONFIG_TARGET_OPENRD=y\n CONFIG_IDENT_STRING=\"\\nOpenRD-Base\"\n CONFIG_SYS_EXTRA_OPTIONS=\"BOARD_IS_OPENRD_BASE\"\n CONFIG_BOOTDELAY=3\n+CONFIG_LOGLEVEL=3\n # CONFIG_DISPLAY_BOARDINFO is not set\n # CONFIG_CMD_IMLS is not set\n # CONFIG_CMD_FLASH is not set\ndiff --git a/configs/openrd_client_defconfig b/configs/openrd_client_defconfig\nindex 8b1d35edd10f..bee818b82cc1 100644\n--- a/configs/openrd_client_defconfig\n+++ b/configs/openrd_client_defconfig\n@@ -5,6 +5,7 @@ CONFIG_TARGET_OPENRD=y\n CONFIG_IDENT_STRING=\"\\nOpenRD-Client\"\n CONFIG_SYS_EXTRA_OPTIONS=\"BOARD_IS_OPENRD_CLIENT\"\n CONFIG_BOOTDELAY=3\n+CONFIG_LOGLEVEL=3\n # CONFIG_DISPLAY_BOARDINFO is not set\n # CONFIG_CMD_IMLS is not set\n # CONFIG_CMD_FLASH is not set\ndiff --git a/configs/openrd_ultimate_defconfig b/configs/openrd_ultimate_defconfig\nindex 4cc0205629f6..e9462e59b2f1 100644\n--- a/configs/openrd_ultimate_defconfig\n+++ b/configs/openrd_ultimate_defconfig\n@@ -5,6 +5,7 @@ CONFIG_TARGET_OPENRD=y\n CONFIG_IDENT_STRING=\"\\nOpenRD-Ultimate\"\n CONFIG_SYS_EXTRA_OPTIONS=\"BOARD_IS_OPENRD_ULTIMATE\"\n CONFIG_BOOTDELAY=3\n+CONFIG_LOGLEVEL=3\n # CONFIG_DISPLAY_BOARDINFO is not set\n # CONFIG_CMD_IMLS is not set\n # CONFIG_CMD_FLASH is not set\ndiff --git a/configs/taurus_defconfig b/configs/taurus_defconfig\nindex 71a382a3e132..5b7fc8ae1466 100644\n--- a/configs/taurus_defconfig\n+++ b/configs/taurus_defconfig\n@@ -16,6 +16,7 @@ CONFIG_SPL_SPI_SUPPORT=y\n CONFIG_DEFAULT_DEVICE_TREE=\"at91sam9g20-taurus\"\n CONFIG_SYS_EXTRA_OPTIONS=\"AT91SAM9G20,MACH_TYPE=2067,BOARD_TAURUS\"\n CONFIG_BOOTDELAY=3\n+CONFIG_LOGLEVEL=4\n CONFIG_USE_BOOTARGS=y\n CONFIG_BOOTARGS=\"console=ttyS0,115200 earlyprintk mtdparts=atmel_nand:256k(bootstrap)ro,512k(uboot)ro,256k(env),256k(env_redundant),256k(spare),512k(dtb),6M(kernel)ro,-(rootfs) root=/dev/mtdblock7 rw rootfstype=jffs2\"\n # CONFIG_DISPLAY_BOARDINFO is not set\ndiff --git a/configs/vf610twr_defconfig b/configs/vf610twr_defconfig\nindex 948ea73edb91..3c277be6828f 100644\n--- a/configs/vf610twr_defconfig\n+++ b/configs/vf610twr_defconfig\n@@ -3,6 +3,7 @@ CONFIG_ARCH_VF610=y\n CONFIG_DEFAULT_DEVICE_TREE=\"vf610-twr\"\n CONFIG_SYS_EXTRA_OPTIONS=\"IMX_CONFIG=board/freescale/vf610twr/imximage.cfg\"\n CONFIG_BOOTDELAY=3\n+CONFIG_LOGLEVEL=3\n CONFIG_BOARD_EARLY_INIT_F=y\n CONFIG_HUSH_PARSER=y\n CONFIG_CMD_BOOTZ=y\ndiff --git a/configs/vf610twr_nand_defconfig b/configs/vf610twr_nand_defconfig\nindex 10cdf0646c98..1cd22b1b8b31 100644\n--- a/configs/vf610twr_nand_defconfig\n+++ b/configs/vf610twr_nand_defconfig\n@@ -3,6 +3,7 @@ CONFIG_ARCH_VF610=y\n CONFIG_DEFAULT_DEVICE_TREE=\"vf610-twr\"\n CONFIG_SYS_EXTRA_OPTIONS=\"IMX_CONFIG=board/freescale/vf610twr/imximage.cfg\"\n CONFIG_BOOTDELAY=3\n+CONFIG_LOGLEVEL=3\n CONFIG_BOARD_EARLY_INIT_F=y\n CONFIG_HUSH_PARSER=y\n CONFIG_CMD_BOOTZ=y\ndiff --git a/drivers/bios_emulator/include/x86emu/x86emui.h b/drivers/bios_emulator/include/x86emu/x86emui.h\nindex a74957d992aa..3537255539fe 100644\n--- a/drivers/bios_emulator/include/x86emu/x86emui.h\n+++ b/drivers/bios_emulator/include/x86emu/x86emui.h\n@@ -72,9 +72,6 @@\n #include <string.h>\n #endif\n \n-#define printk printf\n-\n-\n /*--------------------------- Inline Functions ----------------------------*/\n \n #ifdef  __cplusplus\ndiff --git a/drivers/usb/dwc3/linux-compat.h b/drivers/usb/dwc3/linux-compat.h\nindex 9e944a31be11..64db4ecc3c6f 100644\n--- a/drivers/usb/dwc3/linux-compat.h\n+++ b/drivers/usb/dwc3/linux-compat.h\n@@ -12,7 +12,6 @@\n #ifndef __DWC3_LINUX_COMPAT__\n #define __DWC3_LINUX_COMPAT__\n \n-#define pr_debug(format)                debug(format)\n #define WARN(val, format, arg...)\tdebug(format, ##arg)\n #define dev_WARN(dev, format, arg...)\tdebug(format, ##arg)\n #define WARN_ON_ONCE(val)\t\tdebug(\"Error %d\\n\", val)\ndiff --git a/drivers/usb/musb-new/linux-compat.h b/drivers/usb/musb-new/linux-compat.h\nindex 4dae83ed6850..7bb53d2b198e 100644\n--- a/drivers/usb/musb-new/linux-compat.h\n+++ b/drivers/usb/musb-new/linux-compat.h\n@@ -5,8 +5,6 @@\n #include <linux/list.h>\n #include <linux/compat.h>\n \n-#define pr_debug(fmt, args...) debug(fmt, ##args)\n-\n #define WARN(condition, fmt, args...) ({\t\\\n \tint ret_warn = !!condition;\t\t\\\n \tif (ret_warn)\t\t\t\t\\\ndiff --git a/include/common.h b/include/common.h\nindex 5e841947c17f..4eb92298a207 100644\n--- a/include/common.h\n+++ b/include/common.h\n@@ -25,6 +25,7 @@ typedef volatile unsigned char\tvu_char;\n #include <linux/bitops.h>\n #include <linux/delay.h>\n #include <linux/types.h>\n+#include <linux/printk.h>\n #include <linux/string.h>\n #include <linux/stringify.h>\n #include <asm/ptrace.h>\n@@ -55,11 +56,6 @@ typedef volatile unsigned char\tvu_char;\n #define _SPL_BUILD\t0\n #endif\n \n-/* Define this at the top of a file to add a prefix to debug messages */\n-#ifndef pr_fmt\n-#define pr_fmt(fmt) fmt\n-#endif\n-\n /*\n  * Output a debug text when condition \"cond\" is met. The \"cond\" should be\n  * computed by a preprocessor in the best case, allowing for the best\ndiff --git a/include/linux/compat.h b/include/linux/compat.h\nindex 2336b56cf5c1..bc027adcb936 100644\n--- a/include/linux/compat.h\n+++ b/include/linux/compat.h\n@@ -25,17 +25,6 @@ extern struct p_current *current;\n \tprintf(fmt, ##args)\n #define dev_warn(dev, fmt, args...)\t\t\\\n \tprintf(fmt, ##args)\n-#define printk\tprintf\n-#define printk_once\tprintf\n-\n-#define KERN_EMERG\n-#define KERN_ALERT\n-#define KERN_CRIT\n-#define KERN_ERR\n-#define KERN_WARNING\n-#define KERN_NOTICE\n-#define KERN_INFO\n-#define KERN_DEBUG\n \n #define GFP_ATOMIC ((gfp_t) 0)\n #define GFP_KERNEL ((gfp_t) 0)\ndiff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h\nindex 1fd17c303a8d..3e1694b3a5d3 100644\n--- a/include/linux/mtd/mtd.h\n+++ b/include/linux/mtd/mtd.h\n@@ -452,28 +452,20 @@ static inline void mtd_erase_callback(struct erase_info *instr)\n #define MTD_DEBUG_LEVEL3\t(3)\t/* Noisy   */\n \n #ifdef CONFIG_MTD_DEBUG\n-#define pr_debug(args...)\tMTDDEBUG(MTD_DEBUG_LEVEL0, args)\n #define MTDDEBUG(n, args...)\t\t\t\t\\\n \tdo {\t\t\t\t\t\t\\\n \t\tif (n <= CONFIG_MTD_DEBUG_VERBOSE)\t\\\n \t\t\tprintk(KERN_INFO args);\t\t\\\n \t} while(0)\n #else /* CONFIG_MTD_DEBUG */\n-#define pr_debug(args...)\n #define MTDDEBUG(n, args...)\t\t\t\t\\\n \tdo {\t\t\t\t\t\t\\\n \t\tif (0)\t\t\t\t\t\\\n \t\t\tprintk(KERN_INFO args);\t\t\\\n \t} while(0)\n #endif /* CONFIG_MTD_DEBUG */\n-#define pr_info(args...)\tMTDDEBUG(MTD_DEBUG_LEVEL0, args)\n-#define pr_warn(args...)\tMTDDEBUG(MTD_DEBUG_LEVEL0, args)\n-#define pr_err(args...)\t\tMTDDEBUG(MTD_DEBUG_LEVEL0, args)\n-#define pr_crit(args...)\tMTDDEBUG(MTD_DEBUG_LEVEL0, args)\n-#define pr_cont(args...)\tMTDDEBUG(MTD_DEBUG_LEVEL0, args)\n-#define pr_notice(args...)\tMTDDEBUG(MTD_DEBUG_LEVEL0, args)\n #endif\n- \n+\n static inline int mtd_is_bitflip(int err) {\n \treturn err == -EUCLEAN;\n }\ndiff --git a/include/linux/printk.h b/include/linux/printk.h\nnew file mode 100644\nindex 000000000000..088513ad29bb\n--- /dev/null\n+++ b/include/linux/printk.h\n@@ -0,0 +1,79 @@\n+#ifndef __KERNEL_PRINTK__\n+#define __KERNEL_PRINTK__\n+\n+#include <stdio.h>\n+#include <linux/compiler.h>\n+\n+#define KERN_EMERG\n+#define KERN_ALERT\n+#define KERN_CRIT\n+#define KERN_ERR\n+#define KERN_WARNING\n+#define KERN_NOTICE\n+#define KERN_INFO\n+#define KERN_DEBUG\n+#define KERN_CONT\n+\n+#define printk(fmt, ...) \\\n+\tprintf(fmt, ##__VA_ARGS__)\n+\n+/*\n+ * Dummy printk for disabled debugging statements to use whilst maintaining\n+ * gcc's format checking.\n+ */\n+#define no_printk(fmt, ...)\t\t\t\t\\\n+({\t\t\t\t\t\t\t\\\n+\tif (0)\t\t\t\t\t\t\\\n+\t\tprintk(fmt, ##__VA_ARGS__);\t\t\\\n+\t0;\t\t\t\t\t\t\\\n+})\n+\n+#define __printk(level, fmt, ...)\t\t\t\t\t\\\n+({\t\t\t\t\t\t\t\t\t\\\n+\tlevel < CONFIG_LOGLEVEL ? printk(fmt, ##__VA_ARGS__) : 0;\t\\\n+})\n+\n+#ifndef pr_fmt\n+#define pr_fmt(fmt) fmt\n+#endif\n+\n+#define pr_emerg(fmt, ...) \\\n+\t__printk(0, pr_fmt(fmt), ##__VA_ARGS__)\n+#define pr_alert(fmt, ...) \\\n+\t__printk(1, pr_fmt(fmt), ##__VA_ARGS__)\n+#define pr_crit(fmt, ...) \\\n+\t__printk(2, pr_fmt(fmt), ##__VA_ARGS__)\n+#define pr_err(fmt, ...) \\\n+\t__printk(3, pr_fmt(fmt), ##__VA_ARGS__)\n+#define pr_warning(fmt, ...) \\\n+\t__printk(4, pr_fmt(fmt), ##__VA_ARGS__)\n+#define pr_warn pr_warning\n+#define pr_notice(fmt, ...) \\\n+\t__printk(5, pr_fmt(fmt), ##__VA_ARGS__)\n+#define pr_info(fmt, ...) \\\n+\t__printk(6, pr_fmt(fmt), ##__VA_ARGS__)\n+\n+#define pr_cont(fmt, ...) \\\n+\tprintk(fmt, ##__VA_ARGS__)\n+\n+/* pr_devel() should produce zero code unless DEBUG is defined */\n+#ifdef DEBUG\n+#define pr_devel(fmt, ...) \\\n+\t__printk(7, pr_fmt(fmt), ##__VA_ARGS__)\n+#else\n+#define pr_devel(fmt, ...) \\\n+\tno_printk(pr_fmt(fmt), ##__VA_ARGS__)\n+#endif\n+\n+#ifdef DEBUG\n+#define pr_debug(fmt, ...) \\\n+\t__printk(7, pr_fmt(fmt), ##__VA_ARGS__)\n+#else\n+#define pr_debug(fmt, ...) \\\n+\tno_printk(pr_fmt(fmt), ##__VA_ARGS__)\n+#endif\n+\n+#define printk_once(fmt, ...) \\\n+\tprintk(fmt, ##__VA_ARGS__)\n+\n+#endif\n",
    "prefixes": [
        "U-Boot",
        "v2",
        "2/8"
    ]
}