Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3568291ybv; Sun, 16 Feb 2020 00:20:43 -0800 (PST) X-Google-Smtp-Source: APXvYqz2304NCKKsXLftXjDeudDwn1ZAg4ZB/4nW6HvLivIohjuOzO29qtnPFHCeTo3SKWp/gqZI X-Received: by 2002:aca:6749:: with SMTP id b9mr6524687oiy.13.1581841243603; Sun, 16 Feb 2020 00:20:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581841243; cv=none; d=google.com; s=arc-20160816; b=H2ZEVUU8hKfKcXleIAPddhOmJiWYKk50Irdc1/N6Cj/g765qFNAnqEz07xeszfgcgt NtNqOk2ThNpIwjCSSLi0AdLRayS2AwVajgRa7OlZXVC2TcQSRDKaat67ISnFFVnw6Z0N W0ou6PQSTixY8+KxobGUr8KHzG2sjCOWnX9IiC7QT13UPplpTMx/kxpQhr4shoL1T/Sn FZ6E1XG4++V//W17245TeAJOmitki+Jh+ncA4PJOiS0sQsUzcK6WWUteffVbmp7BGcHj NfLqyPDFmojeNF9TWTZYae3ORIV2BcPFLUHrC1qjbC8TmlAQZCmOtdOFo8iCX78dTTii /NGA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=/HuRnvT1IeiUQietnQwRYr0WbT6AkO7Rz70r/EsWtNE=; b=xJeYDFy2YDQ1R03Dba85SNQ7m5iT8CKnhjX5b3KevKSImnLkEWyY9syntO6qTiMzsF JyMZm9KAFJQoUALgLkPk2ia93gwIFWQoiSCi0TZKyKo1vU43w960/5KdG6Pis4R8RXV6 7QoeuGm43OcydykWHtaMoPjzARLcwafvbki4kesr1HUIgzRYOb2sT8I5QenQdfW6xGyy 9prjjIKi0ufFtFXBBwY/hsSfzw0GNSSj27cjzqNsQQCf8gQmsgKrtwAIGuBx/Gdb0t29 lwF4NIagQHMe51QwX/DK5rrA1f24/lH0fmkA4SMPHUwCEFbR2166lv20SD5hrdUcAZb1 CMpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FVdilNv+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s188si4389918oia.277.2020.02.16.00.20.31; Sun, 16 Feb 2020 00:20:43 -0800 (PST) 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=@kernel.org header.s=default header.b=FVdilNv+; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726652AbgBPIUM (ORCPT + 99 others); Sun, 16 Feb 2020 03:20:12 -0500 Received: from mail.kernel.org ([198.145.29.99]:57406 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725899AbgBPIUL (ORCPT ); Sun, 16 Feb 2020 03:20:11 -0500 Received: from aquarius.haifa.ibm.com (nesher1.haifa.il.ibm.com [195.110.40.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 69209206E2; Sun, 16 Feb 2020 08:20:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581841210; bh=GA7NOKUteHjazd0omlCrZ7LB67zWZrKKvz+PdqlHU1A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FVdilNv+r4bdMDhAdJSsjNRzZkVm78PPNxpHv0HqMRbZMeXnoadZoHIaBELT/eroS T43wdavarsNETJ5mb6QYv4fCy1QiN338bYssIR6C6gywJXlClJYHNv1szYtfp27EmM rClawPYpBzJf42agWKL+SWrJUZrZNt3+P8CCgjWY= From: Mike Rapoport To: linux-kernel@vger.kernel.org Cc: Andrew Morton , Arnd Bergmann , Benjamin Herrenschmidt , Brian Cain , Catalin Marinas , Christophe Leroy , Fenghua Yu , Geert Uytterhoeven , Guan Xuetao , James Morse , Jonas Bonn , Julien Thierry , Ley Foon Tan , Marc Zyngier , Michael Ellerman , Paul Mackerras , Rich Felker , Russell King , Stafford Horne , Stefan Kristiansson , Suzuki K Poulose , Tony Luck , Will Deacon , Yoshinori Sato , kvmarm@lists.cs.columbia.edu, kvm-ppc@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hexagon@vger.kernel.org, linux-ia64@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, nios2-dev@lists.rocketboards.org, openrisc@lists.librecores.org, uclinux-h8-devel@lists.sourceforge.jp, Mike Rapoport , Mike Rapoport Subject: [PATCH v2 08/13] sh: fault: Modernize printing of kernel messages Date: Sun, 16 Feb 2020 10:18:38 +0200 Message-Id: <20200216081843.28670-9-rppt@kernel.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200216081843.28670-1-rppt@kernel.org> References: <20200216081843.28670-1-rppt@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Geert Uytterhoeven - Convert from printk() to pr_*(), - Add missing continuations, - Use "%llx" to format u64, - Join multiple prints in show_fault_oops() into a single print. Signed-off-by: Geert Uytterhoeven Signed-off-by: Mike Rapoport --- arch/sh/mm/fault.c | 39 ++++++++++++++++++--------------------- 1 file changed, 18 insertions(+), 21 deletions(-) diff --git a/arch/sh/mm/fault.c b/arch/sh/mm/fault.c index 5f51456f4fc7..a2b0275413e8 100644 --- a/arch/sh/mm/fault.c +++ b/arch/sh/mm/fault.c @@ -47,10 +47,10 @@ static void show_pte(struct mm_struct *mm, unsigned long addr) pgd = swapper_pg_dir; } - printk(KERN_ALERT "pgd = %p\n", pgd); + pr_alert("pgd = %p\n", pgd); pgd += pgd_index(addr); - printk(KERN_ALERT "[%08lx] *pgd=%0*Lx", addr, - (u32)(sizeof(*pgd) * 2), (u64)pgd_val(*pgd)); + pr_alert("[%08lx] *pgd=%0*llx", addr, (u32)(sizeof(*pgd) * 2), + (u64)pgd_val(*pgd)); do { pud_t *pud; @@ -61,33 +61,33 @@ static void show_pte(struct mm_struct *mm, unsigned long addr) break; if (pgd_bad(*pgd)) { - printk("(bad)"); + pr_cont("(bad)"); break; } pud = pud_offset(pgd, addr); if (PTRS_PER_PUD != 1) - printk(", *pud=%0*Lx", (u32)(sizeof(*pud) * 2), - (u64)pud_val(*pud)); + pr_cont(", *pud=%0*llx", (u32)(sizeof(*pud) * 2), + (u64)pud_val(*pud)); if (pud_none(*pud)) break; if (pud_bad(*pud)) { - printk("(bad)"); + pr_cont("(bad)"); break; } pmd = pmd_offset(pud, addr); if (PTRS_PER_PMD != 1) - printk(", *pmd=%0*Lx", (u32)(sizeof(*pmd) * 2), - (u64)pmd_val(*pmd)); + pr_cont(", *pmd=%0*llx", (u32)(sizeof(*pmd) * 2), + (u64)pmd_val(*pmd)); if (pmd_none(*pmd)) break; if (pmd_bad(*pmd)) { - printk("(bad)"); + pr_cont("(bad)"); break; } @@ -96,11 +96,11 @@ static void show_pte(struct mm_struct *mm, unsigned long addr) break; pte = pte_offset_kernel(pmd, addr); - printk(", *pte=%0*Lx", (u32)(sizeof(*pte) * 2), - (u64)pte_val(*pte)); + pr_cont(", *pte=%0*llx", (u32)(sizeof(*pte) * 2), + (u64)pte_val(*pte)); } while (0); - printk("\n"); + pr_cont("\n"); } static inline pmd_t *vmalloc_sync_one(pgd_t *pgd, unsigned long address) @@ -188,14 +188,11 @@ show_fault_oops(struct pt_regs *regs, unsigned long address) if (!oops_may_print()) return; - printk(KERN_ALERT "BUG: unable to handle kernel "); - if (address < PAGE_SIZE) - printk(KERN_CONT "NULL pointer dereference"); - else - printk(KERN_CONT "paging request"); - - printk(KERN_CONT " at %08lx\n", address); - printk(KERN_ALERT "PC:"); + pr_alert("BUG: unable to handle kernel %s at %08lx\n", + address < PAGE_SIZE ? "NULL pointer dereference" + : "paging request", + address); + pr_alert("PC:"); printk_address(regs->pc, 1); show_pte(NULL, address); -- 2.24.0