All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] Remove unneeded "0x" when %pa formatting is used.
@ 2015-11-24 19:16 Dmitry Krivenok
  2015-11-25 20:19 ` Andy Shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Krivenok @ 2015-11-24 19:16 UTC (permalink / raw)
  To: linux-kernel

Do not use "0x" in front of %pa, %pap and %pad to avoid
duplicate "0x" in the output.

Signed-off-by: Dmitry V. Krivenok <krivenok.dmitry@gmail.com>
---
 drivers/dma/at_hdmac_regs.h   | 2 +-
 drivers/i2c/busses/i2c-st.c   | 2 +-
 drivers/nvdimm/pmem.c         | 2 +-
 drivers/of/fdt.c              | 2 +-
 drivers/pci/host/pcie-iproc.c | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/dma/at_hdmac_regs.h b/drivers/dma/at_hdmac_regs.h
index 7f58f06..0474e4a 100644
--- a/drivers/dma/at_hdmac_regs.h
+++ b/drivers/dma/at_hdmac_regs.h
@@ -385,7 +385,7 @@ static void vdbg_dump_regs(struct at_dma_chan *atchan) {}
 static void atc_dump_lli(struct at_dma_chan *atchan, struct at_lli *lli)
 {
     dev_crit(chan2dev(&atchan->chan_common),
-         "  desc: s%pad d%pad ctrl0x%x:0x%x l0x%pad\n",
+         "  desc: s%pad d%pad ctrl0x%x:0x%x l%pad\n",
          &lli->saddr, &lli->daddr,
          lli->ctrla, lli->ctrlb, &lli->dscr);
 }
diff --git a/drivers/i2c/busses/i2c-st.c b/drivers/i2c/busses/i2c-st.c
index ea72dca..25020ec 100644
--- a/drivers/i2c/busses/i2c-st.c
+++ b/drivers/i2c/busses/i2c-st.c
@@ -822,7 +822,7 @@ static int st_i2c_probe(struct platform_device *pdev)

     adap = &i2c_dev->adap;
     i2c_set_adapdata(adap, i2c_dev);
-    snprintf(adap->name, sizeof(adap->name), "ST I2C(0x%pa)", &res->start);
+    snprintf(adap->name, sizeof(adap->name), "ST I2C(%pa)", &res->start);
     adap->owner = THIS_MODULE;
     adap->timeout = 2 * HZ;
     adap->retries = 0;
diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
index 8ee7989..93396f4 100644
--- a/drivers/nvdimm/pmem.c
+++ b/drivers/nvdimm/pmem.c
@@ -135,7 +135,7 @@ static struct pmem_device *pmem_alloc(struct device *dev,

     if (!devm_request_mem_region(dev, pmem->phys_addr, pmem->size,
             dev_name(dev))) {
-        dev_warn(dev, "could not reserve region [0x%pa:0x%zx]\n",
+        dev_warn(dev, "could not reserve region [%pa:0x%zx]\n",
                 &pmem->phys_addr, pmem->size);
         return ERR_PTR(-EBUSY);
     }
diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index d243029..1bbe3a9 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -1041,7 +1041,7 @@ void __init __weak
early_init_dt_add_memory_arch(u64 base, u64 size)
 int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base,
                     phys_addr_t size, bool nomap)
 {
-    pr_err("Reserved memory not supported, ignoring range 0x%pa - 0x%pa%s\n",
+    pr_err("Reserved memory not supported, ignoring range %pa - %pa%s\n",
           &base, &size, nomap ? " (nomap)" : "");
     return -ENOSYS;
 }
diff --git a/drivers/pci/host/pcie-iproc.c b/drivers/pci/host/pcie-iproc.c
index eac719a..d1ad883 100644
--- a/drivers/pci/host/pcie-iproc.c
+++ b/drivers/pci/host/pcie-iproc.c
@@ -245,7 +245,7 @@ static int iproc_pcie_setup_ob(struct iproc_pcie
*pcie, u64 axi_addr,

     if (size > max_size) {
         dev_err(pcie->dev,
-            "res size 0x%pap exceeds max supported size 0x%llx\n",
+            "res size %pap exceeds max supported size 0x%llx\n",
             &size, max_size);
         return -EINVAL;
     }
-- 
2.6.2

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] Remove unneeded "0x" when %pa formatting is used.
  2015-11-24 19:16 [PATCH 1/1] Remove unneeded "0x" when %pa formatting is used Dmitry Krivenok
@ 2015-11-25 20:19 ` Andy Shevchenko
  2015-11-30 20:33   ` Dmitry Krivenok
  0 siblings, 1 reply; 4+ messages in thread
From: Andy Shevchenko @ 2015-11-25 20:19 UTC (permalink / raw)
  To: Dmitry Krivenok; +Cc: linux-kernel

On Tue, Nov 24, 2015 at 9:16 PM, Dmitry Krivenok
<krivenok.dmitry@gmail.com> wrote:
> Do not use "0x" in front of %pa, %pap and %pad to avoid
> duplicate "0x" in the output.

First of all, please, split per subsystem / driver. Here seems one
file — one patch.
And one comment below.

>
> Signed-off-by: Dmitry V. Krivenok <krivenok.dmitry@gmail.com>
> ---
>  drivers/dma/at_hdmac_regs.h   | 2 +-
>  drivers/i2c/busses/i2c-st.c   | 2 +-
>  drivers/nvdimm/pmem.c         | 2 +-
>  drivers/of/fdt.c              | 2 +-
>  drivers/pci/host/pcie-iproc.c | 2 +-
>  5 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/dma/at_hdmac_regs.h b/drivers/dma/at_hdmac_regs.h
> index 7f58f06..0474e4a 100644
> --- a/drivers/dma/at_hdmac_regs.h
> +++ b/drivers/dma/at_hdmac_regs.h
> @@ -385,7 +385,7 @@ static void vdbg_dump_regs(struct at_dma_chan *atchan) {}
>  static void atc_dump_lli(struct at_dma_chan *atchan, struct at_lli *lli)
>  {
>      dev_crit(chan2dev(&atchan->chan_common),
> -         "  desc: s%pad d%pad ctrl0x%x:0x%x l0x%pad\n",
> +         "  desc: s%pad d%pad ctrl0x%x:0x%x l%pad\n",
>           &lli->saddr, &lli->daddr,
>           lli->ctrla, lli->ctrlb, &lli->dscr);
>  }
> diff --git a/drivers/i2c/busses/i2c-st.c b/drivers/i2c/busses/i2c-st.c
> index ea72dca..25020ec 100644
> --- a/drivers/i2c/busses/i2c-st.c
> +++ b/drivers/i2c/busses/i2c-st.c
> @@ -822,7 +822,7 @@ static int st_i2c_probe(struct platform_device *pdev)
>
>      adap = &i2c_dev->adap;
>      i2c_set_adapdata(adap, i2c_dev);
> -    snprintf(adap->name, sizeof(adap->name), "ST I2C(0x%pa)", &res->start);
> +    snprintf(adap->name, sizeof(adap->name), "ST I2C(%pa)", &res->start);
>      adap->owner = THIS_MODULE;
>      adap->timeout = 2 * HZ;
>      adap->retries = 0;
> diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
> index 8ee7989..93396f4 100644
> --- a/drivers/nvdimm/pmem.c
> +++ b/drivers/nvdimm/pmem.c
> @@ -135,7 +135,7 @@ static struct pmem_device *pmem_alloc(struct device *dev,
>
>      if (!devm_request_mem_region(dev, pmem->phys_addr, pmem->size,
>              dev_name(dev))) {
> -        dev_warn(dev, "could not reserve region [0x%pa:0x%zx]\n",
> +        dev_warn(dev, "could not reserve region [%pa:0x%zx]\n",
>                  &pmem->phys_addr, pmem->size);
>          return ERR_PTR(-EBUSY);
>      }
> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
> index d243029..1bbe3a9 100644
> --- a/drivers/of/fdt.c
> +++ b/drivers/of/fdt.c
> @@ -1041,7 +1041,7 @@ void __init __weak
> early_init_dt_add_memory_arch(u64 base, u64 size)
>  int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base,
>                      phys_addr_t size, bool nomap)
>  {
> -    pr_err("Reserved memory not supported, ignoring range 0x%pa - 0x%pa%s\n",
> +    pr_err("Reserved memory not supported, ignoring range %pa - %pa%s\n",
>            &base, &size, nomap ? " (nomap)" : "");
>      return -ENOSYS;
>  }
> diff --git a/drivers/pci/host/pcie-iproc.c b/drivers/pci/host/pcie-iproc.c
> index eac719a..d1ad883 100644
> --- a/drivers/pci/host/pcie-iproc.c
> +++ b/drivers/pci/host/pcie-iproc.c
> @@ -245,7 +245,7 @@ static int iproc_pcie_setup_ob(struct iproc_pcie
> *pcie, u64 axi_addr,
>
>      if (size > max_size) {
>          dev_err(pcie->dev,
> -            "res size 0x%pap exceeds max supported size 0x%llx\n",
> +            "res size %pap exceeds max supported size 0x%llx\n",

%pa also works.

>              &size, max_size);

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] Remove unneeded "0x" when %pa formatting is used.
  2015-11-25 20:19 ` Andy Shevchenko
