lkml.org 
[lkml]   [2003]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
SubjectRe: [PATCH] PCI fixes for 2.6.0-test3
From
Date
ChangeSet 1.1285.1.3, 2003/08/20 16:48:01-07:00, greg@kroah.com

[PATCH] PCI: add PCI_NAME_SIZE instead of using DEVICE_NAME_SIZE

based on a patch from OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>


drivers/pci/names.c | 6 +++---
include/linux/pci.h | 4 +++-
2 files changed, 6 insertions(+), 4 deletions(-)


diff -Nru a/drivers/pci/names.c b/drivers/pci/names.c
--- a/drivers/pci/names.c Thu Aug 21 10:21:23 2003
+++ b/drivers/pci/names.c Thu Aug 21 10:21:23 2003
@@ -80,14 +80,14 @@
}

/* Ok, found the vendor, but unknown device */
- sprintf(name, "PCI device %04x:%04x (%." DEVICE_NAME_HALF "s)",
+ sprintf(name, "PCI device %04x:%04x (%." PCI_NAME_HALF "s)",
dev->vendor, dev->device, vendor_p->name);
return;

/* Full match */
match_device: {
- char *n = name + sprintf(name, "%." DEVICE_NAME_HALF
- "s %." DEVICE_NAME_HALF "s",
+ char *n = name + sprintf(name, "%." PCI_NAME_HALF
+ "s %." PCI_NAME_HALF "s",
vendor_p->name, device_p->name);
int nr = device_p->seen + 1;
device_p->seen = nr;
diff -Nru a/include/linux/pci.h b/include/linux/pci.h
--- a/include/linux/pci.h Thu Aug 21 10:21:23 2003
+++ b/include/linux/pci.h Thu Aug 21 10:21:23 2003
@@ -420,7 +420,9 @@
unsigned int transparent:1; /* Transparent PCI bridge */
unsigned int multifunction:1;/* Part of multi-function device */
#ifdef CONFIG_PCI_NAMES
- char pretty_name[DEVICE_NAME_SIZE]; /* pretty name for users to see */
+#define PCI_NAME_SIZE 50
+#define PCI_NAME_HALF __stringify(20) /* less than half to handle slop */
+ char pretty_name[PCI_NAME_SIZE]; /* pretty name for users to see */
#endif
};

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:47    [W:0.076 / U:1.296 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site