public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: Leif Lindholm <leif.lindholm@linaro.org>
To: Udit Kumar <udit.kumar@nxp.com>
Cc: Vabhav Sharma <vabhav.sharma@nxp.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>,
	"ruiyu.ni@intel.com" <ruiyu.ni@intel.com>,
	"jaben.carsey@intel.com" <jaben.carsey@intel.com>,
	"ard.biesheuvel@linaro.org" <ard.biesheuvel@linaro.org>,
	"siyuan.fu@intel.com" <siyuan.fu@intel.com>,
	"ting.ye@intel.com" <ting.ye@intel.com>
Subject: Re: [PATCH] Tftp assert fix for openfile failure case
Date: Wed, 8 Nov 2017 15:22:25 +0000	[thread overview]
Message-ID: <20171108152225.gy6te7rcroqqjr3j@bivouac.eciton.net> (raw)
In-Reply-To: <AM6PR0402MB33342DB97B64A00FCBD69D2391560@AM6PR0402MB3334.eurprd04.prod.outlook.com>

On Wed, Nov 08, 2017 at 05:15:49AM +0000, Udit Kumar wrote:
> > > diff --git a/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c
> > > b/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c
> > > index fbde3bf..6425fc5 100755
> > > --- a/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c
> > > +++ b/ShellPkg/Library/UefiShellTftpCommandLib/Tftp.c
> > > @@ -509,6 +509,7 @@ ShellCommandRunTftp (
> > >        );
> > >        goto NextHandle;
> > 
> > Wow, a goto in a foor loop in a 320-line function.
> > What could possibly go wrong?
> 
> Instead of being on some volume, if you are on Shell. 
> Then file open will fail. 

Sure. The above was a snarky comment on the state of the existing
code.

> > >      }
> > > +    DataSize = FileSize;
> > >
> > >      Status = DownloadFile (Mtftp4, RemoteFilePath, AsciiRemoteFilePath,
> > FileSize, BlockSize, &Data);
> > >      if (EFI_ERROR (Status)) {
> > > @@ -539,7 +540,6 @@ ShellCommandRunTftp (
> > >        goto NextHandle;
> > >      }
> > >
> > > -    DataSize = FileSize;
> > >      Status = ShellWriteFile (FileHandle, &FileSize, Data);
> > >      if (!EFI_ERROR (Status)) {
> > >        ShellStatus = SHELL_SUCCESS;
> > > --
> > > 1.9.1
> > 
> > So, a wider question:
> > This shell command was introduced in the heyday of "let's
> > reimplement U-Boot in the EDK2 tree". Mainly, from my impression,
> > it seems to be used in order that people don't need to learn how
> > boot managers and device paths work.
> 
> When you say about complete boot, then this may not be useful. 
> 
> > Am I being too harsh?
> > Are there practical uses for this?
> 
> For doing some sort of unit testing of given interface. I found this
> useful. During development, this is useful to transfer generic file
> to development board.

OK, I can see how it could be useful.
My opposition is based on three things:
1) people _are_ trying to use it for boot
2) not a command described by UEFI Shell spec, but I keep seeing
   platforms including it even in RELEASE builds (most likely because 1)
3) code quality/maintainability

> > If the code is to be kept, I think (from a quick glance) that I
> > would also like to see
> >   *Data = NULL
> > in the error path of DownloadFile().

OK, so we don't need to drop it right now, but what's your take on
this comment?

/
    Leif


  reply	other threads:[~2017-11-08 15:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-03 14:26 [PATCH] Tftp assert fix for openfile failure case Vabhav
2017-11-07 17:54 ` Leif Lindholm
2017-11-08  5:15   ` Udit Kumar
2017-11-08 15:22     ` Leif Lindholm [this message]
2017-11-09  4:43       ` Udit Kumar
2018-02-13  9:43         ` Meenakshi Aggarwal
2018-02-13 15:14           ` Carsey, Jaben
2018-02-13 15:19             ` Meenakshi Aggarwal
2018-02-13 15:36               ` Carsey, Jaben
2018-02-20  6:19                 ` Meenakshi Aggarwal

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-list 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=20171108152225.gy6te7rcroqqjr3j@bivouac.eciton.net \
    --to=devel@edk2.groups.io \
    /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