Skip to contentSkip to conversation

2.5.22 fix for pci_hotplug

PATCH Matthew Harrell 3 participants 6 messages Jun 18, 2002 – Jun 19, 2002

lore
Share & tools
lore
#0 lore raw
drivers/hotplug/pci_hotplug_core.c renamed from drivers/hotplug/pci_hotplug_core.c-ori +11 -11
@@ -183,13 +183,13 @@
 /* default file operations */
 static ssize_t default_read_file (struct file *file, char *buf, size_t count, loff_t *ppos)
 {
-	dbg ("\n");
+	dbg ("%s", "\n");
 	return 0;
 }
 
 static ssize_t default_write_file (struct file *file, const char *buf, size_t count, loff_t *ppos)
 {
-	dbg ("\n");
+	dbg ("%s", "\n");
 	return count;
 }
 
@@ -417,7 +417,7 @@
 	}
 
 	if (!parent) {
-		dbg("Ah! can not find a parent!\n");
+		dbg("%s", "Ah! can not find a parent!\n");
 		return -EINVAL;
 	}
 
@@ -537,7 +537,7 @@
 		return 0;
 
 	if (slot == NULL) {
-		dbg("slot == NULL???\n");
+		dbg("%s", "slot == NULL???\n");
 		return -ENODEV;
 	}
 
@@ -578,7 +578,7 @@
 		return 0;
 
 	if (slot == NULL) {
-		dbg("slot == NULL???\n");
+		dbg("%s", "slot == NULL???\n");
 		return -ENODEV;
 	}
 
@@ -648,7 +648,7 @@
 		return 0;
 
 	if (slot == NULL) {
-		dbg("slot == NULL???\n");
+		dbg("%s", "slot == NULL???\n");
 		return -ENODEV;
 	}
 
@@ -689,7 +689,7 @@
 		return 0;
 
 	if (slot == NULL) {
-		dbg("slot == NULL???\n");
+		dbg("%s", "slot == NULL???\n");
 		return -ENODEV;
 	}
 
@@ -741,7 +741,7 @@
 		return 0;
 
 	if (slot == NULL) {
-		dbg("slot == NULL???\n");
+		dbg("%s", "slot == NULL???\n");
 		return -ENODEV;
 	}
 
@@ -785,7 +785,7 @@
 		return 0;
 
 	if (slot == NULL) {
-		dbg("slot == NULL???\n");
+		dbg("%s", "slot == NULL???\n");
 		return -ENODEV;
 	}
 
@@ -826,7 +826,7 @@
 		return 0;
 
 	if (slot == NULL) {
-		dbg("slot == NULL???\n");
+		dbg("%s", "slot == NULL???\n");
 		return -ENODEV;
 	}
 
@@ -1070,7 +1070,7 @@
 	spin_lock_init(&mount_lock);
 	spin_lock_init(&list_lock);
 
