lib: fwts_devicetree: constify a few function arguments

Message ID 20170908094018.9553-1-colin.king@canonical.com
State New
Headers show
Series
  • lib: fwts_devicetree: constify a few function arguments
Related show

Commit Message

Colin King Sept. 8, 2017, 9:40 a.m.
From: Colin Ian King <colin.king@canonical.com>

Code cleanup, constify some function arguments

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

Comments

Alex Hung Sept. 11, 2017, 4:51 p.m. | #1
On 2017-09-08 02:40 AM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> Code cleanup, constify some function arguments
> 
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/lib/src/fwts_devicetree.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/lib/src/fwts_devicetree.c b/src/lib/src/fwts_devicetree.c
> index 2fea3c8a..9db63de6 100644
> --- a/src/lib/src/fwts_devicetree.c
> +++ b/src/lib/src/fwts_devicetree.c
> @@ -182,7 +182,7 @@ char *hidewhitespace(char *name)
>   
>   int fwts_dt_property_read_u32(
>   	void *fdt,
> -	int offset,
> +	const int offset,
>   	const char *pname,
>   	int *value)
>   {
> @@ -207,7 +207,7 @@ int fwts_dt_property_read_u32(
>   
>   int fwts_dt_property_read_u32_arr(
>   	void *fdt,
> -	int offset,
> +	const int offset,
>   	const char *pname,
>   	int *value,
>   	int *len)
> @@ -236,7 +236,7 @@ int fwts_dt_property_read_u32_arr(
>   
>   int fwts_dt_property_read_u64_arr(
>   	void *fdt,
> -	int offset,
> +	const int offset,
>   	const char *pname,
>   	uint64_t *value,
>   	int *len)
> @@ -261,7 +261,7 @@ int fwts_dt_property_read_u64_arr(
>   int fwts_dt_stringlist_count(
>   	fwts_framework *fw,
>   	const void *fdt,
> -	int nodeoffset,
> +	const int nodeoffset,
>   	const char *property)
>   {
>   	const char *list, *end;
> 


Acked-by: Alex Hung <alex.hung@canonical.com>

Patch

diff --git a/src/lib/src/fwts_devicetree.c b/src/lib/src/fwts_devicetree.c
index 2fea3c8a..9db63de6 100644
--- a/src/lib/src/fwts_devicetree.c
+++ b/src/lib/src/fwts_devicetree.c
@@ -182,7 +182,7 @@  char *hidewhitespace(char *name)
 
 int fwts_dt_property_read_u32(
 	void *fdt,
-	int offset,
+	const int offset,
 	const char *pname,
 	int *value)
 {
@@ -207,7 +207,7 @@  int fwts_dt_property_read_u32(
 
 int fwts_dt_property_read_u32_arr(
 	void *fdt,
-	int offset,
+	const int offset,
 	const char *pname,
 	int *value,
 	int *len)
@@ -236,7 +236,7 @@  int fwts_dt_property_read_u32_arr(
 
 int fwts_dt_property_read_u64_arr(
 	void *fdt,
-	int offset,
+	const int offset,
 	const char *pname,
 	uint64_t *value,
 	int *len)
@@ -261,7 +261,7 @@  int fwts_dt_property_read_u64_arr(
 int fwts_dt_stringlist_count(
 	fwts_framework *fw,
 	const void *fdt,
-	int nodeoffset,
+	const int nodeoffset,
 	const char *property)
 {
 	const char *list, *end;