Re: [PATCH] PCI fixes for 2.6.0-test3

From: Greg KH
Date: Thu Aug 21 2003 - 12:42:43 EST


ChangeSet 1.1285.1.3, 2003/08/20 16:48:01-07:00, greg@xxxxxxxxx

[PATCH] PCI: add PCI_NAME_SIZE instead of using DEVICE_NAME_SIZE

based on a patch from OGAWA Hirofumi <hirofumi@xxxxxxxxxxxxxxxxxx>


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@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/