* [U-Boot] [PATCH] cmd_sf: rename "speed" to "hz"
@ 2008-12-11 22:28 Mike Frysinger
2008-12-11 23:59 ` Wolfgang Denk
2009-01-06 13:03 ` Haavard Skinnemoen
0 siblings, 2 replies; 7+ messages in thread
From: Mike Frysinger @ 2008-12-11 22:28 UTC (permalink / raw)
To: u-boot
The term "hz" is used everywhere else when talking about the frequency of
the SPI bus, so have the sf command use it as well to stay consistent. It
even presents itself as "hz" when showing user help.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
---
common/cmd_sf.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/common/cmd_sf.c b/common/cmd_sf.c
index 8c0a751..902e51d 100644
--- a/common/cmd_sf.c
+++ b/common/cmd_sf.c
@@ -8,8 +8,8 @@
#include <asm/io.h>
-#ifndef CONFIG_SF_DEFAULT_SPEED
-# define CONFIG_SF_DEFAULT_SPEED 1000000
+#ifndef CONFIG_SF_DEFAULT_HZ
+# define CONFIG_SF_DEFAULT_HZ 1000000
#endif
#ifndef CONFIG_SF_DEFAULT_MODE
# define CONFIG_SF_DEFAULT_MODE SPI_MODE_3
@@ -21,7 +21,7 @@ static int do_spi_flash_probe(int argc, char *argv[])
{
unsigned int bus = 0;
unsigned int cs;
- unsigned int speed = CONFIG_SF_DEFAULT_SPEED;
+ unsigned int hz = CONFIG_SF_DEFAULT_HZ;
unsigned int mode = CONFIG_SF_DEFAULT_MODE;
char *endp;
struct spi_flash *new;
@@ -43,7 +43,7 @@ static int do_spi_flash_probe(int argc, char *argv[])
}
if (argc >= 3) {
- speed = simple_strtoul(argv[2], &endp, 0);
+ hz = simple_strtoul(argv[2], &endp, 0);
if (*argv[2] == 0 || *endp != 0)
goto usage;
}
@@ -53,7 +53,7 @@ static int do_spi_flash_probe(int argc, char *argv[])
goto usage;
}
- new = spi_flash_probe(bus, cs, speed, mode);
+ new = spi_flash_probe(bus, cs, hz, mode);
if (!new) {
printf("Failed to initialize SPI flash at %u:%u\n", bus, cs);
return 1;
--
1.6.0.4
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] cmd_sf: rename "speed" to "hz"
2008-12-11 22:28 [U-Boot] [PATCH] cmd_sf: rename "speed" to "hz" Mike Frysinger
@ 2008-12-11 23:59 ` Wolfgang Denk
2008-12-12 2:30 ` Mike Frysinger
2009-01-06 13:03 ` Haavard Skinnemoen
1 sibling, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2008-12-11 23:59 UTC (permalink / raw)
To: u-boot
Dear Mike Frysinger,
In message <1229034488-26048-1-git-send-email-vapier@gentoo.org> you wrote:
> The term "hz" is used everywhere else when talking about the frequency of
> the SPI bus, so have the sf command use it as well to stay consistent. It
> even presents itself as "hz" when showing user help.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
> common/cmd_sf.c | 10 +++++-----
> 1 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/common/cmd_sf.c b/common/cmd_sf.c
> index 8c0a751..902e51d 100644
> --- a/common/cmd_sf.c
> +++ b/common/cmd_sf.c
> @@ -8,8 +8,8 @@
>
> #include <asm/io.h>
>
> -#ifndef CONFIG_SF_DEFAULT_SPEED
> -# define CONFIG_SF_DEFAULT_SPEED 1000000
> +#ifndef CONFIG_SF_DEFAULT_HZ
> +# define CONFIG_SF_DEFAULT_HZ 1000000
I consider "FREQ" (and even "SPEED) a much better name than "HZ".
"HZ" is the unit of what you are measuring, not a name for what you
are measuring.
NAK.
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
The universe does not have laws - it has habits, and habits can be
broken.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] cmd_sf: rename "speed" to "hz"
2008-12-11 23:59 ` Wolfgang Denk
@ 2008-12-12 2:30 ` Mike Frysinger
2008-12-12 7:22 ` Wolfgang Denk
2008-12-13 18:02 ` Jerry Van Baren
0 siblings, 2 replies; 7+ messages in thread
From: Mike Frysinger @ 2008-12-12 2:30 UTC (permalink / raw)
To: u-boot
On Thursday 11 December 2008 18:59:46 Wolfgang Denk wrote:
> In message Mike Frysinger you wrote:
> > The term "hz" is used everywhere else when talking about the frequency of
> > the SPI bus, so have the sf command use it as well to stay consistent.
> > It even presents itself as "hz" when showing user help.
> >
> > Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> > ---
> > common/cmd_sf.c | 10 +++++-----
> > 1 files changed, 5 insertions(+), 5 deletions(-)
> >
> > diff --git a/common/cmd_sf.c b/common/cmd_sf.c
> > index 8c0a751..902e51d 100644
> > --- a/common/cmd_sf.c
> > +++ b/common/cmd_sf.c
> > @@ -8,8 +8,8 @@
> >
> > #include <asm/io.h>
> >
> > -#ifndef CONFIG_SF_DEFAULT_SPEED
> > -# define CONFIG_SF_DEFAULT_SPEED 1000000
> > +#ifndef CONFIG_SF_DEFAULT_HZ
> > +# define CONFIG_SF_DEFAULT_HZ 1000000
>
> I consider "FREQ" (and even "SPEED) a much better name than "HZ".
>
> "HZ" is the unit of what you are measuring, not a name for what you
> are measuring.
then they should all be converted. not 90% using hz and 10% using something
else. "speed" is bad as it doesnt convey the unit while "hz" is pretty clear.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20081211/12343581/attachment-0001.pgp
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] cmd_sf: rename "speed" to "hz"
2008-12-12 2:30 ` Mike Frysinger
@ 2008-12-12 7:22 ` Wolfgang Denk
2008-12-22 8:49 ` Mike Frysinger
2008-12-13 18:02 ` Jerry Van Baren
1 sibling, 1 reply; 7+ messages in thread
From: Wolfgang Denk @ 2008-12-12 7:22 UTC (permalink / raw)
To: u-boot
Dear Mike Frysinger,
In message <200812112130.02918.vapier@gentoo.org> you wrote:
>
> > > -#ifndef CONFIG_SF_DEFAULT_SPEED
> > > -# define CONFIG_SF_DEFAULT_SPEED 1000000
> > > +#ifndef CONFIG_SF_DEFAULT_HZ
> > > +# define CONFIG_SF_DEFAULT_HZ 1000000
> >
> > I consider "FREQ" (and even "SPEED) a much better name than "HZ".
> >
> > "HZ" is the unit of what you are measuring, not a name for what you
> > are measuring.
>
> then they should all be converted. not 90% using hz and 10% using something
Agreed.
> else. "speed" is bad as it doesnt convey the unit while "hz" is pretty clear.
You are right, but that could be mentioned in the documentation
then...
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
People are very flexible and learn to adjust to strange surroundings
-- they can become accustomed to read Lisp and Fortran programs, for
example. - Leon Sterling and Ehud Shapiro, Art of Prolog, MIT Press
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] cmd_sf: rename "speed" to "hz"
2008-12-12 2:30 ` Mike Frysinger
2008-12-12 7:22 ` Wolfgang Denk
@ 2008-12-13 18:02 ` Jerry Van Baren
1 sibling, 0 replies; 7+ messages in thread
From: Jerry Van Baren @ 2008-12-13 18:02 UTC (permalink / raw)
To: u-boot
Mike Frysinger wrote:
> On Thursday 11 December 2008 18:59:46 Wolfgang Denk wrote:
>> In message Mike Frysinger you wrote:
>>> The term "hz" is used everywhere else when talking about the frequency of
>>> the SPI bus, so have the sf command use it as well to stay consistent.
>>> It even presents itself as "hz" when showing user help.
>>>
>>> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
>>> ---
>>> common/cmd_sf.c | 10 +++++-----
>>> 1 files changed, 5 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/common/cmd_sf.c b/common/cmd_sf.c
>>> index 8c0a751..902e51d 100644
>>> --- a/common/cmd_sf.c
>>> +++ b/common/cmd_sf.c
>>> @@ -8,8 +8,8 @@
>>>
>>> #include <asm/io.h>
>>>
>>> -#ifndef CONFIG_SF_DEFAULT_SPEED
>>> -# define CONFIG_SF_DEFAULT_SPEED 1000000
>>> +#ifndef CONFIG_SF_DEFAULT_HZ
>>> +# define CONFIG_SF_DEFAULT_HZ 1000000
>> I consider "FREQ" (and even "SPEED) a much better name than "HZ".
>>
>> "HZ" is the unit of what you are measuring, not a name for what you
>> are measuring.
>
> then they should all be converted. not 90% using hz and 10% using something
> else. "speed" is bad as it doesnt convey the unit while "hz" is pretty clear.
> -mike
Maybe I'm being pedantic or have drunk too much coffee, but "clk" (clock
rate, _expressed_ in Hz) is better than "speed" IMHO. "bps" (bits per
second) is another alternative, although it has its own problems if the
data rate is different when sending "0" bits vs. "1" bits (e.g. 1-wire).
Best regards,
gvb
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] cmd_sf: rename "speed" to "hz"
2008-12-12 7:22 ` Wolfgang Denk
@ 2008-12-22 8:49 ` Mike Frysinger
0 siblings, 0 replies; 7+ messages in thread
From: Mike Frysinger @ 2008-12-22 8:49 UTC (permalink / raw)
To: u-boot
On Friday 12 December 2008 02:22:16 Wolfgang Denk wrote:
> In message <200812112130.02918.vapier@gentoo.org> you wrote:
> > > > -#ifndef CONFIG_SF_DEFAULT_SPEED
> > > > -# define CONFIG_SF_DEFAULT_SPEED 1000000
> > > > +#ifndef CONFIG_SF_DEFAULT_HZ
> > > > +# define CONFIG_SF_DEFAULT_HZ 1000000
> > >
> > > I consider "FREQ" (and even "SPEED) a much better name than "HZ".
> > >
> > > "HZ" is the unit of what you are measuring, not a name for what you
> > > are measuring.
> >
> > then they should all be converted. not 90% using hz and 10% using
> > something
>
> Agreed.
>
> > else. "speed" is bad as it doesnt convey the unit while "hz" is pretty
> > clear.
>
> You are right, but that could be mentioned in the documentation
> then...
that seems silly to me. we can either have self-explaining defines, or
confusing ones which requires people to read the documentation to figure out ?
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 835 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20081222/0bdb61b1/attachment.pgp
^ permalink raw reply [flat|nested] 7+ messages in thread
* [U-Boot] [PATCH] cmd_sf: rename "speed" to "hz"
2008-12-11 22:28 [U-Boot] [PATCH] cmd_sf: rename "speed" to "hz" Mike Frysinger
2008-12-11 23:59 ` Wolfgang Denk
@ 2009-01-06 13:03 ` Haavard Skinnemoen
1 sibling, 0 replies; 7+ messages in thread
From: Haavard Skinnemoen @ 2009-01-06 13:03 UTC (permalink / raw)
To: u-boot
Mike Frysinger wrote:
> The term "hz" is used everywhere else when talking about the frequency of
> the SPI bus, so have the sf command use it as well to stay consistent. It
> even presents itself as "hz" when showing user help.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
I like it. "hz" makes it perfectly clear what the value means.
Acked-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2009-01-06 13:03 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-12-11 22:28 [U-Boot] [PATCH] cmd_sf: rename "speed" to "hz" Mike Frysinger
2008-12-11 23:59 ` Wolfgang Denk
2008-12-12 2:30 ` Mike Frysinger
2008-12-12 7:22 ` Wolfgang Denk
2008-12-22 8:49 ` Mike Frysinger
2008-12-13 18:02 ` Jerry Van Baren
2009-01-06 13:03 ` Haavard Skinnemoen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox