linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] PCI: sysfs: Staticize local symbols
@ 2013-09-28 10:12 Sachin Kamat
  2013-09-28 10:12 ` [PATCH 2/2] PCI: driver: Staticize pci_dev_pm_ops Sachin Kamat
  2013-10-04 18:09 ` [PATCH 1/2] PCI: sysfs: Staticize local symbols Bjorn Helgaas
  0 siblings, 2 replies; 8+ messages in thread
From: Sachin Kamat @ 2013-09-28 10:12 UTC (permalink / raw)
  To: linux-pci; +Cc: bhelgaas, sachin.kamat

Local variables used only in this file are made static.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/pci/pci-sysfs.c |   14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index d8eb880..ec1dbea 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -304,7 +304,7 @@ static ssize_t bus_rescan_store(struct bus_type *bus, const char *buf,
 }
 static BUS_ATTR(rescan, (S_IWUSR|S_IWGRP), NULL, bus_rescan_store);
 
-struct attribute *pci_bus_attrs[] = {
+static struct attribute *pci_bus_attrs[] = {
 	&bus_attr_rescan.attr,
 	NULL,
 };
@@ -335,8 +335,9 @@ dev_rescan_store(struct device *dev, struct device_attribute *attr,
 	}
 	return count;
 }
-struct device_attribute dev_rescan_attr = __ATTR(rescan, (S_IWUSR|S_IWGRP),
-						 NULL, dev_rescan_store);
+static struct device_attribute dev_rescan_attr = __ATTR(rescan,
+							(S_IWUSR|S_IWGRP),
+							NULL, dev_rescan_store);
 
 static void remove_callback(struct device *dev)
 {
@@ -366,8 +367,9 @@ remove_store(struct device *dev, struct device_attribute *dummy,
 		count = ret;
 	return count;
 }
-struct device_attribute dev_remove_attr = __ATTR(remove, (S_IWUSR|S_IWGRP),
-						 NULL, remove_store);
+static struct device_attribute dev_remove_attr = __ATTR(remove,
+							(S_IWUSR|S_IWGRP),
+							NULL, remove_store);
 
 static ssize_t
 dev_bus_rescan_store(struct device *dev, struct device_attribute *attr,
@@ -554,7 +556,7 @@ boot_vga_show(struct device *dev, struct device_attribute *attr, char *buf)
 		!!(pdev->resource[PCI_ROM_RESOURCE].flags &
 		   IORESOURCE_ROM_SHADOW));
 }
-struct device_attribute vga_attr = __ATTR_RO(boot_vga);
+static struct device_attribute vga_attr = __ATTR_RO(boot_vga);
 
 static ssize_t
 pci_read_config(struct file *filp, struct kobject *kobj,
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/2] PCI: driver: Staticize pci_dev_pm_ops
  2013-09-28 10:12 [PATCH 1/2] PCI: sysfs: Staticize local symbols Sachin Kamat
@ 2013-09-28 10:12 ` Sachin Kamat
  2013-10-04 18:09   ` Bjorn Helgaas
  2013-10-04 18:09 ` [PATCH 1/2] PCI: sysfs: Staticize local symbols Bjorn Helgaas
  1 sibling, 1 reply; 8+ messages in thread
From: Sachin Kamat @ 2013-09-28 10:12 UTC (permalink / raw)
  To: linux-pci; +Cc: bhelgaas, sachin.kamat

'pci_dev_pm_ops' is local to this file. Make it static.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
---
 drivers/pci/pci-driver.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
index 38f3c01..653c8c5 100644
--- a/drivers/pci/pci-driver.c
+++ b/drivers/pci/pci-driver.c
@@ -1124,7 +1124,7 @@ static int pci_pm_runtime_idle(struct device *dev)
 
 #ifdef CONFIG_PM
 
-const struct dev_pm_ops pci_dev_pm_ops = {
+static const struct dev_pm_ops pci_dev_pm_ops = {
 	.prepare = pci_pm_prepare,
 	.complete = pci_pm_complete,
 	.suspend = pci_pm_suspend,
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] PCI: sysfs: Staticize local symbols
  2013-09-28 10:12 [PATCH 1/2] PCI: sysfs: Staticize local symbols Sachin Kamat
  2013-09-28 10:12 ` [PATCH 2/2] PCI: driver: Staticize pci_dev_pm_ops Sachin Kamat
