Fix warning differ in signedness in common/cmd_ide.c
cover Fix warning differ in signedness in common/cmd_ide.c
common/cmd_ide.c +6 -6
@@ -1136,9 +1136,9 @@ static void ide_ident (block_dev_desc_t *dev_desc)input_swap_data (device, iobuf,ATA_SECTORWORDS ); -ident_cpy (dev_desc->revision, iop->fw_rev,sizeof (dev_desc->revision)); -ident_cpy (dev_desc->vendor, iop->model,sizeof (dev_desc->vendor)); -ident_cpy (dev_desc->product, iop->serial_no,sizeof (dev_desc->product)); +ident_cpy ((unsigned char *)dev_desc->revision, iop->fw_rev,sizeof (dev_desc->revision)); +ident_cpy ((unsigned char *)dev_desc->vendor, iop->model,sizeof (dev_desc->vendor)); +ident_cpy ((unsigned char *)dev_desc->product, iop->serial_no,sizeof (dev_desc->product));#ifdef __LITTLE_ENDIAN/* * firmware revision and model number have Big Endian Byte
@@ -1953,9 +1953,9 @@ static void atapi_inquiry(block_dev_desc_t * dev_desc)return ;/* copy device ident strings */ -ident_cpy (dev_desc->vendor,&iobuf[8 ],8 ); -ident_cpy (dev_desc->product,&iobuf[16 ],16 ); -ident_cpy (dev_desc->revision,&iobuf[32 ],5 ); +ident_cpy ((unsigned char *)dev_desc->vendor,&iobuf[8 ],8 ); +ident_cpy ((unsigned char *)dev_desc->product,&iobuf[16 ],16 ); +ident_cpy ((unsigned char *)dev_desc->revision,&iobuf[32 ],5 ); dev_desc->lun=0 ; dev_desc->lba=0 ;
Signature · 1 line
1.5.3.2
PATCH 1/2 Fix warning differ in signedness on NetSetTimeout in net/net.c and net/nfs.c
net/net.c +1 -1
@@ -598,7 +598,7 @@ void NetStartAgain (void)if (NetRestartWrap) { NetRestartWrap =0 ;if (NetDevExists && !once) { -NetSetTimeout (10 *CFG_HZ , startAgainTimeout); +NetSetTimeout ((ulong )10 *CFG_HZ , startAgainTimeout);NetSetHandler (startAgainHandler); }else { NetState =NETLOOP_FAIL ;
net/nfs.c +2 -2
@@ -669,7 +669,7 @@ NfsHandler (uchar *pkt, unsigned dest, unsigned src, unsigned len)case STATE_READ_REQ : rlen =nfs_read_reply (pkt, len); -NetSetTimeout (NFS_TIMEOUT *CFG_HZ , NfsTimeout); +NetSetTimeout ((ulong )NFS_TIMEOUT *CFG_HZ , NfsTimeout);if (rlen >0 ) { nfs_offset += rlen;NfsSend ();
@@ -758,7 +758,7 @@ NfsStart (void)printf ("\nLoad address: 0x%lx\n" "Loading: *\b" , load_addr); -NetSetTimeout (NFS_TIMEOUT *CFG_HZ , NfsTimeout); +NetSetTimeout ((ulong )NFS_TIMEOUT *CFG_HZ , NfsTimeout);NetSetHandler (NfsHandler); NfsTimeoutCount =0 ;
Signature · 1 line
1.5.3.2
PATCH 2/2 Fix warning: pointer targets in assignment differ in signedness
board/purple/flash.c +1 -1
@@ -299,7 +299,7 @@ void flash_print_info (flash_info_t *info)int i;uchar *boottype;uchar *bootletter; -uchar *fmt; +char *fmt;uchar botbootletter[] ="B" ;uchar topbootletter[] ="T" ;uchar botboottype[] ="bottom boot sector" ;
Signature · 1 line
1.5.3.2
PATCH 1/2 Fix warning differ in signedness on NetSetTimeout in net/net.c and net/nfs.c
In reply to Jean-Christophe PLAGNIOL-VILLARDQuoted 7 lines · In message <[email protected]> you wrote:
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>net/net.c +0
-0
net/net.c void NetStartAgain (void) · line 604
Quoted 8 lines
net/net.c +1
-1@@ -598,7 +598,7 @@ void NetStartAgain (void)if (NetRestartWrap) { NetRestartWrap =0 ;if (NetDevExists && !once) { -NetSetTimeout (10 *CFG_HZ , startAgainTimeout); +NetSetTimeout ((ulong )10 *CFG_HZ , startAgainTimeout);NetSetHandler (startAgainHandler); }else { NetState =NETLOOP_FAIL ;
This doesn't look right to me.
Instead of "(ulong)10 * CFG_HZ" we should probably write "10UL * CFG_HZ"
And, why do we cast the first operand to "ulong" - and not the second one, or the second one, too, or the result?
Finally, this is not the only place where this construct is used:
-> grep -n CFG_HZ net/net.c
253: if ((t - NetArpWaitTimerStart) > ARP_TIMEOUT * CFG_HZ) {
592: NetSetTimeout (10 * CFG_HZ, startAgainTimeout);
601: NetSetTimeout (10 * CFG_HZ, startAgainTimeout);
777: NetSetTimeout (10 * CFG_HZ, PingTimeout);
800:#define CDP_TIMEOUT (CFG_HZ/4) /* one packet every 250ms */
Quoted 14 lines
net/nfs.c +1
-1@@ -669,7 +669,7 @@ NfsHandler (uchar *pkt, unsigned dest, unsigned src, unsigned len)case STATE_READ_REQ : rlen =nfs_read_reply (pkt, len); -NetSetTimeout (NFS_TIMEOUT *CFG_HZ , NfsTimeout); +NetSetTimeout ((ulong )NFS_TIMEOUT *CFG_HZ , NfsTimeout);if (rlen >0 ) { nfs_offset += rlen;NfsSend ();
net/nfs.c NfsStart (void) · line 764
Quoted 8 lines
net/nfs.c +1
-1@@ -758,7 +758,7 @@ NfsStart (void)printf ("\nLoad address: 0x%lx\n" "Loading: *\b" , load_addr); -NetSetTimeout (NFS_TIMEOUT *CFG_HZ , NfsTimeout); +NetSetTimeout ((ulong )NFS_TIMEOUT *CFG_HZ , NfsTimeout);NetSetHandler (NfsHandler); NfsTimeoutCount =0 ;
The first two questions from above apply here, too.
Best regards,
Wolfgang Denk
Signature · 4 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 Status quo. Latin for "the mess we're in."
PATCH 1/1 Fix warning differ in signedness in net/net.c and net/nfs.c
net/bootp.c +1 -1
@@ -33,7 +33,7 @@#if defined(CONFIG_CMD_NET ) -#define TIMEOUT 5/* Seconds before trying BOOTP again */ +#define TIMEOUT 5UL/* Seconds before trying BOOTP again */ #ifndef CONFIG_NET_RETRY_COUNT # define TIMEOUT_COUNT 5/* # of timeouts before giving up */ #else
net/bootp.h +1 -1
@@ -88,7 +88,7 @@ typedef enum { INIT,#define DHCP_NAK 6#define DHCP_RELEASE 7 -#define SELECT_TIMEOUT 3/* Seconds to wait for offers */ +#define SELECT_TIMEOUT 3UL/* Seconds to wait for offers */ /**********************************************************************/
net/net.c +4 -4
@@ -94,7 +94,7 @@DECLARE_GLOBAL_DATA_PTR ; -#define ARP_TIMEOUT 5/* Seconds before trying ARP again */ +#define ARP_TIMEOUT 5UL/* Seconds before trying ARP again */ #ifndef CONFIG_NET_RETRY_COUNT # define ARP_TIMEOUT_COUNT 5/* # of timeouts before giving up */ #else
@@ -589,7 +589,7 @@ void NetStartAgain (void)return ; }#ifndef CONFIG_NET_MULTI -NetSetTimeout (10 *CFG_HZ , startAgainTimeout); +NetSetTimeout (10UL *CFG_HZ , startAgainTimeout);NetSetHandler (startAgainHandler);#else /* !CONFIG_NET_MULTI*/ eth_halt ();
@@ -598,7 +598,7 @@ void NetStartAgain (void)if (NetRestartWrap) { NetRestartWrap =0 ;if (NetDevExists && !once) { -NetSetTimeout (10 *CFG_HZ , startAgainTimeout); +NetSetTimeout (10UL *CFG_HZ , startAgainTimeout);NetSetHandler (startAgainHandler); }else { NetState =NETLOOP_FAIL ;
@@ -774,7 +774,7 @@ static void PingStart(void)#if defined(CONFIG_NET_MULTI )printf ("Using %s device\n" ,eth_get_name ());#endif /* CONFIG_NET_MULTI */ -NetSetTimeout (10 *CFG_HZ , PingTimeout); +NetSetTimeout (10UL *CFG_HZ , PingTimeout);NetSetHandler (PingHandler);PingSend ();
net/nfs.c +1 -1
@@ -34,7 +34,7 @@#if defined(CONFIG_CMD_NET ) && defined(CONFIG_CMD_NFS )#define HASHES_PER_LINE 65/* Number of "loading" hashes per line */ -#define NFS_TIMEOUT 60 +#define NFS_TIMEOUT 60ULstatic int fs_mounted =0 ;static unsigned long rpc_id =0 ;
net/rarp.c +1 -1
@@ -31,7 +31,7 @@#if defined(CONFIG_CMD_NET ) -#define TIMEOUT 5/* Seconds before trying BOOTP again */ +#define TIMEOUT 5UL/* Seconds before trying BOOTP again */ #ifndef CONFIG_NET_RETRY_COUNT # define TIMEOUT_COUNT 5/* # of timeouts before giving up */ #else
net/tftp.c +1 -1
@@ -15,7 +15,7 @@#if defined(CONFIG_CMD_NET )#define WELL_KNOWN_PORT 69/* Well known TFTP port # */ -#define TIMEOUT 5/* Seconds to timeout for a lost pkt */ +#define TIMEOUT 5UL/* Seconds to timeout for a lost pkt */ #ifndef CONFIG_NET_RETRY_COUNT # define TIMEOUT_COUNT 10/* # of timeouts before giving up */ #else
Signature · 1 line
1.5.3.2
Wolfgang Denk
AppliedPATCH 1/1 Fix warning differ in signedness in net/net.c and net/nfs.c
net/bootp.c
Quoted 2 lines · In message <[email protected]> you wrote:
net/bootp.c +0
-0
Applied, thanks.
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
[Doctors and Bartenders], We both get the same two kinds of customers
-- the living and the dying.
-- Dr. Boyce, "The Menagerie" ("The Cage"), stardate unknownPATCH 1/1 Fix warning differ in signedness in net/net.c and net/nfs.c
In reply to Wolfgang Denk Fix warning integer overflow in expressioni bootp.c, rarp.c and tftp.c
net/bootp.c +1 -1
@@ -33,7 +33,7 @@#if defined(CONFIG_CMD_NET ) -#define TIMEOUT 5/* Seconds before trying BOOTP again */ +#define TIMEOUT 5UL/* Seconds before trying BOOTP again */ #ifndef CONFIG_NET_RETRY_COUNT # define TIMEOUT_COUNT 5/* # of timeouts before giving up */ #else
net/bootp.h +1 -1
@@ -88,7 +88,7 @@ typedef enum { INIT,#define DHCP_NAK 6#define DHCP_RELEASE 7 -#define SELECT_TIMEOUT 3/* Seconds to wait for offers */ +#define SELECT_TIMEOUT 3UL/* Seconds to wait for offers */ /**********************************************************************/
net/net.c +4 -4
@@ -94,7 +94,7 @@DECLARE_GLOBAL_DATA_PTR ; -#define ARP_TIMEOUT 5/* Seconds before trying ARP again */ +#define ARP_TIMEOUT 5UL/* Seconds before trying ARP again */ #ifndef CONFIG_NET_RETRY_COUNT # define ARP_TIMEOUT_COUNT 5/* # of timeouts before giving up */ #else
@@ -589,7 +589,7 @@ void NetStartAgain (void)return ; }#ifndef CONFIG_NET_MULTI -NetSetTimeout (10 *CFG_HZ , startAgainTimeout); +NetSetTimeout (10UL *CFG_HZ , startAgainTimeout);NetSetHandler (startAgainHandler);#else /* !CONFIG_NET_MULTI*/ eth_halt ();
@@ -598,7 +598,7 @@ void NetStartAgain (void)if (NetRestartWrap) { NetRestartWrap =0 ;if (NetDevExists && !once) { -NetSetTimeout (10 *CFG_HZ , startAgainTimeout); +NetSetTimeout (10UL *CFG_HZ , startAgainTimeout);NetSetHandler (startAgainHandler); }else { NetState =NETLOOP_FAIL ;
@@ -774,7 +774,7 @@ static void PingStart(void)#if defined(CONFIG_NET_MULTI )printf ("Using %s device\n" ,eth_get_name ());#endif /* CONFIG_NET_MULTI */ -NetSetTimeout (10 *CFG_HZ , PingTimeout); +NetSetTimeout (10UL *CFG_HZ , PingTimeout);NetSetHandler (PingHandler);PingSend ();
net/nfs.c +1 -1
@@ -34,7 +34,7 @@#if defined(CONFIG_CMD_NET ) && defined(CONFIG_CMD_NFS )#define HASHES_PER_LINE 65/* Number of "loading" hashes per line */ -#define NFS_TIMEOUT 60 +#define NFS_TIMEOUT 60ULstatic int fs_mounted =0 ;static unsigned long rpc_id =0 ;
net/rarp.c +1 -1
@@ -31,7 +31,7 @@#if defined(CONFIG_CMD_NET ) -#define TIMEOUT 5/* Seconds before trying BOOTP again */ +#define TIMEOUT 5UL/* Seconds before trying BOOTP again */ #ifndef CONFIG_NET_RETRY_COUNT # define TIMEOUT_COUNT 5/* # of timeouts before giving up */ #else
net/tftp.c +1 -1
@@ -15,7 +15,7 @@#if defined(CONFIG_CMD_NET )#define WELL_KNOWN_PORT 69/* Well known TFTP port # */ -#define TIMEOUT 5/* Seconds to timeout for a lost pkt */ +#define TIMEOUT 5UL/* Seconds to timeout for a lost pkt */ #ifndef CONFIG_NET_RETRY_COUNT # define TIMEOUT_COUNT 10/* # of timeouts before giving up */ #else
Signature · 1 line
1.5.3.2
PATCH 1/1 Fix warning differ in signedness in net/net.c and net/nfs.c
net/bootp.c
Quoted 6 lines · In message <[email protected]> you wrote:
Fix warning integer overflow in expressioni
bootp.c,rarp.candtftp.cSigned-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>net/bootp.c +0
-0
Umm...
error: patch failed: net/bootp.c:33
error: net/bootp.c: patch does not apply
error: patch failed: net/bootp.h:88
error: net/bootp.h: patch does not apply
error: patch failed: net/net.c:94
error: net/net.c: patch does not apply
error: patch failed: net/nfs.c:34
error: net/nfs.c: patch does not apply
error: patch failed: net/rarp.c:31
error: net/rarp.c: patch does not apply
error: patch failed: net/tftp.c:15
error: net/tftp.c: patch does not apply
Using index info to reconstruct a base tree...
Falling back to patching base and 3-way merge...
No changes -- Patch already applied.
Please check!!
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 Microsoft Multimedia: You have nice graphics, sound and animations when the system crashes.
cover Fix warning differ in signedness in common/cmd_ide.c
In reply to Jean-Christophe PLAGNIOL-VILLARDHi J
Please excuse my ignorance. Your patch is of course the right fix and I verified it on my ARM boards.
A great thank you for providing the right fix and doing it so quickly.
Cheers
Marcel
[U-Boot-Users] at91rm9200 RTC
Hi:
does anybody know any errata regarding at91rm9200 internal RTC? Somehow I can set it only once. After that ACKUPD bit remains ON forver and RTC calendar register cannot be modified.
Thanks,
Leonid.
Wolfgang Denk
Appliedcover Fix warning differ in signedness in common/cmd_ide.c
In reply to Jean-Christophe PLAGNIOL-VILLARDcommon/cmd_ide.c
Quoted 4 lines · In message <[email protected]> you wrote:
Signed-off-by Jean-Christophe PLAGNIOL-VILLARD <[email protected]>common/cmd_ide.c +0
-0
Applied, thanks.
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 Military secrets are the most fleeting of all. -- Spock, "The Enterprise Incident", stardate 5027.4