All of lore.kernel.org
 help / color / mirror / Atom feed
From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: u-boot@lists.denx.de
Subject: [PATCH v6 02/17] dfu: modify an argument type for an address
Date: Mon,  7 Sep 2020 14:34:11 +0900	[thread overview]
Message-ID: <20200907053426.1675646-3-takahiro.akashi@linaro.org> (raw)
In-Reply-To: <20200907053426.1675646-1-takahiro.akashi@linaro.org>

The range of an addressable pointer can go beyond 'integer'.
So change the argument type to a void pointer.

Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
Reviewed-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 common/update.c       | 3 ++-
 drivers/dfu/dfu_alt.c | 6 +++---
 include/dfu.h         | 4 ++--
 3 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/common/update.c b/common/update.c
index 39946776d74f..8dd6ee8b7ddb 100644
--- a/common/update.c
+++ b/common/update.c
@@ -324,7 +324,8 @@ got_update_file:
 			}
 		} else if (fit_image_check_type(fit, noffset,
 						IH_TYPE_FIRMWARE)) {
-			ret = dfu_write_by_name(fit_image_name, update_addr,
+			ret = dfu_write_by_name(fit_image_name,
+						(void *)update_addr,
 						update_size, interface,
 						devstring);
 			if (ret)
diff --git a/drivers/dfu/dfu_alt.c b/drivers/dfu/dfu_alt.c
index 5b1b13d7170d..7528806cd163 100644
--- a/drivers/dfu/dfu_alt.c
+++ b/drivers/dfu/dfu_alt.c
@@ -23,14 +23,14 @@
  *
  * Return:              0 - on success, error code - otherwise
  */
-int dfu_write_by_name(char *dfu_entity_name, unsigned int addr,
+int dfu_write_by_name(char *dfu_entity_name, void *addr,
 		      unsigned int len, char *interface, char *devstring)
 {
 	char *s, *sb;
 	int alt_setting_num, ret;
 	struct dfu_entity *dfu;
 
-	debug("%s: name: %s addr: 0x%x len: %d device: %s:%s\n", __func__,
+	debug("%s: name: %s addr: 0x%p len: %d device: %s:%s\n", __func__,
 	      dfu_entity_name, addr, len, interface, devstring);
 
 	ret = dfu_init_env_entities(interface, devstring);
@@ -69,7 +69,7 @@ int dfu_write_by_name(char *dfu_entity_name, unsigned int addr,
 		goto done;
 	}
 
-	ret = dfu_write_from_mem_addr(dfu, (void *)(uintptr_t)addr, len);
+	ret = dfu_write_from_mem_addr(dfu, (void *)addr, len);
 
 done:
 	dfu_free_entities();
diff --git a/include/dfu.h b/include/dfu.h
index cecfbd76597b..2299a83a3d94 100644
--- a/include/dfu.h
+++ b/include/dfu.h
@@ -507,10 +507,10 @@ static inline int dfu_fill_entity_virt(struct dfu_entity *dfu, char *devstr,
  * Return:		0 - on success, error code - otherwise
  */
 #if CONFIG_IS_ENABLED(DFU_ALT)
-int dfu_write_by_name(char *dfu_entity_name, unsigned int addr,
+int dfu_write_by_name(char *dfu_entity_name, void *addr,
 		      unsigned int len, char *interface, char *devstring);
 #else
-static inline int dfu_write_by_name(char *dfu_entity_name, unsigned int addr,
+static inline int dfu_write_by_name(char *dfu_entity_name, void *addr,
 				    unsigned int len, char *interface,
 				    char *devstring)
 {
-- 
2.28.0

  parent reply	other threads:[~2020-09-07  5:34 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-07  5:34 [PATCH v6 00/17] efi_loader: add capsule update support AKASHI Takahiro
2020-09-07  5:34 ` [PATCH v6 01/17] dfu: rename dfu_tftp_write() to dfu_write_by_name() AKASHI Takahiro
2020-09-09 12:30   ` Heinrich Schuchardt
2020-09-10  1:54     ` AKASHI Takahiro
2020-09-10  2:26       ` Tom Rini
2020-09-11  0:46         ` AKASHI Takahiro
2020-09-11  2:41           ` Tom Rini
2020-09-18  1:28             ` AKASHI Takahiro
2020-09-18  1:32               ` Tom Rini
2020-09-18  8:08                 ` Lukasz Majewski
2020-09-07  5:34 ` AKASHI Takahiro [this message]
2020-09-07  5:34 ` [PATCH v6 03/17] common: update: add a generic interface for FIT image AKASHI Takahiro
2020-09-07  5:34 ` [PATCH v6 04/17] dfu: export dfu_list AKASHI Takahiro
2020-09-07  5:34 ` [PATCH v6 05/17] efi_loader: add option to initialise EFI subsystem early AKASHI Takahiro
2020-09-07  5:34 ` [PATCH v6 06/17] efi_loader: add efi_create_indexed_name() AKASHI Takahiro
2020-09-07  5:34 ` [PATCH v6 07/17] efi_loader: define UpdateCapsule api AKASHI Takahiro
2020-09-07  5:34 ` [PATCH v6 08/17] efi_loader: capsule: add capsule_on_disk support AKASHI Takahiro
2020-09-07  5:34 ` [PATCH v6 09/17] efi_loader: capsule: add memory range capsule definitions AKASHI Takahiro
2020-09-07  5:34 ` [PATCH v6 10/17] efi_loader: capsule: support firmware update AKASHI Takahiro
2020-09-07  5:34 ` [PATCH v6 11/17] efi_loader: add firmware management protocol for FIT image AKASHI Takahiro
2020-09-07  5:34 ` [PATCH v6 12/17] dfu: add dfu_write_by_alt() AKASHI Takahiro
2020-09-07  5:34 ` [PATCH v6 13/17] efi_loader: add firmware management protocol for raw image AKASHI Takahiro
2020-09-07  5:34 ` [PATCH v6 14/17] cmd: add "efidebug capsule" command AKASHI Takahiro
2020-09-07  5:34 ` [PATCH v6 15/17] tools: add mkeficapsule command for UEFI capsule update AKASHI Takahiro
2020-09-07  5:34 ` [PATCH v6 16/17] test/py: efi_capsule: test for FIT image capsule AKASHI Takahiro
2020-09-07  5:34 ` [PATCH v6 17/17] test/py: efi_capsule: test for raw " AKASHI Takahiro
2020-09-09 14:48 ` [PATCH v6 00/17] efi_loader: add capsule update support Heinrich Schuchardt
2020-09-09 16:56   ` Tom Rini
2020-09-10  2:52     ` AKASHI Takahiro
2020-09-10  2:58       ` Tom Rini
2020-09-11  0:52         ` AKASHI Takahiro
2020-09-11  1:02           ` Tom Rini
2020-09-11  2:31             ` AKASHI Takahiro
2020-09-11  2:44               ` Tom Rini
2020-09-10  2:43   ` AKASHI Takahiro

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=20200907053426.1675646-3-takahiro.akashi@linaro.org \
    --to=takahiro.akashi@linaro.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.