@ 2013-10-04 18:09 ` Bjorn Helgaas
  2013-10-07  3:55   ` Sachin Kamat
  1 sibling, 1 reply; 8+ messages in thread
From: Bjorn Helgaas @ 2013-10-04 18:09 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: linux-pci@vger.kernel.org

On Sat, Sep 28, 2013 at 4:12 AM, Sachin Kamat <sachin.kamat@linaro.org> wrote:
> Local variables used only in this file are made static.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
> ---
>  drivers/pci/pci-sysfs.c |   14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
> index d8eb880..ec1dbea 100644
> --- a/drivers/pci/pci-sysfs.c
> +++ b/drivers/pci/pci-sysfs.c
> @@ -304,7 +304,7 @@ static ssize_t bus_rescan_store(struct bus_type *bus, const char *buf,
>  }
>  static BUS_ATTR(rescan, (S_IWUSR|S_IWGRP), NULL, bus_rescan_store);
>
> -struct attribute *pci_bus_attrs[] = {
> +static struct attribute *pci_bus_attrs[] = {

Did you compile this?  I see this:

drivers/pci/pci-sysfs.c:306:29: error: static declaration of
‘pci_bus_attrs’ follows non-static declaration
drivers/pci/pci.h:159:29: note: previous declaration of ‘pci_bus_attrs’ was here

and there is a use in drivers/pci/pci-driver.c.

I applied this (without the pci_bus_attrs hunk) to my pci/misc branch, thanks!

Bjorn

>         &bus_attr_rescan.attr,
>         NULL,
>  };
> @@ -335,8 +335,9 @@ dev_rescan_store(struct device *dev, struct device_attribute *attr,
>         }
>         return count;
>  }
> -struct device_attribute dev_rescan_attr = __ATTR(rescan, (S_IWUSR|S_IWGRP),
> -                                                NULL, dev_rescan_store);
> +static struct device_attribute dev_rescan_attr = __ATTR(rescan,
> +                                                       (S_IWUSR|S_IWGRP),
> +                                                       NULL, dev_rescan_store);
>
>  static void remove_callback(struct device *dev)
>  {
> @@ -366,8 +367,9 @@ remove_store(struct device *dev, struct device_attribute *dummy,
>                 count = ret;
>         return count;
>  }
> -struct device_attribute dev_remove_attr = __ATTR(remove, (S_IWUSR|S_IWGRP),
> -                                                NULL, remove_store);
> +static struct device_attribute dev_remove_attr = __ATTR(remove,
> +                                                       (S_IWUSR|S_IWGRP),
> +                                                       NULL, remove_store);
>
>  static ssize_t
>  dev_bus_rescan_store(struct device *dev, struct device_attribute *attr,
> @@ -554,7 +556,7 @@ boot_vga_show(struct device *dev, struct device_attribute *attr, char *buf)
>                 !!(pdev->resource[PCI_ROM_RESOURCE].flags &
>                    IORESOURCE_ROM_SHADOW));
>  }
> -struct device_attribute vga_attr = __ATTR_RO(boot_vga);
> +static struct device_attribute vga_attr = __ATTR_RO(boot_vga);
>
>  static ssize_t
>  pci_read_config(struct file *filp, struct kobject *kobj,
> --
> 1.7.9.5
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] PCI: driver: Staticize pci_dev_pm_ops
  2013-09-28 10:12 ` [PATCH 2/2] PCI: driver: Staticize pci_dev_pm_ops Sachin Kamat
@ 2013-10-04 18:09   ` Bjorn Helgaas
  2013-10-09  3:00     ` Sachin Kamat
  0 siblings, 1 reply; 8+ messages in thread
From: Bjorn Helgaas @ 2013-10-04 18:09 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: linux-pci@vger.kernel.org

On Sat, Sep 28, 2013 at 4:12 AM, Sachin Kamat <sachin.kamat@linaro.org> wrote:
> 'pci_dev_pm_ops' is local to this file. Make it static.
>
> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>

Applied to pci/misc, thanks!

Bjorn

> ---
>  drivers/pci/pci-driver.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
> index 38f3c01..653c8c5 100644
> --- a/drivers/pci/pci-driver.c
> +++ b/drivers/pci/pci-driver.c
> @@ -1124,7 +1124,7 @@ static int pci_pm_runtime_idle(struct device *dev)
>
>  #ifdef CONFIG_PM
>
> -const struct dev_pm_ops pci_dev_pm_ops = {
> +static const struct dev_pm_ops pci_dev_pm_ops = {
>         .prepare = pci_pm_prepare,
>         .complete = pci_pm_complete,
>         .suspend = pci_pm_suspend,
> --
> 1.7.9.5
>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] PCI: sysfs: Staticize local symbols
  2013-10-04 18:09 ` [PATCH 1/2] PCI: sysfs: Staticize local symbols Bjorn Helgaas
