diff mbox series

[v1,1/3] swiotlb: Use %pa to print phys_addr_t variables

Message ID 20200819171326.35931-1-andriy.shevchenko@linux.intel.com
State New
Headers show
Series [v1,1/3] swiotlb: Use %pa to print phys_addr_t variables | expand

Commit Message

Andy Shevchenko Aug. 19, 2020, 5:13 p.m. UTC
There is an extension to a %p to print phys_addr_t type of variables.
Use it here.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 kernel/dma/swiotlb.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

Comments

Fabio Estevam Aug. 19, 2020, 5:24 p.m. UTC | #1
Hi Andy,

On Wed, Aug 19, 2020 at 2:16 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:

> -       unsigned long bytes = io_tlb_nslabs << IO_TLB_SHIFT;
> +       unsigned long mb = (io_tlb_nslabs << IO_TLB_SHIFT) >> 20;

Looks like an unrelated change.
Andy Shevchenko Aug. 19, 2020, 5:39 p.m. UTC | #2
On Wed, Aug 19, 2020 at 02:24:10PM -0300, Fabio Estevam wrote:
> On Wed, Aug 19, 2020 at 2:16 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> 
> > -       unsigned long bytes = io_tlb_nslabs << IO_TLB_SHIFT;
> > +       unsigned long mb = (io_tlb_nslabs << IO_TLB_SHIFT) >> 20;
> 
> Looks like an unrelated change.

To put pr_info() onto one (not so long) line. But of course, can leave it.
diff mbox series

Patch

diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c
index c19379fabd20..676ccf0e49d3 100644
--- a/kernel/dma/swiotlb.c
+++ b/kernel/dma/swiotlb.c
@@ -165,17 +165,14 @@  unsigned long swiotlb_size_or_default(void)
 
 void swiotlb_print_info(void)
 {
-	unsigned long bytes = io_tlb_nslabs << IO_TLB_SHIFT;
+	unsigned long mb = (io_tlb_nslabs << IO_TLB_SHIFT) >> 20;
 
 	if (no_iotlb_memory) {
 		pr_warn("No low mem\n");
 		return;
 	}
 
-	pr_info("mapped [mem %#010llx-%#010llx] (%luMB)\n",
-	       (unsigned long long)io_tlb_start,
-	       (unsigned long long)io_tlb_end,
-	       bytes >> 20);
+	pr_info("mapped [mem %pa-%pa] (%luMB)\n", &io_tlb_start, &io_tlb_end, mb);
 }
 
 /*