Patchwork [1/3] PCI: add 0x prefix when printing the BAR registers position in __pci_read_base

login
register
mail settings
Submitter Kevin Hao
Date May 25, 2013, 11:36 a.m.
Message ID <1369481787-21500-2-git-send-email-haokexin@gmail.com>
Download mbox | patch
Permalink /patch/246325/
State Accepted
Headers show

Comments

Kevin Hao - May 25, 2013, 11:36 a.m.
We print the BAR registers position in hexadecimal format, so it
is more readable if 0x prefix is added. Also fix the following
checkpatch warning:
  WARNING: Prefer dev_dbg(... to dev_printk(KERN_DEBUG, ...

Signed-off-by: Kevin Hao <haokexin@gmail.com>
---
v2: A new patch introduced in v2.

 drivers/pci/probe.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Jiang Liu - May 25, 2013, 4:30 p.m.
On 05/25/2013 07:36 PM, Kevin Hao wrote:
> We print the BAR registers position in hexadecimal format, so it
> is more readable if 0x prefix is added. Also fix the following
> checkpatch warning:
>    WARNING: Prefer dev_dbg(... to dev_printk(KERN_DEBUG, ...
>
> Signed-off-by: Kevin Hao <haokexin@gmail.com>
> ---
> v2: A new patch introduced in v2.
>
>   drivers/pci/probe.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> index 70f10fa..2505d5e 100644
> --- a/drivers/pci/probe.c
> +++ b/drivers/pci/probe.c
> @@ -278,9 +278,9 @@ out:
>   		pci_write_config_word(dev, PCI_COMMAND, orig_cmd);
>   
>   	if (bar_too_big)
> -		dev_err(&dev->dev, "reg %x: can't handle 64-bit BAR\n", pos);
> +		dev_err(&dev->dev, "reg 0x%x: can't handle 64-bit BAR\n", pos);
>   	if (res->flags && !bar_disabled)
> -		dev_printk(KERN_DEBUG, &dev->dev, "reg %x: %pR\n", pos, res);
> +		dev_dbg(&dev->dev, "reg 0x%x: %pR\n", pos, res);
Hi Kevin,
     dev_printk(KERN_DEBUG) -> dev_dbg() is not an equivalent change, it 
depends
on CONFIG_DEBUG and CONFIG_DYNAMIC_DEBUG.
Regards!
Gerry

>   
>   	return (res->flags & IORESOURCE_MEM_64) ? 1 : 0;
>   }

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bjorn Helgaas - May 25, 2013, 11:47 p.m.
On Sat, May 25, 2013 at 10:30 AM, Liu Jiang <liuj97@gmail.com> wrote:
> On 05/25/2013 07:36 PM, Kevin Hao wrote:
>>
>> We print the BAR registers position in hexadecimal format, so it
>> is more readable if 0x prefix is added. Also fix the following
>> checkpatch warning:
>>    WARNING: Prefer dev_dbg(... to dev_printk(KERN_DEBUG, ...
>>
>> Signed-off-by: Kevin Hao <haokexin@gmail.com>
>> ---
>> v2: A new patch introduced in v2.
>>
>>   drivers/pci/probe.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
>> index 70f10fa..2505d5e 100644
>> --- a/drivers/pci/probe.c
>> +++ b/drivers/pci/probe.c
>> @@ -278,9 +278,9 @@ out:
>>                 pci_write_config_word(dev, PCI_COMMAND, orig_cmd);
>>         if (bar_too_big)
>> -               dev_err(&dev->dev, "reg %x: can't handle 64-bit BAR\n",
>> pos);
>> +               dev_err(&dev->dev, "reg 0x%x: can't handle 64-bit BAR\n",
>> pos);
>>         if (res->flags && !bar_disabled)
>> -               dev_printk(KERN_DEBUG, &dev->dev, "reg %x: %pR\n", pos,
>> res);
>> +               dev_dbg(&dev->dev, "reg 0x%x: %pR\n", pos, res);
>
> Hi Kevin,
>     dev_printk(KERN_DEBUG) -> dev_dbg() is not an equivalent change, it
> depends
> on CONFIG_DEBUG and CONFIG_DYNAMIC_DEBUG.

I did keep the "dev_printk" here for that reason.  I don't want that
information to be missing from dmesg.

>
>
>>         return (res->flags & IORESOURCE_MEM_64) ? 1 : 0;
>>   }
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kevin Hao - May 26, 2013, 12:16 a.m.
On Sat, May 25, 2013 at 05:47:28PM -0600, Bjorn Helgaas wrote:
> On Sat, May 25, 2013 at 10:30 AM, Liu Jiang <liuj97@gmail.com> wrote:
> > On 05/25/2013 07:36 PM, Kevin Hao wrote:
> >>
> >> We print the BAR registers position in hexadecimal format, so it
> >> is more readable if 0x prefix is added. Also fix the following
> >> checkpatch warning:
> >>    WARNING: Prefer dev_dbg(... to dev_printk(KERN_DEBUG, ...
> >>
> >> Signed-off-by: Kevin Hao <haokexin@gmail.com>
> >> ---
> >> v2: A new patch introduced in v2.
> >>
> >>   drivers/pci/probe.c | 4 ++--
> >>   1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
> >> index 70f10fa..2505d5e 100644
> >> --- a/drivers/pci/probe.c
> >> +++ b/drivers/pci/probe.c
> >> @@ -278,9 +278,9 @@ out:
> >>                 pci_write_config_word(dev, PCI_COMMAND, orig_cmd);
> >>         if (bar_too_big)
> >> -               dev_err(&dev->dev, "reg %x: can't handle 64-bit BAR\n",
> >> pos);
> >> +               dev_err(&dev->dev, "reg 0x%x: can't handle 64-bit BAR\n",
> >> pos);
> >>         if (res->flags && !bar_disabled)
> >> -               dev_printk(KERN_DEBUG, &dev->dev, "reg %x: %pR\n", pos,
> >> res);
> >> +               dev_dbg(&dev->dev, "reg 0x%x: %pR\n", pos, res);
> >
> > Hi Kevin,
> >     dev_printk(KERN_DEBUG) -> dev_dbg() is not an equivalent change, it
> > depends
> > on CONFIG_DEBUG and CONFIG_DYNAMIC_DEBUG.
> 
> I did keep the "dev_printk" here for that reason.  I don't want that
> information to be missing from dmesg.

Obviously I neglected this difference. :-(
Thanks for the reminder and fix Jiang and Bjorn.

Thanks,
Kevin

> 
> >
> >
> >>         return (res->flags & IORESOURCE_MEM_64) ? 1 : 0;
> >>   }
> >
> >

Patch

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index 70f10fa..2505d5e 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -278,9 +278,9 @@  out:
 		pci_write_config_word(dev, PCI_COMMAND, orig_cmd);
 
 	if (bar_too_big)
-		dev_err(&dev->dev, "reg %x: can't handle 64-bit BAR\n", pos);
+		dev_err(&dev->dev, "reg 0x%x: can't handle 64-bit BAR\n", pos);
 	if (res->flags && !bar_disabled)
-		dev_printk(KERN_DEBUG, &dev->dev, "reg %x: %pR\n", pos, res);
+		dev_dbg(&dev->dev, "reg 0x%x: %pR\n", pos, res);
 
 	return (res->flags & IORESOURCE_MEM_64) ? 1 : 0;
 }