@ 2013-10-07  3:55   ` Sachin Kamat
  2013-10-07 17:40     ` Bjorn Helgaas
  0 siblings, 1 reply; 8+ messages in thread
From: Sachin Kamat @ 2013-10-07  3:55 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-pci@vger.kernel.org

On 4 October 2013 23:39, Bjorn Helgaas <bhelgaas@google.com> wrote:
> On Sat, Sep 28, 2013 at 4:12 AM, Sachin Kamat <sachin.kamat@linaro.org> wrote:
>>
>> -struct attribute *pci_bus_attrs[] = {
>> +static struct attribute *pci_bus_attrs[] = {
>
> Did you compile this?  I see this:
>
> drivers/pci/pci-sysfs.c:306:29: error: static declaration of
> ‘pci_bus_attrs’ follows non-static declaration
> drivers/pci/pci.h:159:29: note: previous declaration of ‘pci_bus_attrs’ was here

Hmm.. strange. I did compile both these patches and did not see this
error on my setup.
Infact it was during compilation that I came across the need for this
change and verified it after. However I used
the linux-next tree and not your tree to generate these.

>
> and there is a use in drivers/pci/pci-driver.c.
>
> I applied this (without the pci_bus_attrs hunk) to my pci/misc branch, thanks!

Thanks for taking care of this and sorry for the trouble. I will check
this once again on my setup.

With warm regards,
Sachin

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] PCI: sysfs: Staticize local symbols
  2013-10-07  3:55   ` Sachin Kamat
@ 2013-10-07 17:40     ` Bjorn Helgaas
  2013-10-07 21:17       ` Bjorn Helgaas
  0 siblings, 1 reply; 8+ messages in thread
From: Bjorn Helgaas @ 2013-10-07 17:40 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: linux-pci@vger.kernel.org

On Sun, Oct 6, 2013 at 9:55 PM, Sachin Kamat <sachin.kamat@linaro.org> wrote:
> On 4 October 2013 23:39, Bjorn Helgaas <bhelgaas@google.com> wrote:
>> On Sat, Sep 28, 2013 at 4:12 AM, Sachin Kamat <sachin.kamat@linaro.org> wrote:
>>>
>>> -struct attribute *pci_bus_attrs[] = {
>>> +static struct attribute *pci_bus_attrs[] = {
>>
>> Did you compile this?  I see this:
>>
>> drivers/pci/pci-sysfs.c:306:29: error: static declaration of
>> ‘pci_bus_attrs’ follows non-static declaration
>> drivers/pci/pci.h:159:29: note: previous declaration of ‘pci_bus_attrs’ was here
>
> Hmm.. strange. I did compile both these patches and did not see this
> error on my setup.
> Infact it was during compilation that I came across the need for this
> change and verified it after. However I used
> the linux-next tree and not your tree to generate these.

Oh, I see what happened.  Greg's 244afeca ("PCI: convert bus code to
use bus_groups") removed the use of pci_bus_attrs[] in pci-driver.c.
That commit is in linux-next, but not in my tree.  I probably should
have merged that commit via my tree to avoid confusion like this.  Oh,
well, maybe I'll do better next time.

Bjorn

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/2] PCI: sysfs: Staticize local symbols
  2013-10-07 17:40     ` Bjorn Helgaas
@ 2013-10-07 21:17       ` Bjorn Helgaas
  0 siblings, 0 replies; 8+ messages in thread
From: Bjorn Helgaas @ 2013-10-07 21:17 UTC (permalink / raw)
  To: Sachin Kamat; +Cc: linux-pci@vger.kernel.org, Greg Kroah-Hartman

[+cc Greg]

On Mon, Oct 7, 2013 at 11:40 AM, Bjorn Helgaas <bhelgaas@google.com> wrote:
> On Sun, Oct 6, 2013 at 9:55 PM, Sachin Kamat <sachin.kamat@linaro.org> wrote:
>> On 4 October 2013 23:39, Bjorn Helgaas <bhelgaas@google.com> wrote:
>>> On Sat, Sep 28, 2013 at 4:12 AM, Sachin Kamat <sachin.kamat@linaro.org> wrote:
>>>>
>>>> -struct attribute *pci_bus_attrs[] = {
>>>> +static struct attribute *pci_bus_attrs[] = {
>>>
>>> Did you compile this?  I see this:
>>>
>>> drivers/pci/pci-sysfs.c:306:29: error: static declaration of
>>> ‘pci_bus_attrs’ follows non-static declaration
>>> drivers/pci/pci.h:159:29: note: previous declaration of ‘pci_bus_attrs’ was here
>>
>> Hmm.. strange. I did compile both these patches and did not see this
>> error on my setup.
>> Infact it was during compilation that I came across the need for this
>> change and verified it after. However I used
>> the linux-next tree and not your tree to generate these.
>
> Oh, I see what happened.  Greg's 244afeca ("PCI: convert bus code to
> use bus_groups") removed the use of pci_bus_attrs[] in pci-driver.c.
> That commit is in linux-next, but not in my tree.  I probably should
> have merged that commit via my tree to avoid confusion like this.  Oh,
> well, maybe I'll do better next time.

OK, I cherry-picked Greg's changes, then applied your original patch on top:

16373b2 PCI: Make pci_bus_attrs, dev_rescan_attr, dev_remove_attr,
vga_attr static
5136b2d PCI: convert bus code to use dev_groups
2229c1f PCI: convert bus code to use drv_groups
0f49ba5 PCI: convert bus code to use bus_groups

These are all in my pci/gregkh-driver-core branch, which will go in
v3.13.  Thanks!

Bjorn

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/2] PCI: driver: Staticize pci_dev_pm_ops
  2013-10-04 18:09   ` Bjorn Helgaas
@ 2013-10-09  3:00     ` Sachin Kamat
  0 siblings, 0 replies; 8+ messages in thread
From: Sachin Kamat @ 2013-10-09  3:00 UTC (permalink / raw)
  To: Bjorn Helgaas; +Cc: linux-pci@vger.kernel.org

On 4 October 2013 23:39, Bjorn Helgaas <bhelgaas@google.com> wrote:
> On Sat, Sep 28, 2013 at 4:12 AM, Sachin Kamat <sachin.kamat@linaro.org> wrote:
>> 'pci_dev_pm_ops' is local to this file. Make it static.
>>
>> Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
>
> Applied to pci/misc, thanks!

Looks like this branch hasn't been pushed out yet.

-- 
With warm regards,
Sachin

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-10-09  3:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-28 10:12 [PATCH 1/2] PCI: sysfs: Staticize local symbols Sachin Kamat
2013-09-28 10:12 ` [PATCH 2/2] PCI: driver: Staticize pci_dev_pm_ops Sachin Kamat
2013-10-04 18:09   ` Bjorn Helgaas
2013-10-09  3:00     ` Sachin Kamat
2013-10-04 18:09 ` [PATCH 1/2] PCI: sysfs: Staticize local symbols Bjorn Helgaas
2013-10-07  3:55   ` Sachin Kamat
2013-10-07 17:40     ` Bjorn Helgaas
2013-10-07 21:17       ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).