public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 1/3] fastboot: Use const qualifier for char *part_name
Date: Thu, 13 Jun 2019 07:45:55 +0200	[thread overview]
Message-ID: <20190613074555.50c92ebb@jawa> (raw)
In-Reply-To: <20190612211411.15250-2-semen.protsenko@linaro.org>

On Thu, 13 Jun 2019 00:14:09 +0300
Sam Protsenko <semen.protsenko@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@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

Reviewed-by: Lukasz Majewski <lukma@denx.de>


Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20190613/a0c052a5/attachment.sig>

  reply	other threads:[~2019-06-13  5:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-12 21:14 [U-Boot] [PATCH v2 0/3] fastboot: Fix getvar "has-slot" and cleanup Sam Protsenko
2019-06-12 21:14 ` [U-Boot] [PATCH v2 1/3] fastboot: Use const qualifier for char *part_name Sam Protsenko
2019-06-13  5:45   ` Lukasz Majewski [this message]
2019-06-13  8:12   ` Igor Opaniuk
2019-06-12 21:14 ` [U-Boot] [PATCH v2 2/3] fastboot: getvar: Refactor fastboot_*_get_part_info() usage Sam Protsenko
2019-06-13  5:46   ` Lukasz Majewski
2019-06-13  8:11   ` Igor Opaniuk
2019-06-12 21:14 ` [U-Boot] [PATCH v2 3/3] fastboot: Check if partition really exist in getvar_has_slot() Sam Protsenko
2019-06-12 21:20   ` Sam Protsenko
2019-06-13  5:47     ` Lukasz Majewski
2019-06-13 12:01       ` Lukasz Majewski
2019-06-13 18:12         ` Sam Protsenko
2019-06-13  5:46   ` Lukasz Majewski
2019-06-13 11:30   ` Eugeniu Rosca

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190613074555.50c92ebb@jawa \
    --to=lukma@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox