[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fwts-devel
Subject:    ACK: [PATCH] fwts_devicetree: Add defines for common usage
From:       ivanhu <ivan.hu () canonical ! com>
Date:       2016-09-13 6:47:38
Message-ID: f5e988c2-08c2-2ddf-c42b-b044d9d75d00 () canonical ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On 2016年09月13日 03:11, Deb McLemore wrote:
> Add defines for common usage across FWTS.
>
> Signed-off-by: Deb McLemore <debmc@linux.vnet.ibm.com>
> ---
>   src/lib/include/fwts_devicetree.h | 10 ++++++++++
>   src/lib/src/fwts_devicetree.c     |  4 +---
>   2 files changed, 11 insertions(+), 3 deletions(-)
>
> diff --git a/src/lib/include/fwts_devicetree.h b/src/lib/include/fwts_devicetree.h
> index 7c67dc5..355c0ee 100644
> --- a/src/lib/include/fwts_devicetree.h
> +++ b/src/lib/include/fwts_devicetree.h
> @@ -28,6 +28,16 @@
>   #define FWTS_HAS_DEVICETREE 0
>   #endif
>   
> +#define DT_FS_PATH "/sys/firmware/devicetree/base"
> +#define DT_LINUX_PCI_DEVICES "/sys/bus/pci/devices"
> +#define DT_PROPERTY_OPAL_PCI_SLOT "ibm,slot-label"
> +#define DT_PROPERTY_OPAL_SLOT_LOC "ibm,slot-location-code"
> +#define DT_PROPERTY_OPAL_PART_NUM "part-number"
> +#define DT_PROPERTY_OPAL_SERIAL_NUM "serial-number"
> +#define DT_PROPERTY_OPAL_MANUFACTURER_ID "manufacturer-id"
> +#define DT_PROPERTY_OPAL_STATUS "status"
> +#define DT_PROPERTY_OPAL_VENDOR "vendor"
> +
>   #if FWTS_HAS_DEVICETREE
>   
>   int fwts_devicetree_read(fwts_framework *fwts);
> diff --git a/src/lib/src/fwts_devicetree.c b/src/lib/src/fwts_devicetree.c
> index 5978ab9..94367de 100644
> --- a/src/lib/src/fwts_devicetree.c
> +++ b/src/lib/src/fwts_devicetree.c
> @@ -23,8 +23,6 @@
>   
>   #include "fwts.h"
>   
> -static const char *devicetree_fs_path = "/sys/firmware/devicetree/base";
> -
>   int fwts_devicetree_read(fwts_framework *fwts)
>   {
>   	char *command, *data = NULL;
> @@ -35,7 +33,7 @@ int fwts_devicetree_read(fwts_framework *fwts)
>   	if (!fwts_firmware_has_features(FWTS_FW_FEATURE_DEVICETREE))
>   		return FWTS_OK;
>   
> -	rc = asprintf(&command, "dtc -I fs -O dtb %s", devicetree_fs_path);
> +	rc = asprintf(&command, "dtc -I fs -O dtb %s", DT_FS_PATH);
>   	if (rc < 0)
>   		return FWTS_ERROR;
>   

Acked-by: Ivan Hu <ivan.hu@canonical.com>

[Attachment #5 (text/html)]

<html>
  <head>
    <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p><br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 2016年09月13日 03:11, Deb McLemore
      wrote:<br>
    </div>
    <blockquote
      cite="mid:1473707461-30930-1-git-send-email-debmc@linux.vnet.ibm.com"
      type="cite">
      <pre wrap="">Add defines for common usage across FWTS.

Signed-off-by: Deb McLemore <a class="moz-txt-link-rfc2396E" \
                href="mailto:debmc@linux.vnet.ibm.com">&lt;debmc@linux.vnet.ibm.com&gt;</a>
                
---
 src/lib/include/fwts_devicetree.h | 10 ++++++++++
 src/lib/src/fwts_devicetree.c     |  4 +---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/lib/include/fwts_devicetree.h b/src/lib/include/fwts_devicetree.h
index 7c67dc5..355c0ee 100644
--- a/src/lib/include/fwts_devicetree.h
+++ b/src/lib/include/fwts_devicetree.h
@@ -28,6 +28,16 @@
 #define FWTS_HAS_DEVICETREE 0
 #endif
 
+#define DT_FS_PATH "/sys/firmware/devicetree/base"
+#define DT_LINUX_PCI_DEVICES "/sys/bus/pci/devices"
+#define DT_PROPERTY_OPAL_PCI_SLOT "ibm,slot-label"
+#define DT_PROPERTY_OPAL_SLOT_LOC "ibm,slot-location-code"
+#define DT_PROPERTY_OPAL_PART_NUM "part-number"
+#define DT_PROPERTY_OPAL_SERIAL_NUM "serial-number"
+#define DT_PROPERTY_OPAL_MANUFACTURER_ID "manufacturer-id"
+#define DT_PROPERTY_OPAL_STATUS "status"
+#define DT_PROPERTY_OPAL_VENDOR "vendor"
+
 #if FWTS_HAS_DEVICETREE
 
 int fwts_devicetree_read(fwts_framework *fwts);
diff --git a/src/lib/src/fwts_devicetree.c b/src/lib/src/fwts_devicetree.c
index 5978ab9..94367de 100644
--- a/src/lib/src/fwts_devicetree.c
+++ b/src/lib/src/fwts_devicetree.c
@@ -23,8 +23,6 @@
 
 #include "fwts.h"
 
-static const char *devicetree_fs_path = "/sys/firmware/devicetree/base";
-
 int fwts_devicetree_read(fwts_framework *fwts)
 {
 	char *command, *data = NULL;
@@ -35,7 +33,7 @@ int fwts_devicetree_read(fwts_framework *fwts)
 	if (!fwts_firmware_has_features(FWTS_FW_FEATURE_DEVICETREE))
 		return FWTS_OK;
 
-	rc = asprintf(&amp;command, "dtc -I fs -O dtb %s", devicetree_fs_path);
+	rc = asprintf(&amp;command, "dtc -I fs -O dtb %s", DT_FS_PATH);
 	if (rc &lt; 0)
 		return FWTS_ERROR;
 
</pre>
    </blockquote>
    <br>
    Acked-by: Ivan Hu <a class="moz-txt-link-rfc2396E"
      href="mailto:ivan.hu@canonical.com">&lt;ivan.hu@canonical.com&gt;</a><br>
  </body>
</html>



-- 
fwts-devel mailing list
fwts-devel@lists.ubuntu.com
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/fwts-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic