[edk2-devel] [PATCH 5/5] RedfishPkg: Fix compile issue on Linux

Minh Nguyen via groups.io posted 5 patches 2 years, 10 months ago
There is a newer version of this series
[edk2-devel] [PATCH 5/5] RedfishPkg: Fix compile issue on Linux
Posted by Minh Nguyen via groups.io 2 years, 10 months ago
From: Vu Nguyen <vunguyen@os.amperecomputing.com>

It requires a fixed size array to store the content of device path PCD.
Add the array size to solve this issue.

Signed-off-by: Minh Nguyen <minhnguyen@os.amperecomputing.com>
---
 RedfishPkg/Include/Pcd/RestExServiceDevicePath.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/RedfishPkg/Include/Pcd/RestExServiceDevicePath.h b/RedfishPkg/Include/Pcd/RestExServiceDevicePath.h
index 91b1198297c2..57fc199f61f2 100644
--- a/RedfishPkg/Include/Pcd/RestExServiceDevicePath.h
+++ b/RedfishPkg/Include/Pcd/RestExServiceDevicePath.h
@@ -4,6 +4,7 @@
 
   Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
   (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
+  Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
 
     SPDX-License-Identifier: BSD-2-Clause-Patent
 
@@ -14,6 +15,8 @@
 
 #include <Protocol/DevicePath.h>
 
+#define MAX_DEVICE_PATH_NODE      40
+
 typedef enum {
   DEVICE_PATH_MATCH_MAC_NODE = 1,
   DEVICE_PATH_MATCH_PCI_NODE = 2,
@@ -32,7 +35,7 @@ typedef struct {
   //    0x03,0x0b,0x25,0x00,0x00,0x50,0x56,0xc0,0x00,0x02,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
   //    0x7f,0xff,0x04,0x00}
   //
-  EFI_DEVICE_PATH_PROTOCOL    DevicePath[];
+  EFI_DEVICE_PATH_PROTOCOL      DevicePath[MAX_DEVICE_PATH_NODE];
 } REST_EX_SERVICE_DEVICE_PATH_DATA;
 
 #endif
-- 
2.39.0



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#103113): https://edk2.groups.io/g/devel/message/103113
Mute This Topic: https://groups.io/mt/98324151/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Re: [edk2-devel] [PATCH 5/5] RedfishPkg: Fix compile issue on Linux
Posted by Chang, Abner via groups.io 2 years, 10 months ago
[AMD Official Use Only - General]

Reviewed-by: Abner Chang <Abner.Chang@amd.com>

> -----Original Message-----
> From: Minh Nguyen <minhnguyen@os.amperecomputing.com>
> Sent: Friday, April 14, 2023 4:19 PM
> To: devel@edk2.groups.io
> Cc: patches@amperecomputing.com; Chang, Abner
> <Abner.Chang@amd.com>; nicklew@nvidia.com; igork@ami.com;
> nhi@os.amperecomputing.com; tinhnguyen@os.amperecomputing.com; Vu
> Nguyen <vunguyen@os.amperecomputing.com>; Minh Nguyen
> <minhnguyen@os.amperecomputing.com>
> Subject: [PATCH 5/5] RedfishPkg: Fix compile issue on Linux
> 
> Caution: This message originated from an External Source. Use proper
> caution when opening attachments, clicking links, or responding.
> 
> 
> From: Vu Nguyen <vunguyen@os.amperecomputing.com>
> 
> It requires a fixed size array to store the content of device path PCD.
> Add the array size to solve this issue.
> 
> Signed-off-by: Minh Nguyen <minhnguyen@os.amperecomputing.com>
> ---
>  RedfishPkg/Include/Pcd/RestExServiceDevicePath.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/RedfishPkg/Include/Pcd/RestExServiceDevicePath.h
> b/RedfishPkg/Include/Pcd/RestExServiceDevicePath.h
> index 91b1198297c2..57fc199f61f2 100644
> --- a/RedfishPkg/Include/Pcd/RestExServiceDevicePath.h
> +++ b/RedfishPkg/Include/Pcd/RestExServiceDevicePath.h
> @@ -4,6 +4,7 @@
> 
>    Copyright (c) 2019, Intel Corporation. All rights reserved.<BR>
>    (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
> +  Copyright (c) 2023, Ampere Computing LLC. All rights reserved.<BR>
> 
>      SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> @@ -14,6 +15,8 @@
> 
>  #include <Protocol/DevicePath.h>
> 
> +#define MAX_DEVICE_PATH_NODE      40
> +
>  typedef enum {
>    DEVICE_PATH_MATCH_MAC_NODE = 1,
>    DEVICE_PATH_MATCH_PCI_NODE = 2,
> @@ -32,7 +35,7 @@ typedef struct {
>    //
> 0x03,0x0b,0x25,0x00,0x00,0x50,0x56,0xc0,0x00,0x02,0x00,0x00,0x00,0x00,0x0
> 0,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0
> x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,
>    //    0x7f,0xff,0x04,0x00}
>    //
> -  EFI_DEVICE_PATH_PROTOCOL    DevicePath[];
> +  EFI_DEVICE_PATH_PROTOCOL      DevicePath[MAX_DEVICE_PATH_NODE];
>  } REST_EX_SERVICE_DEVICE_PATH_DATA;
> 
>  #endif
> --
> 2.39.0


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#103004): https://edk2.groups.io/g/devel/message/103004
Mute This Topic: https://groups.io/mt/98262914/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-