diff mbox

[U-Boot,v2,6/9] fdt_support: add 'const' qualifier for unchanged argument

Message ID 1397810465-10006-7-git-send-email-yamada.m@jp.panasonic.com
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Masahiro Yamada April 18, 2014, 8:41 a.m. UTC
In the next commit, I will add a new function, fdt_pack_reg()
which uses get_cells_len().

Beforehand, this commit adds 'const' qualifier to get_cells_len().
Otherwise, a warning message will appear:
 warning: passing argument 1 of 'get_cells_len' discards 'const'
 qualifier from pointer target type [enabled by default]

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---

Changes in v2:
  - Drop the period at the end of the commit subject

 common/fdt_support.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Simon Glass May 24, 2014, 1:26 a.m. UTC | #1
On 17 April 2014 22:41, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
> In the next commit, I will add a new function, fdt_pack_reg()
> which uses get_cells_len().
>
> Beforehand, this commit adds 'const' qualifier to get_cells_len().
> Otherwise, a warning message will appear:
>  warning: passing argument 1 of 'get_cells_len' discards 'const'
>  qualifier from pointer target type [enabled by default]
>
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>

Acked-by: Simon Glass <sjg@chromium.org>

> ---
>
> Changes in v2:
>   - Drop the period at the end of the commit subject
>
Tom Rini June 19, 2014, 3:20 p.m. UTC | #2
On Fri, Apr 18, 2014 at 05:41:02PM +0900, Masahiro Yamada wrote:

> In the next commit, I will add a new function, fdt_pack_reg()
> which uses get_cells_len().
> 
> Beforehand, this commit adds 'const' qualifier to get_cells_len().
> Otherwise, a warning message will appear:
>  warning: passing argument 1 of 'get_cells_len' discards 'const'
>  qualifier from pointer target type [enabled by default]
> 
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> Acked-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/common/fdt_support.c b/common/fdt_support.c
index f641e68..bdc5ce1 100644
--- a/common/fdt_support.c
+++ b/common/fdt_support.c
@@ -21,11 +21,11 @@ 
  *     if #NNNN-cells property is 2 then len is 8
  *     otherwise len is 4
  */
-static int get_cells_len(void *blob, char *nr_cells_name)
+static int get_cells_len(const void *fdt, const char *nr_cells_name)
 {
 	const fdt32_t *cell;
 
-	cell = fdt_getprop(blob, 0, nr_cells_name, NULL);
+	cell = fdt_getprop(fdt, 0, nr_cells_name, NULL);
 	if (cell && fdt32_to_cpu(*cell) == 2)
 		return 8;