From: Jean-Jacques Hiblot Date: Mon, 7 Aug 2017 12:07:47 +0200 Subject: [U-Boot] [PATCH v4 2/9] fit: use 'const' for the input of fdt_offset() and locate_dtb_in_fit() In-Reply-To: <1502100474-26671-1-git-send-email-jjhiblot@ti.com> References: <1502100474-26671-1-git-send-email-jjhiblot@ti.com> Message-ID: <1502100474-26671-3-git-send-email-jjhiblot@ti.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Those 2 functions don't modify their input, we can mark it const. This prevents compilation warnings when they are provided const input. Signed-off-by: Jean-Jacques Hiblot Reviewed-by: Tom Rini Reviewed-by: Simon Glass --- change since v3: updated the description of locate_dtb_in_fit() common/boot_fit.c | 4 ++-- include/boot_fit.h | 9 +++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/common/boot_fit.c b/common/boot_fit.c index 51440a6..3767c63 100644 --- a/common/boot_fit.c +++ b/common/boot_fit.c @@ -13,7 +13,7 @@ #include #include -int fdt_offset(void *fit) +static int fdt_offset(const void *fit) { int images, node, fdt_len, fdt_node, fdt_offset; const char *fdt_name; @@ -55,7 +55,7 @@ int fdt_offset(void *fit) return fdt_offset; } -void *locate_dtb_in_fit(void *fit) +void *locate_dtb_in_fit(const void *fit) { struct image_header *header; int size; diff --git a/include/boot_fit.h b/include/boot_fit.h index b7d2462..e16ae5b 100644 --- a/include/boot_fit.h +++ b/include/boot_fit.h @@ -5,5 +5,10 @@ * SPDX-License-Identifier: GPL-2.0+ */ -int fdt_offset(void *fit); -void *locate_dtb_in_fit(void *fit); +/** + * locate_dtb_in_fit - Find a DTB matching the board in a FIT image + * @fit: pointer to the FIT image + * + * @return a pointer to a matching DTB blob if found, NULL otherwise + */ +void *locate_dtb_in_fit(const void *fit); -- 1.9.1