Skip to contentSkip to conversation

cmd_sf: rename "speed" to "hz"

PATCH New Mike Frysinger 4 participants 7 messages Dec 11, 2008 – Jan 6, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cmd_sf: rename "speed" to "hz"

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.

---
 common/cmd_sf.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
common/cmd_sf.c +5 -5
index 8c0a751..902e51d 100644
@@ -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;
Signature · 1 line
1.6.0.4
#1 lore raw

PATCH 1/1 cmd_sf: rename "speed" to "hz"

Dear Mike Frysinger,

Quoted 14 lines · In message <[email protected]> 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.

---
 common/cmd_sf.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
common/cmd_sf.c +0 -0
index 8c0a751..902e51d 100644

common/cmd_sf.c line 12

Quoted 7 lines
common/cmd_sf.c +2 -2
@@ -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

Signature · 5 lines
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.
#2 lore raw

PATCH 1/1 cmd_sf: rename "speed" to "hz"

Quoted 25 lines · On Thursday 11 December 2008 18:59:46 Wolfgang Denk wrote:
Quoted 14 lines · In message Mike Frysinger you

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.

---
 common/cmd_sf.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
common/cmd_sf.c +0 -0
index 8c0a751..902e51d 100644

common/cmd_sf.c line 12

Quoted 7 lines
common/cmd_sf.c +2 -2
@@ -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".

Quoted 2 lines

"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

#3 lore raw

PATCH 1/1 cmd_sf: rename "speed" to "hz"

Dear Mike Frysinger,

Quoted 8 lines · In message <[email protected]> you wrote:
Quoted 8 lines

common/cmd_sf.c line 12

Quoted 5 lines
common/cmd_sf.c +2 -2
-#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".

Quoted 4 lines
Quoted 2 lines

"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.

Quoted 1 line

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

Signature · 6 lines
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
#4 lore raw

PATCH 1/1 cmd_sf: rename "speed" to "hz"

Quoted 14 lines · On Friday 12 December 2008 02:22:16 Wolfgang Denk wrote:
Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 7 lines

common/cmd_sf.c line 12

Quoted 4 lines
common/cmd_sf.c +2 -2
-#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".

Quoted 5 lines
Quoted 2 lines

"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

Quoted 7 lines

Agreed.

Quoted 2 lines

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

#5 lore raw

PATCH 1/1 cmd_sf: rename "speed" to "hz"

In reply to Mike Frysinger
Quoted 25 lines · Mike Frysinger
Quoted 24 lines · On Thursday 11 December 2008 18:59:46 Wolfgang Denk wrote:
Quoted 14 lines · In message Mike Frysinger you

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.

---
 common/cmd_sf.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
common/cmd_sf.c +0 -0
index 8c0a751..902e51d 100644

common/cmd_sf.c line 12

Quoted 7 lines
common/cmd_sf.c +2 -2
@@ -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".

Quoted 6 lines
Quoted 2 lines

"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

#6 lore raw

PATCH 1/1 cmd_sf: rename "speed" to "hz"

In reply to Mike Frysinger
Quoted 5 lines · Mike Frysinger

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.

I like it. "hz" makes it perfectly clear what the value means.