diff mbox

[V4] Export ACPI _DSM provided firmware instance number and string name to sysfs

Message ID 20110307200512.GA22450@fedora14-r610.oslab.blr.amer.dell.com
State Not Applicable, archived
Delegated to: David Miller
Headers show

Commit Message

Narendra K March 7, 2011, 7:44 p.m. UTC
On Mon, Mar 07, 2011 at 11:34:05PM +0530, Alexander Beregalov wrote:
> On 4 March 2011 21:43, Jesse Barnes <jbarnes@virtuousgeek.org> wrote:

> > On Wed, 2 Mar 2011 22:34:17 +0530

> > <Narendra_K@Dell.com> wrote:

> >

> >> On Wed, Feb 23, 2011 at 06:06:42PM +0530, K, Narendra wrote:

> >> > Hello,

> >> >

> >> > This patch exports ACPI _DSM provided firmware instance number and

> >> > string name to sysfs.

> >> >

> >> > V1 -> V2:

> >> > The attribute 'index' is changed to 'acpi_index' as the semantics of

> >> > SMBIOS provided device type instance and ACPI _DSM provided firmware

> >> > instance number are different.

> >> >

> >> > V2 -> V3:

> >> > Matthew Garrett pointed out that 'sysfs_create_groups' does return an

> >> > error when there are no ACPI _DSM attributes available and because of

> >> > that the fallback to SMBIOS will not happen. As a result SMBIOS provided

> >> > attributes are not created. This version of the patch addresses the issue.

> >> >

> >>

> >> V3 -> V4:

> >> Select NLS if (DMI || ACPI) in drivers/pci/Kconfig to prevent build

> >> breakage from an 'allmodconfig'

> >

> > Applied, fingers crossed this time. :)

> >

> 

> Hi,

> 

> It cannot be compiled if CONFIG_ACPI is not set.

> 

> drivers/pci/pci-label.c: In function 'pci_create_firmware_label_files':

> drivers/pci/pci-label.c:366:2: error: implicit declaration of function

> 'device_has_dsm'


Hello,

Sorry for the inconvenience. Please find the fix here -

From: Narendra K <narendra_k@dell.com>

Subject: [PATCH] Fix compilation error when CONFIG_ACPI unset

This patch fixes compilation error descibed below introduced by
the commit 6058989bad05b82e78baacce69ec14f27a11b5fd

drivers/pci/pci-label.c: In function ‘pci_create_firmware_label_files’:
drivers/pci/pci-label.c:366:2: error: implicit declaration of function ‘device_has_dsm’

Signed-off-by: Narendra K <narendra_k@dell.com>

---
 drivers/pci/pci-label.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

-- 
1.7.3.1

With regards,
Narendra K

Comments

Greg KH March 7, 2011, 7:56 p.m. UTC | #1
On Mon, Mar 07, 2011 at 11:44:52AM -0800, Narendra_K@Dell.com wrote:
> --- a/drivers/pci/pci-label.c
> +++ b/drivers/pci/pci-label.c
> @@ -29,7 +29,9 @@
>  #include <linux/nls.h>
>  #include <linux/acpi.h>
>  #include <linux/pci-acpi.h>
> +#ifdef CONFIG_ACPI
>  #include <acpi/acpi_drivers.h>
> +#endif

You should never need a #ifdef in a .c file for an include file.  If so,
something is really wrong.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jordan_Hargrave@Dell.com March 10, 2011, 12:35 a.m. UTC | #2
That happens though for CONFIG_XXXX, though usually the include file is further down in the #ifdef region.


--jordan hargrave
Dell Enterprise Linux Engineering

-----Original Message-----
From: Greg KH [mailto:greg@kroah.com] 
Sent: Monday, March 07, 2011 1:56 PM
To: K, Narendra
Cc: a.beregalov@gmail.com; linux-next@vger.kernel.org; jbarnes@virtuousgeek.org; linux-pci@vger.kernel.org; linux-hotplug@vger.kernel.org; netdev@vger.kernel.org; mjg@redhat.com; Domsch, Matt; Rose, Charles; Hargrave, Jordan; Iyer, Shyam; sfr@canb.auug.org.au
Subject: Re: [PATCH V4] Export ACPI _DSM provided firmware instance number and string name to sysfs

On Mon, Mar 07, 2011 at 11:44:52AM -0800, Narendra_K@Dell.com wrote:
> --- a/drivers/pci/pci-label.c
> +++ b/drivers/pci/pci-label.c
> @@ -29,7 +29,9 @@
>  #include <linux/nls.h>
>  #include <linux/acpi.h>
>  #include <linux/pci-acpi.h>
> +#ifdef CONFIG_ACPI
>  #include <acpi/acpi_drivers.h>
> +#endif

