[22/27] opal: reserv_mem: add in missing const to fix build warnings
diff mbox series

Message ID 20180815131129.24146-23-colin.king@canonical.com
State Accepted
Headers show
Series
  • [01/27] lib: fwts_framework: ensure src pointer is const
Related show

Commit Message

Colin Ian King Aug. 15, 2018, 1:11 p.m. UTC
From: Colin Ian King <colin.king@canonical.com>

Add in missing const, cleans up warnings.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/opal/reserv_mem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Alex Hung Aug. 15, 2018, 6:11 p.m. UTC | #1
On 2018-08-15 06:11 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Add in missing const, cleans up warnings.
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/opal/reserv_mem.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/opal/reserv_mem.c b/src/opal/reserv_mem.c
> index 4683f73c..b42b959b 100644
> --- a/src/opal/reserv_mem.c
> +++ b/src/opal/reserv_mem.c
> @@ -125,7 +125,7 @@ static int reserv_mem_init(fwts_framework *fw)
>   static int reserv_mem_limits_test(fwts_framework *fw)
>   {
>   	bool ok = true;
> -	char *region_names;
> +	const char *region_names;
>   	const uint64_t *ranges;
>   	reserve_region_t *regions;
>   	int  offset, len, nr_regions, rc, j;
> @@ -145,7 +145,7 @@ static int reserv_mem_limits_test(fwts_framework *fw)
>   				"reserved-names");
>   
>   	/* Check for the reservd-names property */
> -	region_names = (char *)fdt_getprop(fw->fdt, offset,
> +	region_names = (const char *)fdt_getprop(fw->fdt, offset,
>   					"reserved-names", &len);
>   	if (!region_names) {
>   		fwts_failed(fw, LOG_LEVEL_MEDIUM, "DTPropertyMissing",
> 



Acked-by: Alex Hung <alex.hung@canonical.com>
Ivan Hu Aug. 16, 2018, 9:19 a.m. UTC | #2
On 08/15/2018 09:11 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Add in missing const, cleans up warnings.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/opal/reserv_mem.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/opal/reserv_mem.c b/src/opal/reserv_mem.c
> index 4683f73c..b42b959b 100644
> --- a/src/opal/reserv_mem.c
> +++ b/src/opal/reserv_mem.c
> @@ -125,7 +125,7 @@ static int reserv_mem_init(fwts_framework *fw)
>  static int reserv_mem_limits_test(fwts_framework *fw)
>  {
>  	bool ok = true;
> -	char *region_names;
> +	const char *region_names;
>  	const uint64_t *ranges;
>  	reserve_region_t *regions;
>  	int  offset, len, nr_regions, rc, j;
> @@ -145,7 +145,7 @@ static int reserv_mem_limits_test(fwts_framework *fw)
>  				"reserved-names");
>  
>  	/* Check for the reservd-names property */
> -	region_names = (char *)fdt_getprop(fw->fdt, offset,
> +	region_names = (const char *)fdt_getprop(fw->fdt, offset,
>  					"reserved-names", &len);
>  	if (!region_names) {
>  		fwts_failed(fw, LOG_LEVEL_MEDIUM, "DTPropertyMissing",

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

Patch
diff mbox series

diff --git a/src/opal/reserv_mem.c b/src/opal/reserv_mem.c
index 4683f73c..b42b959b 100644
--- a/src/opal/reserv_mem.c
+++ b/src/opal/reserv_mem.c
@@ -125,7 +125,7 @@  static int reserv_mem_init(fwts_framework *fw)
 static int reserv_mem_limits_test(fwts_framework *fw)
 {
 	bool ok = true;
-	char *region_names;
+	const char *region_names;
 	const uint64_t *ranges;
 	reserve_region_t *regions;
 	int  offset, len, nr_regions, rc, j;
@@ -145,7 +145,7 @@  static int reserv_mem_limits_test(fwts_framework *fw)
 				"reserved-names");
 
 	/* Check for the reservd-names property */
-	region_names = (char *)fdt_getprop(fw->fdt, offset,
+	region_names = (const char *)fdt_getprop(fw->fdt, offset,
 					"reserved-names", &len);
 	if (!region_names) {
 		fwts_failed(fw, LOG_LEVEL_MEDIUM, "DTPropertyMissing",