2002-06-18 02:09:47

by Matthew Harrell

[permalink] [raw]
Subject: 2.5.22 fix for pci_hotplug


--- linux/drivers/hotplug/pci_hotplug_core.c-ori Mon Jun 17 22:01:17 2002
+++ linux/drivers/hotplug/pci_hotplug_core.c Mon Jun 17 22:03:33 2002
@@ -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);
--- linux/drivers/hotplug/pci_hotplug_util.c-ori Mon Jun 17 22:04:58 2002
+++ linux/drivers/hotplug/pci_hotplug_util.c Mon Jun 17 22:05:02 2002
@@ -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);
}



--
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.


2002-06-18 21:56:56

by Greg KH

[permalink] [raw]
Subject: Re: 2.5.22 fix for pci_hotplug

On Mon, Jun 17, 2002 at 10:09:37PM -0400, Matthew Harrell wrote:
>
> --- linux/drivers/hotplug/pci_hotplug_core.c-ori Mon Jun 17 22:01:17 2002
> +++ linux/drivers/hotplug/pci_hotplug_core.c Mon Jun 17 22:03:33 2002
> @@ -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

2002-06-18 23:05:13

by Adrian Bunk

[permalink] [raw]
Subject: Re: 2.5.22 fix for pci_hotplug

On Tue, 18 Jun 2002, Greg KH wrote:

> On Mon, Jun 17, 2002 at 10:09:37PM -0400, Matthew Harrell wrote:
> >
> > --- linux/drivers/hotplug/pci_hotplug_core.c-ori Mon Jun 17 22:01:17 2002
> > +++ linux/drivers/hotplug/pci_hotplug_core.c Mon Jun 17 22:03:33 2002
> > @@ -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?
>...

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 -->

> thanks,
>
> greg k-h

cu
Adrian

--

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



2002-06-19 17:37:40

by Greg KH

[permalink] [raw]
Subject: Re: 2.5.22 fix for pci_hotplug

On Wed, Jun 19, 2002 at 01:04:07AM +0200, Adrian Bunk wrote:
> On Tue, 18 Jun 2002, Greg KH wrote:
>
> > On Mon, Jun 17, 2002 at 10:09:37PM -0400, Matthew Harrell wrote:
> > >
> > > --- linux/drivers/hotplug/pci_hotplug_core.c-ori Mon Jun 17 22:01:17 2002
> > > +++ linux/drivers/hotplug/pci_hotplug_core.c Mon Jun 17 22:03:33 2002
> > > @@ -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?
> >...
>
> 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


diff -Nru a/drivers/hotplug/pci_hotplug_core.c b/drivers/hotplug/pci_hotplug_core.c
--- a/drivers/hotplug/pci_hotplug_core.c Wed Jun 19 10:36:21 2002
+++ b/drivers/hotplug/pci_hotplug_core.c Wed Jun 19 10:36:21 2002
@@ -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)

2002-06-19 21:27:06

by Adrian Bunk

[permalink] [raw]
Subject: Re: 2.5.22 fix for pci_hotplug

On Wed, 19 Jun 2002, Greg KH wrote:

> > 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...


> thanks,
>
> greg k-h
>
> diff -Nru a/drivers/hotplug/pci_hotplug_core.c b/drivers/hotplug/pci_hotplug_core.c
> --- a/drivers/hotplug/pci_hotplug_core.c Wed Jun 19 10:36:21 2002
> +++ b/drivers/hotplug/pci_hotplug_core.c Wed Jun 19 10:36:21 2002
> @@ -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

--

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

2002-06-19 21:45:27

by Greg KH

[permalink] [raw]
Subject: Re: 2.5.22 fix for pci_hotplug

On Wed, Jun 19, 2002 at 11:26:59PM +0200, Adrian Bunk wrote:
> On Wed, 19 Jun 2002, Greg KH wrote:
>
> > > 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...

Here ya go.

greg k-h


diff -Nru a/drivers/hotplug/pci_hotplug_util.c b/drivers/hotplug/pci_hotplug_util.c
--- a/drivers/hotplug/pci_hotplug_util.c Wed Jun 19 14:44:45 2002
+++ b/drivers/hotplug/pci_hotplug_util.c Wed Jun 19 14:44:45 2002
@@ -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)