lkml.org 
[lkml]   [2008]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] pci: show dma_mask bits in /sys
On Wed, Oct 22, 2008 at 11:48 PM, Grant Grundler
<grundler@parisc-linux.org> wrote:
> On Wed, Oct 22, 2008 at 06:45:10PM -0700, Yinghai Lu wrote:
>> Grant prefer to add it /sys instead of showing in bootlog
>>
>> so could catch if the driver set the correct dma_mask.
>>
>> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
>>
>> ---
>> drivers/pci/pci-sysfs.c | 17 +++++++++++++++++
>> 1 file changed, 17 insertions(+)
>>
>> Index: linux-2.6/drivers/pci/pci-sysfs.c
>> ===================================================================
>> --- linux-2.6.orig/drivers/pci/pci-sysfs.c
>> +++ linux-2.6/drivers/pci/pci-sysfs.c
>> @@ -169,6 +169,21 @@ numa_node_show(struct device *dev, struc
>> #endif
>>
>> static ssize_t
>> +dma_mask_bits_show(struct device *dev, struct device_attribute *attr, char *buf)
>> +{
>> + struct pci_dev *pdev = to_pci_dev(dev);
>> +
>> + return sprintf (buf, "%d\n", fls64(pdev->dma_mask));
>
> Is there any reason to use %d instead of "0x%x" ?
> I'd much rather see this dumped in hex.

that is bits, so it will be 64, 41 instead of 0xfffff

YH


\
 
 \ /
  Last update: 2008-10-23 08:53    [W:0.088 / U:4.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site