public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] byteorder of image_header_t members?
@ 2005-06-10 11:51 Steven Scholz
  2005-06-10 14:17 ` Wolfgang Denk
  2005-06-10 15:05 ` Steven Scholz
  0 siblings, 2 replies; 5+ messages in thread
From: Steven Scholz @ 2005-06-10 11:51 UTC (permalink / raw)
  To: u-boot

Hi there,

if uint32_t members of image_header_t are stored in network byteorder, then 
all references of these members should use ntohl(), right?

So should we fix this for instance:

#~> grep "\->ih_magic" *
cmd_autoscript.c:	if (ntohl(hdr->ih_magic) != IH_MAGIC) {
cmd_bootm.c:		if (ntohl(hdr->ih_magic) != IH_MAGIC) {
 >>> cmd_bootm.c:	if (hdr->ih_magic  != IH_MAGIC) {	<<<
cmd_bootm.c:		if (ntohl(hdr->ih_magic) != IH_MAGIC) {
cmd_bootm.c:		(ntohl(hdr->ih_magic) != IH_MAGIC))
 >>> cmd_doc.c:		if (hdr->ih_magic == IH_MAGIC) {	<<<
 >>> cmd_fdc.c:		if (hdr->ih_magic  != IH_MAGIC) {	<<<
cmd_fpga.c:		if (ntohl(hdr->ih_magic)  != IH_MAGIC) {
cmd_ide.c:		if (ntohl(hdr->ih_magic) != IH_MAGIC) {
cmd_nand.c:		if (ntohl(hdr->ih_magic) == IH_MAGIC) {
cmd_scsi.c:		if (ntohl(hdr->ih_magic) == IH_MAGIC) {
cmd_usb.c:		if (ntohl(hdr->ih_magic) != IH_MAGIC) {



-- 
Steven

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot-Users] byteorder of image_header_t members?
  2005-06-10 11:51 [U-Boot-Users] byteorder of image_header_t members? Steven Scholz
@ 2005-06-10 14:17 ` Wolfgang Denk
  2005-06-10 15:05 ` Steven Scholz
  1 sibling, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2005-06-10 14:17 UTC (permalink / raw)
  To: u-boot

In message <42A97ECC.5030708@imc-berlin.de> you wrote:
> 
> if uint32_t members of image_header_t are stored in network byteorder, then 
> all references of these members should use ntohl(), right?

Right.

> So should we fix this for instance:
> 
>  >>> cmd_bootm.c:	if (hdr->ih_magic  != IH_MAGIC) {	<<<

Done.

>  >>> cmd_doc.c:		if (hdr->ih_magic == IH_MAGIC) {	<<<
>  >>> cmd_fdc.c:		if (hdr->ih_magic  != IH_MAGIC) {	<<<

Looking forward to see your patch... :-)

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
As far as the laws of mathematics refer to reality, they are not cer-
tain, and as far as they are certain, they do not refer  to  reality.
                                                   -- Albert Einstein

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot-Users] byteorder of image_header_t members?
  2005-06-10 11:51 [U-Boot-Users] byteorder of image_header_t members? Steven Scholz
  2005-06-10 14:17 ` Wolfgang Denk
@ 2005-06-10 15:05 ` Steven Scholz
  2005-11-22  9:34   ` Steven Scholz
  2006-03-12  1:00   ` Wolfgang Denk
  1 sibling, 2 replies; 5+ messages in thread
From: Steven Scholz @ 2005-06-10 15:05 UTC (permalink / raw)
  To: u-boot

Hi there,

I wrote:

> if uint32_t members of image_header_t are stored in network byteorder, 
> then all references of these members should use ntohl(), right?
> 
> So should we fix this for instance:

Maybe you want to consider the attached patch.

* Patch by Steven Scholz, 10 Jun 2005:
    Adding loads of ntohl() in image header handling (for the sake
    of readability)

--
Steven



-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: u-boot_htonl.patch
Url: http://lists.denx.de/pipermail/u-boot/attachments/20050610/f9900e57/attachment.txt 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot-Users] byteorder of image_header_t members?
  2005-06-10 15:05 ` Steven Scholz
@ 2005-11-22  9:34   ` Steven Scholz
  2006-03-12  1:00   ` Wolfgang Denk
  1 sibling, 0 replies; 5+ messages in thread
From: Steven Scholz @ 2005-11-22  9:34 UTC (permalink / raw)
  To: u-boot

Hi,

I wrote:

> Maybe you want to consider the attached patch.
> 
> * Patch by Steven Scholz, 10 Jun 2005:
>    Adding loads of ntohl() in image header handling (for the sake
>    of readability)

Still in the patch queue? Or rejected/discarded?

--
Steven

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot-Users] byteorder of image_header_t members?
  2005-06-10 15:05 ` Steven Scholz
  2005-11-22  9:34   ` Steven Scholz
@ 2006-03-12  1:00   ` Wolfgang Denk
  1 sibling, 0 replies; 5+ messages in thread
From: Wolfgang Denk @ 2006-03-12  1:00 UTC (permalink / raw)
  To: u-boot

In message <42A9AC33.5020204@imc-berlin.de> you wrote:
> 
> * Patch by Steven Scholz, 10 Jun 2005:
>     Adding loads of ntohl() in image header handling (for the sake
>     of readability)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Substitute "damn" every time you're inclined to write "very"; your
editor will delete it and the writing will be just as it should be.
                - Mark Twain

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2006-03-12  1:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-10 11:51 [U-Boot-Users] byteorder of image_header_t members? Steven Scholz
2005-06-10 14:17 ` Wolfgang Denk
2005-06-10 15:05 ` Steven Scholz
2005-11-22  9:34   ` Steven Scholz
2006-03-12  1:00   ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox