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 v2 03/17] dfu: rename dfu_tftp_write() to dfu_write_by_name()
Date: Mon, 22 Jun 2020 09:58:20 +0900	[thread overview]
Message-ID: <20200622005820.GA7316@laputa> (raw)
In-Reply-To: <CADg8p96fwH3FSzOkQCa71V6y8Dc84r+XKMOMdQ2V4B+=aSu85Q@mail.gmail.com>

On Sun, Jun 21, 2020 at 12:05:29AM +0530, Sughosh Ganu wrote:
> On Wed, 17 Jun 2020 at 08:25, AKASHI Takahiro <takahiro.akashi@linaro.org>
> wrote:
> 
> > This function is essentially independent from tffp, and will also be
> > utilised in implementing UEFI capsule update in a later commit.
> > So just give it a more generic name.
> > In addition, a new configuration option, CONFIG_DFU_ALT, was introduced
> > so that the file will be compiled with different options, particularly
> > one added in a later commit.
> >
> > Signed-off-by: AKASHI Takahiro <takahiro.akashi@linaro.org>
> > ---
> >  drivers/dfu/Kconfig                   |  5 +++++
> >  drivers/dfu/Makefile                  |  2 +-
> >  drivers/dfu/{dfu_tftp.c => dfu_alt.c} | 17 ++++++++++++--
> >  include/dfu.h                         | 32 +++++++++++++--------------
> >  4 files changed, 37 insertions(+), 19 deletions(-)
> >  rename drivers/dfu/{dfu_tftp.c => dfu_alt.c} (67%)
> >
> 
> You are renaming dfu_tftp.c to dfu_alt.c. Can the two api's not be added to
> dfu.c directly. Is there a need for a separate dfu_alt.c. It finally
> depends on what Lukasz thinks.
> 
> <snip>
> 
> 
> > index ffae4bb54f80..5b1b13d7170d 100644
> > --- a/drivers/dfu/dfu_tftp.c
> > +++ b/drivers/dfu/dfu_alt.c
> > @@ -10,8 +10,21 @@
> >  #include <errno.h>
> >  #include <dfu.h>
> >
> > -int dfu_tftp_write(char *dfu_entity_name, unsigned int addr, unsigned int
> > len,
> > -                  char *interface, char *devstring)
> > +/**
> > + * dfu_write_by_name() - write data to DFU medium
> > + * @dfu_entity_name:    Name of DFU entity to write
> > + * @addr:               Address of data buffer to write
> > + * @len:                Number of bytes
> > + * @interface:          Destination DFU medium (e.g. "mmc")
> > + * @devstring:          Instance number of destination DFU medium (e.g.
> > "1")
> > + *
> > + * This function is storing data received on DFU supported medium which
> > + * is specified by @dfu_entity_name.
> > + *
> > + * Return:              0 - on success, error code - otherwise
> > + */
> > +int dfu_write_by_name(char *dfu_entity_name, unsigned int addr,
> > +                     unsigned int len, char *interface, char *devstring)
> >  {
> >
> 
> I know that this has been taken from the original dfu_tftp.c, but the addr
> parameter needs to be a void pointer. The unsigned int does not work when
> addr is greater than 4GB. This needs to be changed for both the api's that
> are being added.

I can agree, but wonder why this has not caused any issue so far.

I know that the caller, update_tftp(), defines and uses a "ulong"
variable for this parameter. A casting like "(void *)(uintptr_t)addr"
can be misleading.

-Takahiro Akashi


> -sughosh

  parent reply	other threads:[~2020-06-22  0:58 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-17  2:54 [PATCH v2 00/17] efi_loader: add capsule update support AKASHI Takahiro
2020-06-17  2:54 ` [PATCH v2 01/17] common: update_tftp: remove unnecessary build check AKASHI Takahiro
2020-06-17  2:55 ` [PATCH v2 02/17] dfu: add a hidden reverse-dependency on UPDATE_TFTP AKASHI Takahiro
2020-06-17  2:55 ` [PATCH v2 03/17] dfu: rename dfu_tftp_write() to dfu_write_by_name() AKASHI Takahiro
2020-06-20 18:35   ` Sughosh Ganu
2020-06-21  7:38     ` Lukasz Majewski
2020-06-22  0:41       ` AKASHI Takahiro
2020-06-22  7:19         ` Lukasz Majewski
2020-06-22  0:58     ` AKASHI Takahiro [this message]
2020-06-17  2:55 ` [PATCH v2 04/17] common: update: add a generic interface for FIT image AKASHI Takahiro
2020-06-17  2:55 ` [PATCH v2 05/17] dfu: export dfu_list AKASHI Takahiro
2020-06-17  2:55 ` [PATCH v2 06/17] efi_loader: add option to initialise EFI subsystem early AKASHI Takahiro
2020-06-17  2:55 ` [PATCH v2 07/17] efi_loader: define UpdateCapsule api AKASHI Takahiro
2020-06-17  2:55 ` [PATCH v2 08/17] efi_loader: capsule: add capsule_on_disk support AKASHI Takahiro
2020-06-17  2:55 ` [PATCH v2 09/17] efi_loader: capsule: add memory range capsule definitions AKASHI Takahiro
2020-06-17  2:55 ` [PATCH v2 10/17] efi_loader: capsule: support firmware update AKASHI Takahiro
2020-06-17  2:55 ` [PATCH v2 11/17] efi_loader: add firmware management protocol for FIT image AKASHI Takahiro
2020-06-20 18:39   ` Sughosh Ganu
2020-06-22  1:03     ` AKASHI Takahiro
2020-06-20 18:49   ` Sughosh Ganu
2020-06-22  1:09     ` AKASHI Takahiro
2020-06-22  7:58       ` Sughosh Ganu
2020-06-22  8:06         ` AKASHI Takahiro
2020-06-22  8:38           ` Sughosh Ganu
2020-06-17  2:55 ` [PATCH v2 12/17] dfu: add dfu_write_by_alt() AKASHI Takahiro
2020-06-17  2:55 ` [PATCH v2 13/17] efi_loader: add firmware management protocol for raw image AKASHI Takahiro
2020-06-20 18:57   ` Sughosh Ganu
2020-06-22  1:21     ` AKASHI Takahiro
2020-06-22  7:53       ` Sughosh Ganu
2020-06-17  2:55 ` [PATCH v2 14/17] cmd: add "efidebug capsule" command AKASHI Takahiro
2020-06-17  2:55 ` [PATCH v2 15/17] tools: add mkeficapsule command for UEFI capsule update AKASHI Takahiro
2020-06-17  2:55 ` [PATCH v2 16/17] test/py: add a test for efi firmware update capsule of FIT image AKASHI Takahiro
2020-06-17  2:55 ` [PATCH v2 17/17] test/py: add a test for uefi firmware update capsule of raw image 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=20200622005820.GA7316@laputa \
    --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.