From: Wolfgang Denk <wd@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] fs/fat: add a parameter: allow_whole_dev to fat_register_device()
Date: Fri, 13 Jun 2014 06:38:36 +0200 [thread overview]
Message-ID: <20140613043836.1976938060E@gemini.denx.de> (raw)
In-Reply-To: <539A70FF.4080003@atmel.com>
Dear Josh Wu,
In message <539A70FF.4080003@atmel.com> you wrote:
>
> > Don;t we also support plain "ifname dev", i. e. without partition
> > specification?
>
> The problem is we only support "ifname dev" on command line mode or the
> filesystem call which calls get_device_and_partition().
>
> For environment save/load and SPL load on FAT, which use
> fat_register_device() instead of calling get_device_and_partition(),
> we need specify the partition number. It DOESN'T support "ifname dev"
> without partition number.
OK. so we have indentified the problem. It seems we should fix that?
> > I think, we should implemnt consistent behaviour here.
>
> I agree. I will read the get_device_and_partition() code to understand it.
The commit message of the patch you referred to has a nice description
of how it is supposed to work.
> After the discussing I get a further think of this problem. Let me
> summary here:
>
> The problem I met is FAT env save/load and FAT spl load use
> fat_register_device() instead of get_device_and_partition().
> So that means I must specify a partition number.
>
> I think for usually user case, we don't want to specify the partition
> number. that means:
> 1. if has partition table, please use partition #1.
This is different from the non-SPL case then, which uses the first
bootable partition instead, which may or may bnot be # 1.
> if we agree with above, then the solution should be implement a way to
> support the case we don't specify a partition number.
> 1. use get_device_and_partition().
> 2. add a unspecify partition number support in fat_register_device()
>
> I think #1 is the best way be cause we don't have to implement same
> things in two place. But I am doubt that the FAT spl can use it. I'll
> check this.
Using the same code is also a good way to make sure the behaviour is
the same :-)
> What do think of that?
Sounds good to me.
> >>> Please make this an "int" type, and use 0 and 1.
> >> Is there any special concern for that? like cause machine compatiable issue?
> > Boolean values in C are 1 and 0. Hiding these under other names (like
> > "true" and "false") doesn't buy anything.
>
> Okay. I just think use bool will be more readable. That also can make
> people less use an integer number, which in some case it's hard to
> understand it.
None of the related code uses ant bool types so far, so please do not
introduce it now.
Thanks.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
There is is no reason for any individual to have a computer in their
home. -- Ken Olsen (President of Digital Equipment Corporation),
Convention of the World Future Society, in Boston, 1977
next prev parent reply other threads:[~2014-06-13 4:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-12 5:57 [U-Boot] [PATCH] fs/fat: add a parameter: allow_whole_dev to fat_register_device() Josh Wu
2014-06-12 6:26 ` Wolfgang Denk
2014-06-12 7:04 ` Josh Wu
2014-06-12 8:52 ` Wolfgang Denk
2014-06-13 3:33 ` Josh Wu
2014-06-13 4:07 ` Stephen Warren
2014-06-13 4:54 ` Josh Wu
2014-06-14 20:07 ` Tom Rini
2014-06-13 4:38 ` Wolfgang Denk [this message]
2014-06-13 13:40 ` Tom Rini
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=20140613043836.1976938060E@gemini.denx.de \
--to=wd@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