You should never need a #ifdef in a .c file for an include file.  If so,
something is really wrong.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Jesse Barnes March 16, 2011, 5:41 p.m. UTC | #3
On Fri, 11 Mar 2011 03:35:56 +0530
<Shyam_Iyer@Dell.com> wrote:

> 
> > -----Original Message-----
> > From: K, Narendra
> > Sent: Monday, March 07, 2011 3:56 PM
> > To: Greg KH
> > Cc: a.beregalov@gmail.com; linux-next@vger.kernel.org;
> > jbarnes@virtuousgeek.org; linux-pci@vger.kernel.org; linux-
> > hotplug@vger.kernel.org; netdev@vger.kernel.org; mjg@redhat.com;
> > Domsch, Matt; Rose, Charles; Hargrave, Jordan; Iyer, Shyam;
> > sfr@canb.auug.org.au
> > Subject: Re: [PATCH V4] Export ACPI _DSM provided firmware instance
> > number and string name to sysfs
> > 
> > On Tue, Mar 08, 2011 at 01:26:16AM +0530, Greg KH wrote:
> > > On Mon, Mar 07, 2011 at 11:44:52AM -0800, Narendra_K@Dell.com wrote:
> > > > --- a/drivers/pci/pci-label.c
> > > > +++ b/drivers/pci/pci-label.c
> > > > @@ -29,7 +29,9 @@
> > > >  #include <linux/nls.h>
> > > >  #include <linux/acpi.h>
> > > >  #include <linux/pci-acpi.h>
> > > > +#ifdef CONFIG_ACPI
> > > >  #include <acpi/acpi_drivers.h>
> > > > +#endif
> > >
> > > You should never need a #ifdef in a .c file for an include file.  If
> > so,
> > > something is really wrong.
> > 
> > I agree. Also, i realized that the include was not required to address
> > the
> > reported error. Please find the revised patch here.
> > 
> > From: Narendra K <narendra_k@dell.com>
> > Subject: [PATCH] Fix compilation error when CONFIG_ACPI is unset
> > 
> > This patch fixes compilation error descibed below introduced by
> > the commit 6058989bad05b82e78baacce69ec14f27a11b5fd
> > 
> > drivers/pci/pci-label.c: In function ‘pci_create_firmware_label_files’:
> > drivers/pci/pci-label.c:366:2: error: implicit declaration of function
> > ‘device_has_dsm’
> > 
> > Signed-off-by: Narendra K <narendra_k@dell.com>
> > ---
> >  drivers/pci/pci-label.c |    6 ++++++
> >  1 files changed, 6 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/pci/pci-label.c b/drivers/pci/pci-label.c
> > index 824e247..8c80138 100644
> > --- a/drivers/pci/pci-label.c
> > +++ b/drivers/pci/pci-label.c
> > @@ -174,6 +174,12 @@ pci_remove_acpi_index_label_files(struct pci_dev
> > *pdev)
> >  	return -1;
> >  }
> > 
> > +static inline bool
> > +device_has_dsm(struct device *dev)
> > +{
> > +	return false;
> > +}
> > +
> >  #else
> > 
> >  static const char device_label_dsm_uuid[] = {
> > --
> > 1.7.3.1
> > 
> > With regards,
> > Narendra K
> 
> So this works and fixes the additional build failure.
> 
> I tested with CONFIG_ACPI set/unset and with "make allmodconfig"
> 
> Additionally I found that including acpi/apci_drivers.h is not necessary and introduces these warnings..
> 
> The below patch fixes the additional warnigs..
> 
> In file included from drivers/pci/pci-label.c:32:
> include/acpi/acpi_drivers.h:103: warning: ‘struct acpi_device’ declared inside parameter list
> include/acpi/acpi_drivers.h:103: warning: its scope is only this definition or declaration, which is probably not what you want
> include/acpi/acpi_drivers.h:107: warning: ‘struct acpi_pci_root’ declared inside parameter list
> 
> Signed-off-by: Shyam Iyer <shyam_iyer@dell.com>

Ok, I've applied these two fixes, thanks guys.  I hope that's the last
of the issues we'll see with this patch!
diff mbox

Patch

diff --git a/drivers/pci/pci-label.c b/drivers/pci/pci-label.c
index 824e247..82fd73d 100644
--- a/drivers/pci/pci-label.c
+++ b/drivers/pci/pci-label.c
@@ -29,7 +29,9 @@ 
 #include <linux/nls.h>
 #include <linux/acpi.h>
 #include <linux/pci-acpi.h>
+#ifdef CONFIG_ACPI
 #include <acpi/acpi_drivers.h>
+#endif
 #include <acpi/acpi_bus.h>
 #include "pci.h"
 
@@ -174,6 +176,12 @@  pci_remove_acpi_index_label_files(struct pci_dev *pdev)
 	return -1;
 }
 
+static inline bool
+device_has_dsm(struct device *dev)
+{
+	return false;
+}
+
 #else
 
 static const char device_label_dsm_uuid[] = {