@ 2015-11-30 20:33   ` Dmitry Krivenok
  2015-12-13  1:13     ` Andy Shevchenko
  0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Krivenok @ 2015-11-30 20:33 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: linux-kernel

> First of all, please, split per subsystem / driver. Here seems one
> file — one patch.

Sure, will do.

>>      if (size > max_size) {
>>          dev_err(pcie->dev,
>> -            "res size 0x%pap exceeds max supported size 0x%llx\n",
>> +            "res size %pap exceeds max supported size 0x%llx\n",
>
> %pa also works.
>

Yes, but AFAIK %pap and %pa are identical (see address_val() in lib/vsprintf.c),
so I'm not sure I understand your comment.

Did you mean that %pa should be used instead of %pap?
I see that %pa is used much more often than %pap, but I didn't find any
evidence that %pap is deprecated.

Thanks,
Dmitry

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] Remove unneeded "0x" when %pa formatting is used.
  2015-11-30 20:33   ` Dmitry Krivenok
@ 2015-12-13  1:13     ` Andy Shevchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2015-12-13  1:13 UTC (permalink / raw)
  To: Dmitry Krivenok, Rasmus Villemoes; +Cc: linux-kernel

On Mon, Nov 30, 2015 at 10:33 PM, Dmitry Krivenok
<krivenok.dmitry@gmail.com> wrote:
>>>      if (size > max_size) {
>>>          dev_err(pcie->dev,
>>> -            "res size 0x%pap exceeds max supported size 0x%llx\n",
>>> +            "res size %pap exceeds max supported size 0x%llx\n",
>>
>> %pa also works.
>>
>
> Yes, but AFAIK %pap and %pa are identical (see address_val() in lib/vsprintf.c),
> so I'm not sure I understand your comment.
>
> Did you mean that %pa should be used instead of %pap?
> I see that %pa is used much more often than %pap, but I didn't find any
> evidence that %pap is deprecated.

+Rasmus.

No, it's not, but it explicitly for phys_addr_t (it might be nice to
to have %par, for example for explicitly shown that is for
resource_size_t, Rasmus?).

For my opinion for resources better to use %pa for now, though %pap
will work as well.

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-12-13  1:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-24 19:16 [PATCH 1/1] Remove unneeded "0x" when %pa formatting is used Dmitry Krivenok
2015-11-25 20:19 ` Andy Shevchenko
2015-11-30 20:33   ` Dmitry Krivenok
2015-12-13  1:13     ` Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.