[U-Boot] [PATCH v2 1/3] fastboot: Use const qualifier for char *part_name

Igor Opaniuk igor.opaniuk at gmail.com
Thu Jun 13 08:12:52 UTC 2019


On Thu, Jun 13, 2019 at 12:14 AM Sam Protsenko
<semen.protsenko at linaro.org> wrote:
>
> In fastboot_*_get_part_info() functions we can use stronger typing by
> expecting const strings.
>
> Signed-off-by: Sam Protsenko <semen.protsenko at linaro.org>
> ---
>  drivers/fastboot/fb_mmc.c  | 3 ++-
>  drivers/fastboot/fb_nand.c | 4 ++--
>  include/fb_mmc.h           | 3 ++-
>  include/fb_nand.h          | 4 ++--
>  4 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/fastboot/fb_mmc.c b/drivers/fastboot/fb_mmc.c
> index 90ca81da9b..0a335db3a6 100644
> --- a/drivers/fastboot/fb_mmc.c
> +++ b/drivers/fastboot/fb_mmc.c
> @@ -298,7 +298,8 @@ static int fb_mmc_update_zimage(struct blk_desc *dev_desc,
>   * @part_info: Pointer to returned disk_partition_t
>   * @response: Pointer to fastboot response buffer
>   */
> -int fastboot_mmc_get_part_info(char *part_name, struct blk_desc **dev_desc,
> +int fastboot_mmc_get_part_info(const char *part_name,
> +                              struct blk_desc **dev_desc,
>                                disk_partition_t *part_info, char *response)
>  {
>         int r;
> diff --git a/drivers/fastboot/fb_nand.c b/drivers/fastboot/fb_nand.c
> index 526bc12307..6756ea769f 100644
> --- a/drivers/fastboot/fb_nand.c
> +++ b/drivers/fastboot/fb_nand.c
> @@ -152,8 +152,8 @@ static lbaint_t fb_nand_sparse_reserve(struct sparse_storage *info,
>   * @part_info: Pointer to returned part_info pointer
>   * @response: Pointer to fastboot response buffer
>   */
> -int fastboot_nand_get_part_info(char *part_name, struct part_info **part_info,
> -                               char *response)
> +int fastboot_nand_get_part_info(const char *part_name,
> +                               struct part_info **part_info, char *response)
>  {
>         struct mtd_info *mtd = NULL;
>
> diff --git a/include/fb_mmc.h b/include/fb_mmc.h
> index fd5db9eac8..95db001bee 100644
> --- a/include/fb_mmc.h
> +++ b/include/fb_mmc.h
> @@ -14,7 +14,8 @@
>   * @part_info: Pointer to returned disk_partition_t
>   * @response: Pointer to fastboot response buffer
>   */
> -int fastboot_mmc_get_part_info(char *part_name, struct blk_desc **dev_desc,
> +int fastboot_mmc_get_part_info(const char *part_name,
> +                              struct blk_desc **dev_desc,
>                                disk_partition_t *part_info, char *response);
>
>  /**
> diff --git a/include/fb_nand.h b/include/fb_nand.h
> index 08ab0e28a6..6d7999f262 100644
> --- a/include/fb_nand.h
> +++ b/include/fb_nand.h
> @@ -16,8 +16,8 @@
>   * @part_info: Pointer to returned part_info pointer
>   * @response: Pointer to fastboot response buffer
>   */
> -int fastboot_nand_get_part_info(char *part_name, struct part_info **part_info,
> -                               char *response);
> +int fastboot_nand_get_part_info(const char *part_name,
> +                               struct part_info **part_info, char *response);
>
>  /**
>   * fastboot_nand_flash_write() - Write image to NAND for fastboot
> --
> 2.20.1
>

Reviewed-by: Igor Opaniuk <igor.opaniuk at toradex.com>

-- 
Best regards - Freundliche GrĂ¼sse - Meilleures salutations

Igor Opaniuk

mailto: igor.opaniuk at gmail.com
skype: igor.opanyuk
+380 (93) 836 40 67
http://ua.linkedin.com/in/iopaniuk


More information about the U-Boot mailing list