Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1999408imu; Fri, 14 Dec 2018 04:17:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/VMtHSkxt3oMmCPcR6RBUOsCvdfqfOogZ9jqZ2E95dZdOaVZEDo5m4i1NO3GiRaqPP5h9M7 X-Received: by 2002:a63:f412:: with SMTP id g18mr2551560pgi.262.1544789838377; Fri, 14 Dec 2018 04:17:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544789838; cv=none; d=google.com; s=arc-20160816; b=Hd45PPrCeWWk2tx66Pjj7wJ48hPQ5KAb6pQpVkjDY9MvmFcVa8zNYoQfbOhmIVDk4P QT+xGDzG3NS3WhuPogfqv9TgpaEguAfb3A+Kil/tm1D/xl8YVaTQmoSmhStJkUS7qYlB CJz+bXkDB7tCAtnajr4PNXCc+ItFJkjj1r7sK5X8lU/rG9D/zaew4cYGGGpolquQmwZI J5aqt3w/V5qDSUPZptpJY7OYQhACU8ycmVHiPbuZINcRrDJ1mgPRNgiUNZgGP8WNN8UH 9AD4zx5TVXEs9iJe2ZJamxQfltv6ftY2IbfGkB2TkbRRh4plqL7485KQeivE4zyosB9t 6sLA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=9r8J/Q/z2Rhce6IsyWLDrMGDraujT5m5vfhGvlMk720=; b=fGDhf/Uq8WqnqBaL6xIttoQx+bBurr51fqGgCboE52CVQZGp2LIvatRt4XDiTXRAeC Dd+k2DtzSfaqg+vzbv6vuxF6bctp7b8xOW8bYzMf1KrDMKxHATLXK+yvTNmQp2l0U0si RsCoawNU7yMGkJBqgbh7Jhlq2Eg/6HkQGGXeFXx5Pe5bzlTAx7dLar9uz4Ndzx6w/ACS KzwS9BTA79w6yYEZzxcLe3KrQ/NvKNqF2BPJOnb6b4XDAskZLMOcIlRHRniS/vyVD0Bm FHo1SkUVEg7KELmRzg/zuOPaWJ2bgEOSpqAnlYq3bWHE6cHq7H78K3SAG7PEldGFlTBb MVZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cLjVDd4M; 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 a16si3865140pls.146.2018.12.14.04.17.03; Fri, 14 Dec 2018 04:17:18 -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=cLjVDd4M; 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 S1732725AbeLNMQQ (ORCPT + 99 others); Fri, 14 Dec 2018 07:16:16 -0500 Received: from mail.kernel.org ([198.145.29.99]:36418 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730605AbeLNMQO (ORCPT ); Fri, 14 Dec 2018 07:16:14 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (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 A4CB821486; Fri, 14 Dec 2018 12:16:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1544789773; bh=CExm3AprISSBfUVr94+ItiWypR6PaCSfN/cK2YR0s3Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cLjVDd4MA3oiyPrXqa5Jn6orNa2Dg+pRDqrm1M6BEfdmoDW4tS7vAY9rtCZEnzMHC zD2+zeXO2yheqMR9eqJvNJpYoa3kQCE5jr5GCs+pQR27htW9+1eJYxbBcAeT9h64zi v5i0BB8iHMd28eqmWxRAHqcU1oropPkomt/u6jrU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kees Cook , Konrad Rzeszutek Wilk , Christoph Hellwig , Ben Hutchings Subject: [PATCH 4.4 72/88] swiotlb: clean up reporting Date: Fri, 14 Dec 2018 13:00:46 +0100 Message-Id: <20181214115708.195062562@linuxfoundation.org> X-Mailer: git-send-email 2.20.0 In-Reply-To: <20181214115702.151309521@linuxfoundation.org> References: <20181214115702.151309521@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Kees Cook commit 7d63fb3af87aa67aa7d24466e792f9d7c57d8e79 upstream. This removes needless use of '%p', and refactors the printk calls to use pr_*() helpers instead. Signed-off-by: Kees Cook Reviewed-by: Konrad Rzeszutek Wilk Signed-off-by: Christoph Hellwig [bwh: Backported to 4.4: - Adjust filename - Remove "swiotlb: " prefix from an additional log message] Signed-off-by: Ben Hutchings Signed-off-by: Greg Kroah-Hartman --- lib/swiotlb.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) --- a/lib/swiotlb.c +++ b/lib/swiotlb.c @@ -17,6 +17,8 @@ * 08/12/11 beckyb Add highmem support */ +#define pr_fmt(fmt) "software IO TLB: " fmt + #include #include #include @@ -143,20 +145,16 @@ static bool no_iotlb_memory; void swiotlb_print_info(void) { unsigned long bytes = io_tlb_nslabs << IO_TLB_SHIFT; - unsigned char *vstart, *vend; if (no_iotlb_memory) { - pr_warn("software IO TLB: No low mem\n"); + pr_warn("No low mem\n"); return; } - vstart = phys_to_virt(io_tlb_start); - vend = phys_to_virt(io_tlb_end); - - printk(KERN_INFO "software IO TLB [mem %#010llx-%#010llx] (%luMB) mapped at [%p-%p]\n", + pr_info("mapped [mem %#010llx-%#010llx] (%luMB)\n", (unsigned long long)io_tlb_start, (unsigned long long)io_tlb_end, - bytes >> 20, vstart, vend - 1); + bytes >> 20); } int __init swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose) @@ -230,7 +228,7 @@ swiotlb_init(int verbose) if (io_tlb_start) memblock_free_early(io_tlb_start, PAGE_ALIGN(io_tlb_nslabs << IO_TLB_SHIFT)); - pr_warn("Cannot allocate SWIOTLB buffer"); + pr_warn("Cannot allocate buffer"); no_iotlb_memory = true; } @@ -272,8 +270,8 @@ swiotlb_late_init_with_default_size(size return -ENOMEM; } if (order != get_order(bytes)) { - printk(KERN_WARNING "Warning: only able to allocate %ld MB " - "for software IO TLB\n", (PAGE_SIZE << order) >> 20); + pr_warn("only able to allocate %ld MB\n", + (PAGE_SIZE << order) >> 20); io_tlb_nslabs = SLABS_PER_PAGE << order; } rc = swiotlb_late_init_with_tbl(vstart, io_tlb_nslabs); @@ -680,7 +678,7 @@ swiotlb_alloc_coherent(struct device *hw return ret; err_warn: - pr_warn("swiotlb: coherent allocation failed for device %s size=%zu\n", + pr_warn("coherent allocation failed for device %s size=%zu\n", dev_name(hwdev), size); dump_stack();