All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Henrik Nordström" <henrik@henriknordstrom.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] sandbox: block driver using host file/device as backing store
Date: Thu, 16 May 2013 03:09:16 +0200	[thread overview]
Message-ID: <1368666556.27007.23.camel@localhost> (raw)
In-Reply-To: <CAPnjgZ2BFEXuZv13001RWOMVLz8j4ai+iwHkjvRuTB19TB58dw@mail.gmail.com>

ons 2013-05-15 klockan 15:20 -0700 skrev Simon Glass:
> Hi Henrik,
> 
> On Wed, May 15, 2013 at 2:54 PM, Henrik Nordstr?m
> <henrik@henriknordstrom.net> wrote:
> > Version 2 of this patch addressing the code comments by Simon and adding
> > some small missing pieces.
> 
> Looks good.
> 
> For change log, you should follow the standard approach - also instead
> of 'comments by Simon' it is good to list the things you changed. You
> might find patman useful for preparing and sending patches.

Just looked into it and looks nice. Giving it a try for next version.

Took a little while to get started, mostly because it crashes & burns
when not finding an matching alias for sandbox.

> blank line here, please fix globally (a blank line between
> declarations and code).

Ok.

> > +static int do_sandbox_info(cmd_tbl_t *cmdtp, int flag, int argc,
> > +                          char * const argv[])
> > +{
> > +       if (argc < 1 || argc > 2)
> > +               return CMD_RET_USAGE;
> 
> Probably best to put this after the declarations

Ok. Also restrucured do_sandbox_bind a little to match this. There one
of the declarations depends on this being checked first.


> Move to top of function. Try to collect your declarations within a
> block when it's easy to do so.

Ok.


> > +       printf("%3s %12s %s\n", "dev", "blocks", "path");
> > +       for (dev = min_dev; dev <= max_dev; dev++) {
> > +               printf("%3d ", dev);
> > +               block_dev_desc_t *blk_dev = host_get_dev(dev);
> > +               if (!blk_dev)
> > +                       continue;
> 
> Does this case ever happen? If so you don't print \n.

Yes. And it then relies on the driver to print an error.

> > +               struct host_block_dev *host_dev = blk_dev->priv;
> 
> Maybe leave the assignment here but put the declaration at the start
> of the block.

Yes.

> >  COBJS-$(CONFIG_IDE_SIL680) += sil680.o
> >  COBJS-$(CONFIG_SCSI_SYM53C8XX) += sym53c8xx.o
> >  COBJS-$(CONFIG_SYSTEMACE) += systemace.o
> > +COBJS-$(CONFIG_SANDBOX) += sandbox.o
> 
> Alphabetic order so this should go up two.

up seven. sorted on filename here not CONFIG_..

> > +#include <sandboxblockdev.h>
> 
> How about sandbox-blockdev.h

Yee.

> puts() when you don't have format args. Please fix globally.

Ok.

> > +       if (host_dev->fd == -1) {
> > +               printf("Failed to access host backing file '%s'\n",
> > +                      host_dev->filename);
> > +               return 1;
> 
> -ENOENT might be better (include errno.h)

or maybe just -errno?

and handle the error in do_sandbox_bind().

> > +int host_dev_bind(int dev, char *filename);
> 
> Please add a comment as to what this function does, describing the
> meaning and valid values for each argument.

Ok.

> =>ext4load host 0:3
> Segmentation fault (core dumped)

Doesn't ext2load expect a address & filename to load?

Regads
Henrik

  reply	other threads:[~2013-05-16  1:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-14 23:36 [U-Boot] [PATCH] sandbox: block driver using host file/device as backing store Henrik Nordström
2013-05-15 17:42 ` Simon Glass
2013-05-15 21:29   ` Henrik Nordström
2013-05-15 21:54     ` [U-Boot] [PATCH v2] " Henrik Nordström
2013-05-15 22:20       ` Simon Glass
2013-05-16  1:09         ` Henrik Nordström [this message]
2013-05-17  4:53           ` Simon Glass
2013-05-18 14:24             ` [U-Boot] sandbox: block driver using host file/device as backing store, crash in ext4 Henrik Nordström
2013-05-18 17:46               ` Simon Glass
2013-06-16 14:50             ` [U-Boot] [PATCH v2] sandbox: block driver using host file/device as backing store Simon Glass
2013-06-17  1:39               ` Henrik Nordström
2013-07-31 11:29                 ` Simon Glass

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=1368666556.27007.23.camel@localhost \
    --to=henrik@henriknordstrom.net \
    --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.