-	dbg("registering filesystem.\n");
+	dbg("%s", "registering filesystem.\n");
 	result = register_filesystem(&pcihpfs_type);
 	if (result) {
 		err("register_filesystem failed with %d\n", result);
drivers/hotplug/pci_hotplug_util.c renamed from drivers/hotplug/pci_hotplug_util.c-ori +6 -6
@@ -103,7 +103,7 @@
 	dbg("%p, %d, %d, %d, %d, %p\n", ops, bus, slot, function, where, value);
 	dev = pci_find_slot(bus, PCI_DEVFN(slot, function));
 	if (dev) {
-		dbg("using native pci_dev\n");
+		dbg("%s", "using native pci_dev\n");
 		return pci_read_config_byte (dev, where, value);
 	}
 	
@@ -137,7 +137,7 @@
 	dbg("%p, %d, %d, %d, %d, %p\n", ops, bus, slot, function, where, value);
 	dev = pci_find_slot(bus, PCI_DEVFN(slot, function));
 	if (dev) {
-		dbg("using native pci_dev\n");
+		dbg("%s", "using native pci_dev\n");
 		return pci_read_config_word (dev, where, value);
 	}
 	
@@ -172,7 +172,7 @@
 	dbg("%p, %d, %d, %d, %d, %p\n", ops, bus, slot, function, where, value);
 	dev = pci_find_slot(bus, PCI_DEVFN(slot, function));
 	if (dev) {
-		dbg("using native pci_dev\n");
+		dbg("%s", "using native pci_dev\n");
 		return pci_read_config_dword (dev, where, value);
 	}
 	
@@ -207,7 +207,7 @@
 	dbg("%p, %d, %d, %d, %d, %d\n", ops, bus, slot, function, where, value);
 	dev = pci_find_slot(bus, PCI_DEVFN(slot, function));
 	if (dev) {
-		dbg("using native pci_dev\n");
+		dbg("%s", "using native pci_dev\n");
 		return pci_write_config_byte (dev, where, value);
 	}
 	
@@ -242,7 +242,7 @@
 	dbg("%p, %d, %d, %d, %d, %d\n", ops, bus, slot, function, where, value);
 	dev = pci_find_slot(bus, PCI_DEVFN(slot, function));
 	if (dev) {
-		dbg("using native pci_dev\n");
+		dbg("%s", "using native pci_dev\n");
 		return pci_write_config_word (dev, where, value);
 	}
 	
@@ -277,7 +277,7 @@
 	dbg("%p, %d, %d, %d, %d, %d\n", ops, bus, slot, function, where, value);
 	dev = pci_find_slot(bus, PCI_DEVFN(slot, function));
 	if (dev) {
-		dbg("using native pci_dev\n");
+		dbg("%s", "using native pci_dev\n");
 		return pci_write_config_dword (dev, where, value);
 	}
 	
Signature · 3 lines
  Matthew Harrell                          There are only 10 types of people in
  Bit Twiddlers, Inc.                       this world: those who understand
  [email protected]                 binary and those who don't.
#1 lore raw

drivers/hotplug/pci_hotplug_core.c line 186

Quoted 9 lines · Matthew Harrell
drivers/hotplug/pci_hotplug_core.c renamed from drivers/hotplug/pci_hotplug_core.c-ori +1 -1
@@ -183,13 +183,13 @@
 /* default file operations */
 static ssize_t default_read_file (struct file *file, char *buf, size_t count, loff_t *ppos)
 {
-	dbg ("\n");
+	dbg ("%s", "\n");

<snip>

What problem does this fix?

If you _really_ want to fix something, remove the the need for pci_announce_to_drivers() in the Compaq and IBM PCI hotplug drivers :)

thanks,

greg k-h

#2 lore raw
Quoted 13 lines · Greg KH
Quoted 9 lines · Matthew Harrell
drivers/hotplug/pci_hotplug_core.c renamed from drivers/hotplug/pci_hotplug_core.c-ori +1 -1
@@ -183,13 +183,13 @@
 /* default file operations */
 static ssize_t default_read_file (struct file *file, char *buf, size_t count, loff_t *ppos)
 {
-	dbg ("\n");
+	dbg ("%s", "\n");

<snip>

Quoted 2 lines

What problem does this fix?
...

He tries to fix the following compile error that is caused by Martin Dalecki's "[PATCH] 2.5.21 kill warnings 4/19" that is included in 2.5.22:

<-- snip -->

...
gcc -Wp,-MD,./.pci_hotplug_core.o.d -D__KERNEL__
-I/home/bunk/linux/kernel-2.5
/linux-2.5.22-full/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=k6 -nostdinc -iwithprefix include
-DKBUILD_BASENAME=pci_hotplug_core -c -o pci_hotplug_core.o pci_hotplug_core.c
pci_hotplug_core.c: In function `default_read_file':
pci_hotplug_core.c:186: parse error before )' pci_hotplug_core.c: In function default_write_file':
pci_hotplug_core.c:192: parse error before )' pci_hotplug_core.c: In function pcihpfs_create_by_name':
pci_hotplug_core.c:420: parse error before )' pci_hotplug_core.c: In function power_read_file':
pci_hotplug_core.c:540: parse error before )' pci_hotplug_core.c: In function power_write_file':
pci_hotplug_core.c:581: parse error before )' pci_hotplug_core.c: In function attention_read_file':
pci_hotplug_core.c:651: parse error before )' pci_hotplug_core.c: In function attention_write_file':
pci_hotplug_core.c:692: parse error before )' pci_hotplug_core.c: In function latch_read_file':
pci_hotplug_core.c:744: parse error before )' pci_hotplug_core.c: In function presence_read_file':
pci_hotplug_core.c:788: parse error before )' pci_hotplug_core.c: In function test_write_file':
pci_hotplug_core.c:829: parse error before )' pci_hotplug_core.c: In function pci_hotplug_init':
pci_hotplug_core.c:1073: parse error before `)'
make[2]: *** [pci_hotplug_core.o] Error 1
make[2]: Leaving directory `/home/bunk/linux/kernel-2.5/linux-2.5.22-full/drivers/hotplug'

<-- snip -->

Quoted 3 lines

thanks,

greg k-h

cu
Adrian

Signature · 3 lines
You only think this is a free country. Like the US the UK spends a lot of
time explaining its a free country because its a police state.
								Alan Cox
#3 lore raw
Quoted 15 lines · Adrian Bunk
Quoted 13 lines · Greg KH
Quoted 9 lines · Matthew Harrell
drivers/hotplug/pci_hotplug_core.c renamed from drivers/hotplug/pci_hotplug_core.c-ori +1 -1
@@ -183,13 +183,13 @@
 /* default file operations */
 static ssize_t default_read_file (struct file *file, char *buf, size_t count, loff_t *ppos)
 {
-	dbg ("\n");
+	dbg ("%s", "\n");

<snip>

Quoted 5 lines
Quoted 2 lines

What problem does this fix?
...

He tries to fix the following compile error that is caused by Martin Dalecki's "[PATCH] 2.5.21 kill warnings 4/19" that is included in 2.5.22:

Yeah, it looks like Martin got it wrong :)

Can you try this patch instead and let me know if it fixes it or not?

thanks,

greg k-h

drivers/hotplug/pci_hotplug_core.c +1 -1
diff -Nru a/drivers/hotplug/pci_hotplug_core.c b/drivers/hotplug/pci_hotplug_core.c
@@ -48,7 +48,7 @@
 	#define MY_NAME	THIS_MODULE->name
 #endif
 
-#define dbg(fmt, arg...) do { if (debug) printk(KERN_DEBUG "%s: %s: " fmt, MY_NAME, __FUNCTION__, ## arg); } while (0)
+#define dbg(fmt, arg...) do { if (debug) printk(KERN_DEBUG "%s: %s: " fmt , MY_NAME , __FUNCTION__ , ## arg); } while (0)
 #define err(format, arg...) printk(KERN_ERR "%s: " format , MY_NAME , ## arg)
 #define info(format, arg...) printk(KERN_INFO "%s: " format , MY_NAME , ## arg)
 #define warn(format, arg...) printk(KERN_WARNING "%s: " format , MY_NAME , ## arg)
#4 lore raw
Quoted 6 lines · Greg KH
Quoted 2 lines

He tries to fix the following compile error that is caused by Martin Dalecki's "[PATCH] 2.5.21 kill warnings 4/19" that is included in 2.5.22:

Yeah, it looks like Martin got it wrong :)

Can you try this patch instead and let me know if it fixes it or not?

Yes, this patch fixes it. A similar patch is needed for pci_hotplug_util.c...

Quoted 8 lines

thanks,

greg k-h

diff -Nru a/drivers/hotplug/pci_hotplug_core.c b/drivers/hotplug/pci_hotplug_core.c

drivers/hotplug/pci_hotplug_core.c line 54

Quoted 8 lines
drivers/hotplug/pci_hotplug_core.c +1 -1
@@ -48,7 +48,7 @@
 	#define MY_NAME	THIS_MODULE->name
 #endif
 
-#define dbg(fmt, arg...) do { if (debug) printk(KERN_DEBUG "%s: %s: " fmt, MY_NAME, __FUNCTION__, ## arg); } while (0)
+#define dbg(fmt, arg...) do { if (debug) printk(KERN_DEBUG "%s: %s: " fmt , MY_NAME , __FUNCTION__ , ## arg); } while (0)
 #define err(format, arg...) printk(KERN_ERR "%s: " format , MY_NAME , ## arg)
 #define info(format, arg...) printk(KERN_INFO "%s: " format , MY_NAME , ## arg)
 #define warn(format, arg...) printk(KERN_WARNING "%s: " format , MY_NAME , ## arg)

cu
Adrian

Signature · 3 lines
You only think this is a free country. Like the US the UK spends a lot of
time explaining its a free country because its a police state.
								Alan Cox
#5 lore raw
Quoted 5 lines · Adrian Bunk
Quoted 3 lines · Greg KH
Quoted 2 lines

He tries to fix the following compile error that is caused by Martin Dalecki's "[PATCH] 2.5.21 kill warnings 4/19" that is included in 2.5.22:

Quoted 7 lines
Quoted 3 lines

Yeah, it looks like Martin got it wrong :)

Can you try this patch instead and let me know if it fixes it or not?

Yes, this patch fixes it. A similar patch is needed for pci_hotplug_util.c...

Here ya go.

greg k-h

drivers/hotplug/pci_hotplug_util.c +1 -1
diff -Nru a/drivers/hotplug/pci_hotplug_util.c b/drivers/hotplug/pci_hotplug_util.c
@@ -41,7 +41,7 @@
 	#define MY_NAME	THIS_MODULE->name
 #endif
 
-#define dbg(fmt, arg...) do { if (debug) printk(KERN_DEBUG "%s: %s: " fmt, MY_NAME, __FUNCTION__, ## arg); } while (0)
+#define dbg(fmt, arg...) do { if (debug) printk(KERN_DEBUG "%s: %s: " fmt , MY_NAME , __FUNCTION__ , ## arg); } while (0)
 #define err(format, arg...) printk(KERN_ERR "%s: " format , MY_NAME , ## arg)
 #define info(format, arg...) printk(KERN_INFO "%s: " format , MY_NAME , ## arg)
 #define warn(format, arg...) printk(KERN_WARNING "%s: " format , MY_NAME , ## arg)