Skip to contentSkip to conversation

x86: Fix warning: type qualifiers ignored on function return type

PATCH New Jean-Christophe PLAGNIOL-VILLARD 4 participants 44 messages May 18, 2008 – Jul 5, 2008

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover x86: Fix warning: type qualifiers ignored on function return type

by sync asm/byteorder.h with linux

---
 include/asm-i386/byteorder.h |  125 +++++++++++++++++++++++++++--------------
 1 files changed, 82 insertions(+), 43 deletions(-)

rewrite include/asm-i386/byteorder.h (65%)

include/asm-i386/byteorder.h +82 -43
dissimilarity index 65%
index a9c69d5..545ff75 100644
@@ -1,43 +1,82 @@
-#ifndef _I386_BYTEORDER_H
-#define _I386_BYTEORDER_H
-
-#include <asm/types.h>
-
-#ifdef __GNUC__
-
-
-static __inline__ __const__ __u32 ___arch__swab32(__u32 x)
-{
-#ifdef CONFIG_X86_BSWAP
-	__asm__("bswap %0" : "=r" (x) : "0" (x));
-#else
-	__asm__("xchgb %b0,%h0\n\t"	/* swap lower bytes	*/
-		"rorl $16,%0\n\t"	/* swap words		*/
-		"xchgb %b0,%h0"		/* swap higher bytes	*/
-		:"=q" (x)
-		: "0" (x));
-#endif
-	return x;
-}
-
-static __inline__ __const__ __u16 ___arch__swab16(__u16 x)
-{
-	__asm__("xchgb %b0,%h0"		/* swap bytes		*/ \
-		: "=q" (x) \
-		:  "0" (x)); \
-		return x;
-}
-
-#define __arch__swab32(x) ___arch__swab32(x)
-#define __arch__swab16(x) ___arch__swab16(x)
-
-#if !defined(__STRICT_ANSI__) || defined(__KERNEL__)
-#  define __BYTEORDER_HAS_U64__
-#  define __SWAB_64_THRU_32__
-#endif
-
-#endif /* __GNUC__ */
-
-#include <linux/byteorder/little_endian.h>
-
-#endif /* _I386_BYTEORDER_H */
+#ifndef _I386_BYTEORDER_H
+#define _I386_BYTEORDER_H
+
+#include <asm/types.h>
+
+#ifdef __GNUC__
+
+#define __attribute_const__ __attribute__((__const__))
+
+#ifdef __i386__
+
+static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x)
+{
+#ifdef CONFIG_X86_BSWAP
+	asm("bswap %0" : "=r" (x) : "0" (x));
+#else
+	asm("xchgb %b0,%h0\n\t"	/* swap lower bytes	*/
+	    "rorl $16,%0\n\t"	/* swap words		*/
+	    "xchgb %b0,%h0"	/* swap higher bytes	*/
+	    : "=q" (x)
+	    : "0" (x));
+#endif
+	return x;
+}
+
+static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 val)
+{
+	union {
+		struct {
+			__u32 a;
+			__u32 b;
+		} s;
+		__u64 u;
+	} v;
+	v.u = val;
+#ifdef CONFIG_X86_BSWAP
+	asm("bswapl %0 ; bswapl %1 ; xchgl %0,%1"
+	    : "=r" (v.s.a), "=r" (v.s.b)
+	    : "0" (v.s.a), "1" (v.s.b));
+#else
+	v.s.a = ___arch__swab32(v.s.a);
+	v.s.b = ___arch__swab32(v.s.b);
+	asm("xchgl %0,%1"
+	    : "=r" (v.s.a), "=r" (v.s.b)
+	    : "0" (v.s.a), "1" (v.s.b));
+#endif
+	return v.u;
+}
+
+#else /* __i386__ */
+
+static inline __attribute_const__ __u64 ___arch__swab64(__u64 x)
+{
+	asm("bswapq %0"
+	    : "=r" (x)
+	    : "0" (x));
+	return x;
+}
+
+static inline __attribute_const__ __u32 ___arch__swab32(__u32 x)
+{
+	asm("bswapl %0"
+	    : "=r" (x)
+	    : "0" (x));
+	return x;
+}
+
+#endif
+
+/* Do not define swab16.  Gcc is smart enough to recognize "C" version and
+   convert it into rotation or exhange.  */
+
+#define __arch__swab64(x) ___arch__swab64(x)
+#define __arch__swab32(x) ___arch__swab32(x)
+
+#define __BYTEORDER_HAS_U64__
+
+#endif /* __GNUC__ */
+
+#include <linux/byteorder/little_endian.h>
+
+#endif /* _I386_BYTEORDER_H */
Signature · 1 line
1.5.5.1
#1 lore raw

PATCH 1/17 example/82559_eeprom: Fix multiple warnings and errors

include/image.h: In function 'image_set_name':
include/image.h:374: warning: implicit declaration of function 'strncpy' 82559_eeprom.c: In function 'memcpy':
82559_eeprom.c:57: error: lvalue required as increment operand
82559_eeprom.c:57: error: lvalue required as increment operand
82559_eeprom.c: In function 'main':
82559_eeprom.c:318: warning: pointer targets in passing argument 2 of 'gethwaddr' differ in signedness

---
 examples/82559_eeprom.c   |   22 +++++++++++++---------
 include/asm-i386/string.h |    2 ++
 2 files changed, 15 insertions(+), 9 deletions(-)
examples/82559_eeprom.c +13 -9
index 1a121d4..587b6a4 100644
@@ -18,14 +18,13 @@
  * and release the resulting code under the GPL.
  */
 
-#define _PPC_STRING_H_		/* avoid unnecessary str/mem functions */
-#define _LINUX_STRING_H_	/* avoid unnecessary str/mem functions */
+#define __HAVE_ARCH_MEMCPY	1	/* avoid unnecessary memcpy function */
+#define _PPC_STRING_H_		1	/* avoid unnecessary str/mem functions */
 
 #include <common.h>
 #include <exports.h>
 #include <asm/io.h>
 
-
 /* Default EEPROM for i82559 */
 static unsigned short default_eeprom[64] = {
 	0x0100, 0x0302, 0x0504, 0xffff, 0xffff, 0xffff, 0xffff, 0xffff,
@@ -50,12 +49,16 @@ static inline unsigned short swap16(unsigned short x)
 	return (((x & 0xff) << 8) | ((x & 0xff00) >> 8));
 }
 
-
-static inline void *memcpy(void *dst, const void *src, unsigned int len)
+inline void *memcpy(void *dst, const void *src, unsigned int len)
 {
-	void * ret = dst;
-	while (len-- > 0) *((char *)dst)++ = *((char *)src)++;
-	return ret;
+	char *ret = dst;
+
+	while (len-- > 0) {
+		*ret++ = *((char *)src);
+		src++;
+	}
+
+	return (void *)dst;
 }
 
 /* The EEPROM commands include the alway-set leading bit. */
@@ -80,6 +83,7 @@ static inline void *memcpy(void *dst, const void *src, unsigned int len)
 static int eeprom_busy_poll(long ee_ioaddr)
 {
 	int i;
+
 	outw(EE_ENB, ee_ioaddr);
 	for (i = 0; i < 10000; i++)			/* Typical 2000 ticks */
 		if (inw(ee_ioaddr) & EE_DATA_READ)
@@ -305,7 +309,7 @@ write_config_word(int bus, int dev, int func, int reg, u16 data)
 int main (int argc, char *argv[])
 {
 	unsigned char *eth_addr;
-	char buf[6];
+	unsigned char buf[6];
 	int instance;
 
 	app_startup(argv);
include/asm-i386/string.h +2 -0
index 91a23f9..3b838b4 100644
@@ -5,6 +5,8 @@
  * We don't do inline string functions, since the
  * optimised inline asm versions are not small.
  */
+#undef __HAVE_ARCH_STRNCPY
+extern char *strncpy(char *dest, const char *src, size_t count);
 
 #undef __HAVE_ARCH_STRRCHR
 extern char * strrchr(const char * s, int c);
Signature · 1 line
1.5.5.1
#2 lore raw

PATCH 2/17 examples/eepro100_eeprom: Fix memcpy to return destination pointer

---
 examples/eepro100_eeprom.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
examples/eepro100_eeprom.c +4 -1
index 2b15d05..5f4eb78 100644
@@ -80,11 +80,13 @@ static inline short inw(long addr)
 static inline void *memcpy(void *dst, const void *src, unsigned int len)
 {
 	char *ret = dst;
+
 	while (len-- > 0) {
 		*ret++ = *((char *)src);
 		src++;
 	}
-	return (void *)ret;
+
+	return (void *)dst;
 }
 
 /* The EEPROM commands include the alway-set leading bit. */
@@ -109,6 +111,7 @@ static inline void *memcpy(void *dst, const void *src, unsigned int len)
 static int eeprom_busy_poll(long ee_ioaddr)
 {
 	int i;
+
 	outw(EE_ENB, ee_ioaddr);
 	for (i = 0; i < 10000; i++)			/* Typical 2000 ticks */
 		if (inw(ee_ioaddr) & EE_DATA_READ)
Signature · 1 line
1.5.5.1
#3 lore raw

PATCH 3/17 example/gitignore: update with all generated examples

---
 examples/.gitignore |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
examples/.gitignore +4 -0
index 059b096..806425f 100644
@@ -1,5 +1,9 @@
+/82559_eeprom
 /hello_world
 /interrupt
+/mem_to_mem_idma2intr
+/test_burst
+/timer
 /sched
 /smc91111_eeprom
 *.bin
Signature · 1 line
1.5.5.1
#4 lore raw

PATCH 4/17 i386: Fix global_data declaration

Fix a warning type in lib_i386/board.c

---
 include/asm-i386/global_data.h |    4 +---
 lib_i386/board.c               |   11 +++++------
 2 files changed, 6 insertions(+), 9 deletions(-)
include/asm-i386/global_data.h +1 -3
index 68a9ad6..9b3f7c1 100644
@@ -56,8 +56,6 @@ typedef	struct {
 #define	GD_FLG_SILENT	0x00004		/* Silent mode				*/
 #define	GD_FLG_POSTFAIL	0x00008		/* Critical POST test failed		*/
 
-extern gd_t *global_data;
-
-#define DECLARE_GLOBAL_DATA_PTR     gd_t *gd = global_data
+#define DECLARE_GLOBAL_DATA_PTR		extern gd_t *gd
 
 #endif /* __ASM_GBL_DATA_H */
lib_i386/board.c +5 -6
index 22191e6..e73f697 100644
@@ -38,6 +38,9 @@
 #include <ide.h>
 #include <asm/u-boot-i386.h>
 
+gd_t gd_data;
+gd_t *gd;
+
 DECLARE_GLOBAL_DATA_PTR;
 
 extern long _i386boot_start;
@@ -68,7 +71,6 @@ ulong i386boot_realmode_size = (ulong)&_i386boot_realmode_size; /* size of realm
 ulong i386boot_bios          = (ulong)&_i386boot_bios;          /* start of BIOS emulation code */
 ulong i386boot_bios_size     = (ulong)&_i386boot_bios_size;     /* size of BIOS emulation code */
 
-
 const char version_string[] =
 	U_BOOT_VERSION" (" __DATE__ " - " __TIME__ ")";
 
@@ -226,20 +228,17 @@ init_fnc_t *init_sequence[] = {
 	NULL,
 };
 
-gd_t *global_data;
-
 void start_i386boot (void)
 {
 	char *s;
 	int i;
 	ulong size;
-	static gd_t gd_data;
 	static bd_t bd_data;
 	init_fnc_t **init_fnc_ptr;
 
 	show_boot_progress(0x21);
 
-	gd = global_data = &gd_data;
+	gd = &gd_data;
 	/* compiler optimization barrier needed for GCC >= 3.4 */
 	__asm__ __volatile__("": : :"memory");
 
@@ -279,7 +278,7 @@ void start_i386boot (void)
 		int i;
 		ulong reg;
 		char *s, *e;
-		uchar tmp[64];
+		char tmp[64];
 
 		i = getenv_r ("ethaddr", tmp, sizeof (tmp));
 		s = (i > 0) ? tmp : NULL;
Signature · 1 line
1.5.5.1
#5 lore raw

PATCH 5/17 i386/bootm: remove unused var

---
 lib_i386/bootm.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
lib_i386/bootm.c +0 -1
index 107ebaa..d959107 100644
@@ -37,7 +37,6 @@ void do_bootm_linux(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[],
 	void		*base_ptr;
 	ulong		os_data, os_len;
 	ulong		initrd_start, initrd_end;
-	ulong		ep;
 	image_header_t	*hdr;
 	int		ret;
 #if defined(CONFIG_FIT)
Signature · 1 line
1.5.5.1
#6 lore raw

PATCH 6/17 ds1722: Fix mutliple warnings and errors and active the ssi for SC520 boards

ds1722.c:6:17: error: ssi.h: No such file or directory
ds1722.c:6:17: error: ssi.h: No such file or directory
cc1: warnings being treated as errors
ds1722.c: In function 'ds1722_select':
ds1722.c:10: warning: implicit declaration of function 'ssi_set_interface' ds1722.c:11: warning: implicit declaration of function 'ssi_chip_select' ds1722.c: In function 'ds1722_read':
ds1722.c:24: warning: implicit declaration of function 'ssi_tx_byte' ds1722.c:25: warning: implicit declaration of function 'ssi_rx_byte' ds1722.c: In function 'ds1722_probe':
ds1722.c:137: error: 'DS1722_RESOLUTION_12BIT' undeclared (first use in this function) ds1722.c:137: error: (Each undeclared identifier is reported only once ds1722.c:137: error: for each function it appears in.)

---
 drivers/hwmon/ds1722.c        |    1 +
 include/configs/sc520_cdp.h   |    1 +
 include/configs/sc520_spunk.h |    1 +
 include/ds1722.h              |   32 ++++++++++++++++++++++++++++++++
 include/ssi.h                 |   29 +++++++++++++++++++++++++++++
 5 files changed, 64 insertions(+), 0 deletions(-)
 create mode 100644 include/ds1722.h
 create mode 100644 include/ssi.h
drivers/hwmon/ds1722.c +1 -0
index c19ee01..1033a47 100644
@@ -4,6 +4,7 @@
 #ifdef CONFIG_DS1722
 
 #include <ssi.h>
+#include <ds1722.h>
 
 static void ds1722_select(int dev)
 {
include/configs/sc520_cdp.h +1 -0
index 4df461d..a810d72 100644
@@ -36,6 +36,7 @@
 #define CONFIG_X86		1	/* This is a X86 CPU		*/
 #define CONFIG_SC520		1	/* Include support for AMD SC520 */
 #define CONFIG_ALI152X		1	/* Include support for Ali 152x SIO */
+#define CONFIG_SC520_SSI	1
 
 #define CFG_SDRAM_PRECHARGE_DELAY 6     /* 6T */
 #define CFG_SDRAM_REFRESH_RATE    78    /* 7.8uS (choices are 7.8, 15.6, 31.2 or 62.5uS) */
include/configs/sc520_spunk.h +1 -0
index c6f7f15..cbb3863 100644
@@ -35,6 +35,7 @@
 
 #define CONFIG_X86		1	/* This is a X86 CPU		*/
 #define CONFIG_SC520		1	/* Include support for AMD SC520 */
+#define CONFIG_SC520_SSI	1
 
 #define CFG_SDRAM_PRECHARGE_DELAY 6     /* 6T */
 #define CFG_SDRAM_REFRESH_RATE    78    /* 7.8uS (choices are 7.8, 15.6, 31.2 or 62.5uS) */
include/ds1722.h new file +32 -0
new file mode 100644
index 0000000..44f0830
@@ -0,0 +1,32 @@
+/*
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef _DS1722_H_
+#define _DS1722_H_
+
+#define DS1722_RESOLUTION_8BIT	0x0
+#define DS1722_RESOLUTION_9BIT	0x1
+#define DS1722_RESOLUTION_10BIT	0x2
+#define DS1722_RESOLUTION_11BIT	0x3
+#define DS1722_RESOLUTION_12BIT	0x4
+
+int ds1722_probe(int dev);
+
+#endif /* _DS1722_H_ */
include/ssi.h new file +29 -0
new file mode 100644
index 0000000..ec3912b
@@ -0,0 +1,29 @@
+/*
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifdef CONFIG_SC520_SSI
+
+int ssi_set_interface(int freq, int lsb_first, int inv_clock, int inv_phase);
+u8 ssi_txrx_byte(u8 data);
+void ssi_tx_byte(u8 data);
+u8 ssi_rx_byte(void);
+void ssi_chip_select(int dev);
+
+#endif
Signature · 1 line
1.5.5.1
#7 lore raw

PATCH 7/17 drivers/pcmcia: add missing i82365

---
 drivers/pcmcia/Makefile |    1 +
 drivers/pcmcia/i82365.c |    4 ----
 2 files changed, 1 insertions(+), 4 deletions(-)
drivers/pcmcia/Makefile +1 -0
index bba1ab8..53a485d 100644
@@ -25,6 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB 	:= $(obj)libpcmcia.a
 
+COBJS-$(CONFIG_I82365) += i82365.o
 COBJS-y += mpc8xx_pcmcia.o
 COBJS-y += pxa_pcmcia.o
 COBJS-y += rpx_pcmcia.o
drivers/pcmcia/i82365.c +0 -4
index a40fcf4..1e2431e 100644
@@ -31,8 +31,6 @@
 
 #include <common.h>
 
-#ifdef CONFIG_I82365
-
 #include <command.h>
 #include <pci.h>
 #include <pcmcia.h>
@@ -1010,5 +1008,3 @@ static void i82365_dump_regions (pci_dev_t dev)
 		ide[4], ide[5], ide[6], ide[7]);
 }
 #endif	/* DEBUG */
-
-#endif /* CONFIG_I82365 */
Signature · 1 line
1.5.5.1
#8 lore raw

PATCH 8/17 marabun_pcmcia: Move compile condition to the Makefile

---
 drivers/pcmcia/Makefile         |    2 +-
 drivers/pcmcia/marubun_pcmcia.c |    7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)
drivers/pcmcia/Makefile +1 -1
index 53a485d..59be49c 100644
@@ -31,7 +31,7 @@ COBJS-y += pxa_pcmcia.o
 COBJS-y += rpx_pcmcia.o
 COBJS-y += ti_pci1410a.o
 COBJS-y += tqm8xx_pcmcia.o
-COBJS-y += marubun_pcmcia.o
+COBJS-$(CONFIG_MARUBUN_PCCARD) += marubun_pcmcia.o
 
 COBJS	:= $(COBJS-y)
 SRCS 	:= $(COBJS:.o=.c)
drivers/pcmcia/marubun_pcmcia.c +3 -4
index 2479a66..ab5030c 100644
@@ -31,12 +31,11 @@
 #define	CONFIG_PCMCIA
 #endif
 
-#if	defined(CONFIG_CMD_IDE)
+#if defined(CONFIG_CMD_IDE)
 #define	CONFIG_PCMCIA
 #endif
 
-#if	defined(CONFIG_PCMCIA)  \
-	        && (defined(CONFIG_MARUBUN_PCCARD))
+#if defined(CONFIG_PCMCIA)
 
 /* MR-SHPC-01 register */
 #define MRSHPC_MODE   	(CFG_MARUBUN_MRSHPC + 4)
@@ -112,4 +111,4 @@ int pcmcia_off (void)
 	return 0;
 }
 
-#endif /* CONFIG_MARUBUN_PCCARD */
+#endif /* CONFIG_PCMCIA */
Signature · 1 line
1.5.5.1
#9 lore raw

PATCH 9/17 pxa_pcmcia: Move compile condition to the Makefile

---
 drivers/pcmcia/Makefile     |    2 +-
 drivers/pcmcia/pxa_pcmcia.c |    4 ----
 2 files changed, 1 insertions(+), 5 deletions(-)
drivers/pcmcia/Makefile +1 -1
index 59be49c..439f839 100644
@@ -27,7 +27,7 @@ LIB 	:= $(obj)libpcmcia.a
 
 COBJS-$(CONFIG_I82365) += i82365.o
 COBJS-y += mpc8xx_pcmcia.o
-COBJS-y += pxa_pcmcia.o
+COBJS-$(CONFIG_PXA_PCMCIA) += pxa_pcmcia.o
 COBJS-y += rpx_pcmcia.o
 COBJS-y += ti_pci1410a.o
 COBJS-y += tqm8xx_pcmcia.o
drivers/pcmcia/pxa_pcmcia.c +0 -4
index 65427ef..11d8590 100644
@@ -1,8 +1,6 @@
 #include <common.h>
 #include <config.h>
 
-#ifdef CONFIG_PXA_PCMCIA
-
 #include <pcmcia.h>
 #include <asm/arch/pxa-regs.h>
 #include <asm/io.h>
@@ -93,5 +91,3 @@ int pcmcia_off (void)
 	return 0;
 }
 #endif
-
-#endif /* CONFIG_PXA_PCMCIA */
Signature · 1 line
1.5.5.1
#10 lore raw

PATCH 10/17 pcmcia/ti_pci1410a: Move compile condition to the Makefile

---
 drivers/pcmcia/Makefile      |    2 +-
 drivers/pcmcia/ti_pci1410a.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/pcmcia/Makefile +1 -1
index 439f839..a5270f7 100644
@@ -29,7 +29,7 @@ COBJS-$(CONFIG_I82365) += i82365.o
 COBJS-y += mpc8xx_pcmcia.o
 COBJS-$(CONFIG_PXA_PCMCIA) += pxa_pcmcia.o
 COBJS-y += rpx_pcmcia.o
-COBJS-y += ti_pci1410a.o
+COBJS-$(CONFIG_IDE_TI_CARDBUS) += ti_pci1410a.o
 COBJS-y += tqm8xx_pcmcia.o
 COBJS-$(CONFIG_MARUBUN_PCCARD) += marubun_pcmcia.o
 
drivers/pcmcia/ti_pci1410a.c +2 -2
index 208ca50..c876d0c 100644
@@ -64,7 +64,7 @@
 
 #include <pcmcia.h>
 
-#if defined(CONFIG_CMD_PCMCIA) && defined(CONFIG_IDE_TI_CARDBUS)
+#if defined(CONFIG_CMD_PCMCIA)
 
 int pcmcia_on(int ide_base_bus);
 
@@ -662,4 +662,4 @@ static int identify(volatile uchar *p)
 	return 0;	/* don't know */
 }
 
-#endif /* CONFIG_IDE_TI_CARDBUS */
+#endif /* CONFIG_CMD_PCMCIA */
Signature · 1 line
1.5.5.1
#11 lore raw

PATCH 11/17 Include pcmcia.h only when the drivers is used

to avoid the following errors :

include/pcmcia.h:72:3: error: #error "PCMCIA Slot not configured" include/pcmcia.h:79:2: error: #error Neither CONFIG_PCMCIA_SLOT_A nor CONFIG_PCMCIA_SLOT_B configured

---
 drivers/pcmcia/mpc8xx_pcmcia.c |    2 +-
 drivers/pcmcia/rpx_pcmcia.c    |    2 +-
 drivers/pcmcia/tqm8xx_pcmcia.c |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
drivers/pcmcia/mpc8xx_pcmcia.c +1 -1
index 8a34cd3..a4533eb 100644
@@ -2,7 +2,6 @@
 #if defined(CONFIG_8xx)
 #include <mpc8xx.h>
 #endif
-#include <pcmcia.h>
 
 #undef	CONFIG_PCMCIA
 
@@ -15,6 +14,7 @@
 #endif
 
 #if defined(CONFIG_8xx)	&& defined(CONFIG_PCMCIA)
+#include <pcmcia.h>
 
 #if	defined(CONFIG_IDE_8xx_PCCARD)
 extern int check_ide_device (int slot);
drivers/pcmcia/rpx_pcmcia.c +1 -1
index c7c425b..11c6a13 100644
@@ -5,7 +5,6 @@
 #ifdef CONFIG_8xx
 #include <mpc8xx.h>
 #endif
-#include <pcmcia.h>
 
 #undef	CONFIG_PCMCIA
 
@@ -19,6 +18,7 @@
 
 #if	defined(CONFIG_PCMCIA)	\
 	&& (defined(CONFIG_RPXCLASSIC) || defined(CONFIG_RPXLITE))
+#include <pcmcia.h>
 
 #define	PCMCIA_BOARD_MSG	"RPX CLASSIC or RPX LITE"
 
drivers/pcmcia/tqm8xx_pcmcia.c +1 -1
index 132c7a5..4b2fb2f 100644
@@ -6,7 +6,6 @@
 #ifdef CONFIG_8xx
 #include <mpc8xx.h>
 #endif
-#include <pcmcia.h>
 
 #undef	CONFIG_PCMCIA
 
@@ -20,6 +19,7 @@
 
 #if	defined(CONFIG_PCMCIA)	\
 	&& (defined(CONFIG_TQM8xxL) || defined(CONFIG_SVM_SC8xx))
+#include <pcmcia.h>
 
 #if	defined(CONFIG_VIRTLAB2)
 #define	PCMCIA_BOARD_MSG	"Virtlab2"
Signature · 1 line
1.5.5.1
#12 lore raw

PATCH 12/17 ti_pci1410a: Fix multiple warnings and errors

ti_pci1410a.c: In function 'voltage_set':
ti_pci1410a.c:421: error: label at end of compound statement
ti_pci1410a.c:435: error: label at end of compound statement
cc1: warnings being treated as errors
ti_pci1410a.c: At top level:
ti_pci1410a.c:609: warning: pointer targets in initialization differ in signedness ti_pci1410a.c: In function 'identify':
ti_pci1410a.c:651: warning: pointer targets in passing argument 1 of 'puts' differ in signedness ti_pci1410a.c:656: warning: pointer targets in passing argument 1 of 'strcmp' differ in signedness ti_pci1410a.c:656: warning: pointer targets in passing argument 2 of 'strcmp' differ in signedness

remove do_pinit allready implement in cmd_pcmcia.c
Fix pcmcia_{on,off} protoptype and add it in definition to pcmcia.h

---
 drivers/pcmcia/ti_pci1410a.c |   61 +++++++++--------------------------------
 include/pcmcia.h             |    2 +
 2 files changed, 16 insertions(+), 47 deletions(-)
drivers/pcmcia/ti_pci1410a.c +14 -47
index c876d0c..d37e5a8 100644
@@ -62,13 +62,10 @@
 #include <pci.h>
 #include <asm/io.h>
 
-#include <pcmcia.h>
-
 #if defined(CONFIG_CMD_PCMCIA)
 
-int pcmcia_on(int ide_base_bus);
+#include <pcmcia.h>
 
-static int  pcmcia_off(void);
 static int  hardware_disable(int slot);
 static int  hardware_enable(int slot);
 static int  voltage_set(int slot, int vcc, int vpp);
@@ -77,42 +74,13 @@ static void print_fixed(volatile uchar *p);
 static int  identify(volatile uchar *p);
 static int  check_ide_device(int slot, int ide_base_bus);
 
-
 /* ------------------------------------------------------------------------- */
 
-
 const char *indent = "\t   ";
 
 /* ------------------------------------------------------------------------- */
 
 
-int do_pinit(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
-{
-#ifndef CFG_FIRST_PCMCIA_BUS
-# define CFG_FIRST_PCMCIA_BUS 0
-#endif
-
-	int rcode = 0;
-
-	if (argc != 2) {
-		printf ("Usage: pinit {on | off}\n");
-		return 1;
-	}
-	if (strcmp(argv[1],"on") == 0) {
-		rcode = pcmcia_on(CFG_FIRST_PCMCIA_BUS);
-	} else if (strcmp(argv[1],"off") == 0) {
-		rcode = pcmcia_off();
-	} else {
-		printf ("Usage: pinit {on | off}\n");
-		return 1;
-	}
-
-	return rcode;
-}
-
-/* ------------------------------------------------------------------------- */
-
-
 static struct pci_device_id supported[] = {
 	{ PCI_VENDOR_ID_TI, 0xac50 }, /* Ti PCI1410A */
 	{ PCI_VENDOR_ID_TI, 0xac56 }, /* Ti PCI1510 */
@@ -123,15 +91,18 @@ static pci_dev_t devbusfn;
 static u32 socket_base;
 static u32 pcmcia_cis_ptr;
 
-int pcmcia_on(int ide_base_bus)
+int pcmcia_on(void)
 {
+#ifndef CFG_FIRST_PCMCIA_BUS
+# define CFG_FIRST_PCMCIA_BUS 0
+#endif
 	u16 dev_id;
 	u32 socket_status;
 	int slot = 0;
 	int cis_len;
 	u16 io_base;
 	u16 io_len;
-
+	int ide_base_bus = CFG_FIRST_PCMCIA_BUS;
 	/*
 	 * Find the CardBus PCI device(s).
 	 */
@@ -244,8 +215,7 @@ int pcmcia_on(int ide_base_bus)
 
 /* ------------------------------------------------------------------------- */
 
-
-static int pcmcia_off (void)
+int pcmcia_off (void)
 {
 	int slot = 0;
 
@@ -285,10 +255,8 @@ static int pcmcia_off (void)
 	return 0;
 }
 
-
 /* ------------------------------------------------------------------------- */
 
-
 #define	MAX_TUPEL_SZ	512
 #define MAX_FEATURES	4
 int ide_devices_found;
@@ -392,7 +360,6 @@ static int check_ide_device(int slot, int ide_base_bus)
 	return 0;
 }
 
-
 static int voltage_set(int slot, int vcc, int vpp)
 {
 	u32 socket_control;
@@ -418,6 +385,7 @@ static int voltage_set(int slot, int vcc, int vpp)
 		break;
 	case 0:
 	default:
+		break;
 	}
 
 	switch (vpp) {
@@ -432,6 +400,7 @@ static int voltage_set(int slot, int vcc, int vpp)
 		break;
 	case 0:
 	default:
+		break;
 	}
 
 	writel(socket_control, reg);
@@ -443,7 +412,6 @@ static int voltage_set(int slot, int vcc, int vpp)
 	return 0;
 }
 
-
 static int hardware_enable(int slot)
 {
 	u32 socket_status;
@@ -490,7 +458,6 @@ static int hardware_enable(int slot)
 	return ((readb(socket_base+0x801)&0x6c)==0x6c)?0:1;
 }
 
-
 static int hardware_disable(int slot)
 {
 	voltage_set(slot, 0, 0);
@@ -605,17 +572,17 @@ static void print_fixed(volatile uchar *p)
 #define MAX_IDENT_CHARS		64
 #define	MAX_IDENT_FIELDS	4
 
-static uchar *known_cards[] = {
+static char *known_cards[] = {
 	"ARGOSY PnPIDE D5",
 	NULL
 };
 
 static int identify(volatile uchar *p)
 {
-	uchar id_str[MAX_IDENT_CHARS];
+	char id_str[MAX_IDENT_CHARS];
 	uchar data;
-	uchar *t;
-	uchar **card;
+	char *t;
+	char **card;
 	int i, done;
 
 	if (p == NULL)
@@ -648,7 +615,7 @@ static int identify(volatile uchar *p)
 			break;
 		}
 	}
-	puts(id_str);
+	puts((char*)id_str);
 	putc('\n');
 
 	for (card=known_cards; *card; ++card) {
include/pcmcia.h +2 -0
index 7305805..cc4c78c 100644
@@ -318,4 +318,6 @@ extern u_int *pcmcia_pgcrx[];
 extern int check_ide_device(int slot);
 #endif
 
+int pcmcia_off(void);
+int pcmcia_on(void);
 #endif /* _PCMCIA_H */
Signature · 1 line
1.5.5.1
#13 lore raw

PATCH 13/17 sc520_spunk: Fix multiple warnings

sc520_spunk.c: In function 'pci_sc520_spunk_fixup_irq':
sc520_spunk.c:117: warning: pointer targets in passing argument 4 of 'pci_hose_read_config_byte' differ in signedness sc520_spunk.c: In function 'last_stage_init':
sc520_spunk.c:580: warning: implicit declaration of function 'ds1722_probe'
sc520_spunk.c: In function 'spi_init_f':
sc520_spunk.c:643: warning: implicit declaration of function 'spi_eeprom_probe'
sc520_spunk.c:644: warning: implicit declaration of function 'mw_eeprom_probe'
sc520_spunk.c: In function 'spi_read':
sc520_spunk.c:660: warning: implicit declaration of function 'spi_eeprom_read'
sc520_spunk.c:661: warning: implicit declaration of function 'mw_eeprom_read'
sc520_spunk.c: In function 'spi_write':
sc520_spunk.c:676: warning: implicit declaration of function 'spi_eeprom_write'
sc520_spunk.c:677: warning: implicit declaration of function 'mw_eeprom_write'

adding mw_eeprom header

---
 board/sc520_spunk/sc520_spunk.c |   17 ++++++++++++++++-
 include/mw_eeprom.h             |   27 +++++++++++++++++++++++++++
 2 files changed, 43 insertions(+), 1 deletions(-)
 create mode 100644 include/mw_eeprom.h
board/sc520_spunk/sc520_spunk.c +16 -1
index d119a7d..6f5e636 100644
@@ -28,6 +28,8 @@
 #include <asm/io.h>
 #include <asm/pci.h>
 #include <asm/ic/sc520.h>
+#include <ds1722.h>
+#include <mw_eeprom.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -111,7 +113,7 @@ static void pci_sc520_spunk_fixup_irq(struct pci_controller *hose, pci_dev_t dev
 	};
 	static int next_irq_index=0;
 
-	char tmp_pin;
+	u8 tmp_pin;
 	int pin;
 
 	pci_hose_read_config_byte(hose, dev, PCI_INTERRUPT_PIN, &tmp_pin);
@@ -636,6 +638,19 @@ void ssi_chip_select(int dev)
 	}
 }
 
+void spi_eeprom_probe(int x)
+{
+}
+
+int spi_eeprom_read(int x, int offset, uchar *buffer, int len)
+{
+	return 0;
+}
+
+int spi_eeprom_write(int x, int offset, uchar *buffer, int len)
+{
+	return 0;
+}
 
 void spi_init_f(void)
 {
include/mw_eeprom.h new file +27 -0
new file mode 100644
index 0000000..9ddd266
@@ -0,0 +1,27 @@
+/*
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+#ifndef _MW_EEPROM_H_
+#define _MW_EEPROM_H_
+
+int mw_eeprom_probe(int dev);
+int mw_eeprom_write(int dev, int addr, u8 *buffer, int len);
+int mw_eeprom_read(int dev, int addr, u8 *buffer, int len);
+#endif /* _MW_EEPROM_H_ */
Signature · 1 line
1.5.5.1
#14 lore raw

PATCH 14/17 sc520_spunk: Fix flash

flash.c:593: warning: dereferencing type-punned pointer will break strict-aliasing rules flash.c:398: error: label at end of compound statement

---
 board/sc520_spunk/flash.c |   30 ++++++------------------------
 1 files changed, 6 insertions(+), 24 deletions(-)
board/sc520_spunk/flash.c +6 -24
index 4942e59..0b4bf68 100644
@@ -33,7 +33,6 @@
 #define PROBE_BUFFER_SIZE 1024
 static unsigned char buffer[PROBE_BUFFER_SIZE];
 
-
 #define SC520_MAX_FLASH_BANKS  1
 #define SC520_FLASH_BANK0_BASE 0x38000000  /* BOOTCS */
 #define SC520_FLASH_BANKSIZE   0x8000000
@@ -62,7 +61,6 @@ flash_info_t    flash_info[SC520_MAX_FLASH_BANKS];
 /*-----------------------------------------------------------------------
  */
 
-
 static u32 _probe_flash(u32 addr, u32 bw, int il)
 {
 	u32 result=0;
@@ -180,7 +178,6 @@ static u32 _probe_flash(u32 addr, u32 bw, int il)
 		break;
 	}
 
-
 	return result;
 }
 
@@ -215,11 +212,9 @@ static int identify_flash(unsigned address, int width)
 		enable_interrupts();
 	}
 
-
 	vendor = res >> 16;
 	device = res & 0xffff;
 
-
 	return res;
 }
 
@@ -385,7 +380,6 @@ void flash_print_info(flash_info_t *info)
 		break;
 	}
 
-
 	printf("  Size: %ld MB in %d Sectors\n",
 	       info->size >> 20, info->sector_count);
 
@@ -399,13 +393,13 @@ void flash_print_info(flash_info_t *info)
 	}
 	printf ("\n");
 
-	done:
+done:
+	return;
 }
 
 /*-----------------------------------------------------------------------
  */
 
-
 static u32 _amd_erase_flash(u32 addr, u32 sector)
 {
 	unsigned elapsed;
@@ -467,7 +461,6 @@ static u32 _intel_erase_flash(u32 addr, u32 sector)
 	*(volatile u16*)(addr + sector) = 0x0020;   /* erase setup */
 	*(volatile u16*)(addr + sector) = 0x00D0;   /* erase confirm */
 
-
 	/* Wait at least 80us - let's wait 1 ms */
 	__udelay(1000);
 
@@ -486,7 +479,6 @@ static u32 _intel_erase_flash(u32 addr, u32 sector)
 	return 0;
 }
 
-
 extern int _intel_erase_flash_end;
 asm ("_intel_erase_flash_end:\n"
      ".long 0\n");
@@ -548,7 +540,6 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
 		printf ("\n");
 	}
 
-
 	/* Start erase on unprotected sectors */
 	for (sect = s_first; sect<=s_last; sect++) {
 
@@ -566,7 +557,6 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
 				enable_interrupts();
 			}
 
-
 			if (res) {
 				printf("Erase timed out, sector %d\n", sect);
 				return res;
@@ -576,7 +566,6 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
 		}
 	}
 
-
 	return 0;
 }
 
@@ -586,11 +575,11 @@ int flash_erase(flash_info_t *info, int s_first, int s_last)
  * 1 - write timeout
  * 2 - Flash not erased
  */
-static int _amd_write_word(unsigned start, unsigned dest, unsigned data)
+static int _amd_write_word(unsigned start, unsigned dest, u16 data)
 {
-	volatile u16 *addr2 = (u16*)start;
-	volatile u16 *dest2 = (u16*)dest;
-	volatile u16 *data2 = (u16*)&data;
+	volatile u16 *addr2 = (volatile u16*)start;
+	volatile u16 *dest2 = (volatile u16*)dest;
+	volatile u16 *data2 = (volatile u16*)&data;
 	int i;
 	unsigned elapsed;
 
@@ -601,7 +590,6 @@ static int _amd_write_word(unsigned start, unsigned dest, unsigned data)
 
 	for (i = 0; i < 2; i++) {
 
-
 		addr2[0x5555] = 0x00AA;
 		addr2[0x2aaa] = 0x0055;
 		addr2[0x5555] = 0x00A0;
@@ -630,7 +618,6 @@ extern int _amd_write_word_end;
 asm ("_amd_write_word_end:\n"
      ".long 0\n");
 
-
 static int _intel_write_word(unsigned start, unsigned dest, unsigned data)
 {
 	int i;
@@ -663,14 +650,12 @@ static int _intel_write_word(unsigned start, unsigned dest, unsigned data)
 
 
 	return 0;
-
 }
 
 extern int _intel_write_word_end;
 asm ("_intel_write_word_end:\n"
      ".long 0\n");
 
-
 /*-----------------------------------------------------------------------
  * Copy memory to flash, returns:
  * 0 - OK
@@ -715,10 +700,8 @@ int write_buff(flash_info_t *info, uchar *src, ulong addr, ulong cnt)
 		return 3;
 	}
 
-
 	wp = (addr & ~3);	/* get lower word aligned address */
 
-
 	/*
 	 * handle unaligned start bytes
 	 */
@@ -805,5 +788,4 @@ int write_buff(flash_info_t *info, uchar *src, ulong addr, ulong cnt)
 	}
 
 	return rc;
-
 }
Signature · 1 line
1.5.5.1
#15 lore raw

PATCH 15/17 sc530_spunk: add missing SOBJS entry

---
 board/sc520_spunk/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
board/sc520_spunk/Makefile +1 -1
index bfb77e8..226c756 100644
@@ -36,7 +36,7 @@ OBJS	:= $(addprefix $(obj),$(COBJS))
 SOBJS	:= $(addprefix $(obj),$(SOBJS))
 
 $(LIB):	$(obj).depend $(OBJS) $(SOBJS)
-	$(AR) $(ARFLAGS) $@ $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS) $(SOBJS)
 
 clean:
 	rm -f $(SOBJS) $(OBJS)
Signature · 1 line
1.5.5.1
#16 lore raw

PATCH 16/17 i386: Fix multipple definition of __show_boot_progress

board/sc520_spunk/libsc520_spunk.a(sc520_spunk_asm.o): In function '__show_boot_progress':
board/sc520_spunk/sc520_spunk_asm.S:78: multiple definition of '__show_boot_progress' common/libcommon.a(main.o):common/main.c:50: first defined here

---
 board/sc520_cdp/sc520_cdp_asm.S     |    4 ++--
 board/sc520_spunk/sc520_spunk_asm.S |    4 ++--
 cpu/i386/start.S                    |   20 ++++++++++----------
 3 files changed, 14 insertions(+), 14 deletions(-)
board/sc520_cdp/sc520_cdp_asm.S +2 -2
index be7b2bb..7f70d65 100644
@@ -76,8 +76,8 @@ done:   movb	$0x88, %al
 	jmp 	*%ebp		     /* return to caller */
 
 
-.globl __show_boot_progress
-__show_boot_progress:
+.globl show_boot_progress
+show_boot_progress:
 	out	%al, $0x80
 	xchg	%al, %ah
 	movw	$0x680, %dx
board/sc520_spunk/sc520_spunk_asm.S +2 -2
index 8b34103..0127076 100644
@@ -73,8 +73,8 @@ done:   movl    $0xfffefc32,%edx
 	jmp 	*%ebp		     /* return to caller */
 
 
-.globl __show_boot_progress
-__show_boot_progress:
+.globl show_boot_progress
+show_boot_progress:
 	movl    $0xfffefc32,%edx
 	xorw    $0xffff, %ax
 	movw    %ax,(%edx)
cpu/i386/start.S +10 -10
index 1a54dd1..51a27aa 100644
@@ -55,7 +55,7 @@ early_board_init_ret:
 	/* so we try to indicate progress */
 	movw	$0x01, %ax
 	movl	$.progress0, %ebp
-	jmp	__show_boot_progress
+	jmp	show_boot_progress
 .progress0:
 
 	/* size memory */
@@ -74,7 +74,7 @@ mem_init_ret:
 	/* indicate (lack of) progress */
 	movw	$0x81, %ax
 	movl	$.progress0a, %ebp
-	jmp	__show_boot_progress
+	jmp	show_boot_progress
 .progress0a:
 	jmp 	die
 mem_ok:
@@ -82,7 +82,7 @@ mem_ok:
 	/* indicate progress */
 	movw	$0x02, %ax
 	movl	$.progress1, %ebp
-	jmp	__show_boot_progress
+	jmp	show_boot_progress
 .progress1:
 
 	/* create a stack after the bss */
@@ -104,7 +104,7 @@ no_stack:
 	/* indicate (lack of) progress */
 	movw	$0x82, %ax
 	movl	$.progress1a, %ebp
-	jmp	__show_boot_progress
+	jmp	show_boot_progress
 .progress1a:
 	jmp die
 
@@ -113,7 +113,7 @@ stack_ok:
 	/* indicate progress */
 	movw	$0x03, %ax
 	movl	$.progress2, %ebp
-	jmp	__show_boot_progress
+	jmp	show_boot_progress
 .progress2:
 
 	/* copy data section to ram, size must be 4-byte aligned */
@@ -136,7 +136,7 @@ data_fail:
 	/* indicate (lack of) progress */
 	movw	$0x83, %ax
 	movl	$.progress2a, %ebp
-	jmp	__show_boot_progress
+	jmp	show_boot_progress
 .progress2a:
 	jmp 	die
 
@@ -145,7 +145,7 @@ data_ok:
 	/* indicate progress */
 	movw	$0x04, %ax
 	movl	$.progress3, %ebp
-	jmp	__show_boot_progress
+	jmp	show_boot_progress
 .progress3:
 
 	/* clear bss section in ram, size must be 4-byte aligned  */
@@ -168,7 +168,7 @@ bss_fail:
 	/* indicate (lack of) progress */
 	movw	$0x84, %ax
 	movl	$.progress3a, %ebp
-	jmp	__show_boot_progress
+	jmp	show_boot_progress
 .progress3a:
 	jmp 	die
 
@@ -180,7 +180,7 @@ bss_ok:
 	/* indicate progress */
 	movw	$0x05, %ax
 	movl	$.progress4, %ebp
-	jmp	__show_boot_progress
+	jmp	show_boot_progress
 .progress4:
 
 	call	start_i386boot  /* Enter, U-boot! */
@@ -188,7 +188,7 @@ bss_ok:
 	/* indicate (lack of) progress */
 	movw	$0x85, %ax
 	movl	$.progress4a, %ebp
-	jmp	__show_boot_progress
+	jmp	show_boot_progress
 .progress4a:
 
 die:	hlt
Signature · 1 line
1.5.5.1
#17 lore raw

PATCH 17/17 sc520_cdp: Fix multiple warnings

sc520_cdp.c: In function 'pci_sc520_cdp_fixup_irq':
sc520_cdp.c:134: warning: pointer targets in passing argument 4 of 'pci_hose_read_config_byte' differ in signedness sc520_cdp.c: In function 'spi_read':
sc520_cdp.c:598: warning: pointer targets in passing argument 3 of 'spi_eeprom_read' differ in signedness sc520_cdp.c: In function 'spi_write':
sc520_cdp.c:622: warning: pointer targets in passing argument 3 of 'spi_eeprom_write' differ in signedness

---
 board/sc520_cdp/sc520_cdp.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
board/sc520_cdp/sc520_cdp.c +5 -5
index f6f0e72..9828024 100644
@@ -128,7 +128,7 @@ static void pci_sc520_cdp_fixup_irq(struct pci_controller *hose, pci_dev_t dev)
 	};
 	static int next_irq_index=0;
 
-	char tmp_pin;
+	u8 tmp_pin;
 	int pin;
 
 	pci_hose_read_config_byte(hose, dev, PCI_INTERRUPT_PIN, &tmp_pin);
@@ -562,14 +562,14 @@ void spi_eeprom_probe(int x)
 {
 }
 
-int spi_eeprom_read(int x, int offset, char *buffer, int len)
+int spi_eeprom_read(int x, int offset, uchar *buffer, int len)
 {
-       return 0;
+	return 0;
 }
 
-int spi_eeprom_write(int x, int offset, char *buffer, int len)
+int spi_eeprom_write(int x, int offset, uchar *buffer, int len)
 {
-       return 0;
+	return 0;
 }
 
 void spi_init_f(void)
Signature · 1 line
1.5.5.1
#18 lore raw

PATCH 17/17 sc520_cdp: Fix multiple warnings

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

sc520_cdp.c: In function 'pci_sc520_cdp_fixup_irq':
sc520_cdp.c:134: warning: pointer targets in passing argument 4 of 'pci_hose_read_config_byte' differ in signedness sc520_cdp.c: In function 'spi_read':
sc520_cdp.c:598: warning: pointer targets in passing argument 3 of 'spi_eeprom_read' differ in signedness sc520_cdp.c: In function 'spi_write':
sc520_cdp.c:622: warning: pointer targets in passing argument 3 of 'spi_eeprom_write' differ in signedness

---
 board/sc520_cdp/sc520_cdp.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
board/sc520_cdp/sc520_cdp.c +0 -0
index f6f0e72..9828024 100644

board/sc520_cdp/sc520_cdp.c static void pci_sc520_cdp_fixup_irq(struct pci_controller *hose, pci_dev_t dev) · line 131

Quoted 5 lines
board/sc520_cdp/sc520_cdp.c +1 -1
@@ -128,7 +128,7 @@ static void pci_sc520_cdp_fixup_irq(struct pci_controller *hose, pci_dev_t dev)
 	};
 	static int next_irq_index=0;
 
-	char tmp_pin;
+	u8 tmp_pin;

Please use uchar here, too. 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
Every program has at least one bug and can be shortened by  at  least
one  instruction  --  from  which,  by induction, one can deduce that
every program can be reduced to one instruction which doesn't work.
#19 lore raw

PATCH 16/17 i386: Fix multipple definition of __show_boot_progress

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 10 lines · In message <[email protected]> you wrote:

board/sc520_spunk/libsc520_spunk.a(sc520_spunk_asm.o): In function '__show_boot_progress':
board/sc520_spunk/sc520_spunk_asm.S:78: multiple definition of '__show_boot_progress' common/libcommon.a(main.o):common/main.c:50: first defined here

---
 board/sc520_cdp/sc520_cdp_asm.S     |    4 ++--
 board/sc520_spunk/sc520_spunk_asm.S |    4 ++--
 cpu/i386/start.S                    |   20 ++++++++++----------
 3 files changed, 14 insertions(+), 14 deletions(-)

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
Vulcans never bluff.
	-- Spock, "The Doomsday Machine", stardate 4202.1
#20 lore raw

PATCH 15/17 sc530_spunk: add missing SOBJS entry

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 4 lines · In message <[email protected]> you wrote:
---
 board/sc520_spunk/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

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
"Security is mostly a superstition. It does not  exist  in  nature...
Life is either a daring adventure or nothing."         - Helen Keller
#21 lore raw

PATCH 14/17 sc520_spunk: Fix flash

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 7 lines · In message <[email protected]> you wrote:

flash.c:593: warning: dereferencing type-punned pointer will break strict-aliasing rules flash.c:398: error: label at end of compound statement

---
 board/sc520_spunk/flash.c |   30 ++++++------------------------
 1 files changed, 6 insertions(+), 24 deletions(-)

Applied, thanks.

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
Overdrawn?  But I still have checks left!
#22 lore raw

PATCH 13/17 sc520_spunk: Fix multiple warnings

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 14 lines · In message <[email protected]> you wrote:

sc520_spunk.c: In function 'pci_sc520_spunk_fixup_irq':
sc520_spunk.c:117: warning: pointer targets in passing argument 4 of 'pci_hose_read_config_byte' differ in signedness sc520_spunk.c: In function 'last_stage_init':
sc520_spunk.c:580: warning: implicit declaration of function 'ds1722_probe'
sc520_spunk.c: In function 'spi_init_f':
sc520_spunk.c:643: warning: implicit declaration of function 'spi_eeprom_probe'
sc520_spunk.c:644: warning: implicit declaration of function 'mw_eeprom_probe'
sc520_spunk.c: In function 'spi_read':
sc520_spunk.c:660: warning: implicit declaration of function 'spi_eeprom_read'
sc520_spunk.c:661: warning: implicit declaration of function 'mw_eeprom_read'
sc520_spunk.c: In function 'spi_write':
sc520_spunk.c:676: warning: implicit declaration of function 'spi_eeprom_write'
sc520_spunk.c:677: warning: implicit declaration of function 'mw_eeprom_write'

Quoted 1 line

adding mw_eeprom header

Frankly, such a commit message is useless. What is it supposed to tell me?

board/sc520_spunk/sc520_spunk.c static void pci_sc520_spunk_fixup_irq(struct pci_controller *hose, pci_dev_t dev · line 116

Quoted 2 lines
board/sc520_spunk/sc520_spunk.c +1 -1
-	char tmp_pin;
+	u8 tmp_pin;

Please use uchar if you really want an unsigned character type.

board/sc520_spunk/sc520_spunk.c void ssi_chip_select(int dev) · line 653

Quoted 13 lines
board/sc520_spunk/sc520_spunk.c +13 -0
+void spi_eeprom_probe(int x)
+{
+}
+
+int spi_eeprom_read(int x, int offset, uchar *buffer, int len)
+{
+	return 0;
+}
+
+int spi_eeprom_write(int x, int offset, uchar *buffer, int len)
+{
+	return 0;
+}

Is this supposed to be working code?

Why is this needed, then?

Quoted 12 lines
include/mw_eeprom.h new file +9 -0
@@ -0,0 +1,27 @@
+/*
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *

include/mw_eeprom.h line 19

Quoted 10 lines
include/mw_eeprom.h new file +10 -0
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */

Copyright entry missing.

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
Es sind ?berhaupt nur die Dummk?pfe, die sich den Befehlen der  M?ch-
tigen  widersetzen.  Um  sie  zu ruinieren ist es genug, ihre Befehle
treu zu erf?llen.                  - Peter Hacks: "Die sch?ne Helena"
#23 lore raw

PATCH 12/17 ti_pci1410a: Fix multiple warnings and errors

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 10 lines · In message <[email protected]> you wrote:

ti_pci1410a.c: In function 'voltage_set':
ti_pci1410a.c:421: error: label at end of compound statement
ti_pci1410a.c:435: error: label at end of compound statement
cc1: warnings being treated as errors
ti_pci1410a.c: At top level:
ti_pci1410a.c:609: warning: pointer targets in initialization differ in signedness ti_pci1410a.c: In function 'identify':
ti_pci1410a.c:651: warning: pointer targets in passing argument 1 of 'puts' differ in signedness ti_pci1410a.c:656: warning: pointer targets in passing argument 1 of 'strcmp' differ in signedness ti_pci1410a.c:656: warning: pointer targets in passing argument 2 of 'strcmp' differ in signedness

Please do not include long lists of error messages. It would be more helpful if you described what you change, or why.

drivers/pcmcia/ti_pci1410a.c static void print_fixed(volatile uchar *p) · line 582

Quoted 4 lines

static int identify(volatile uchar *p)
{

drivers/pcmcia/ti_pci1410a.c +1 -1
-	uchar id_str[MAX_IDENT_CHARS];
+	char id_str[MAX_IDENT_CHARS];

This code is also already present in common/cmd_pcmcia.c; you probably want to remove it here, too.

include/pcmcia.h extern u_int *pcmcia_pgcrx[]; · line 323

Quoted 9 lines
include/pcmcia.h +2 -0
@@ -318,4 +318,6 @@ extern u_int *pcmcia_pgcrx[];
 extern int check_ide_device(int slot);
 #endif
 
+int pcmcia_off(void);
+int pcmcia_on(void);
 #endif /* _PCMCIA_H */

Then please also get rid of the lots of "extern" declarations in misc source files which become unnecessary by that. 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
If programming was easy, they wouldn't need something as  complicated
as a human being to do it, now would they?
                       - L. Wall & R. L. Schwartz, _Programming Perl_
#24 lore raw

PATCH 11/17 Include pcmcia.h only when the drivers is used

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 6 lines · In message <[email protected]> you wrote:

to avoid the following errors :

include/pcmcia.h:72:3: error: #error "PCMCIA Slot not configured" include/pcmcia.h:79:2: error: #error Neither CONFIG_PCMCIA_SLOT_A nor CONFIG_PCMCIA_SLOT_B configured

Which board is showing such errors?

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
While most peoples' opinions change, the conviction of their correct-
ness never does.
#25 lore raw

PATCH 10/17 pcmcia/ti_pci1410a: Move compile condition to the Makefile

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 5 lines · In message <[email protected]> you wrote:
---
 drivers/pcmcia/Makefile      |    2 +-
 drivers/pcmcia/ti_pci1410a.c |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

Applied, thanke.

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
If today is the first day of the rest of your life, what the hell was
yesterday?
#26 lore raw

PATCH 9/17 pxa_pcmcia: Move compile condition to the Makefile

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 5 lines · In message <[email protected]> you wrote:
---
 drivers/pcmcia/Makefile     |    2 +-
 drivers/pcmcia/pxa_pcmcia.c |    4 ----
 2 files changed, 1 insertions(+), 5 deletions(-)

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
Violence in reality is quite different from theory.
	-- Spock, "The Cloud Minders", stardate 5818.4
#27 lore raw

PATCH 8/17 marabun_pcmcia: Move compile condition to the Makefile

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 5 lines · In message <[email protected]> you wrote:
---
 drivers/pcmcia/Makefile         |    2 +-
 drivers/pcmcia/marubun_pcmcia.c |    7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)

Note:

this patch, as well as

[PATCH 09/17] pxa_pcmcia: Move compile condition to the Makefile [PATCH 10/17] pcmcia/ti_pci1410a: Move compile condition to the Makefile

are not considered bug fixes, so they will go in when the next merge window is open.

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
Any sufficiently advanced technology is indistinguishable from magic.
                                                   - Arthur C. Clarke
#28 lore raw

PATCH 8/17 marabun_pcmcia: Move compile condition to the Makefile

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 5 lines · In message <[email protected]> you wrote:
---
 drivers/pcmcia/Makefile         |    2 +-
 drivers/pcmcia/marubun_pcmcia.c |    7 +++----
 2 files changed, 4 insertions(+), 5 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 8 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 connection between the language in which we think/program and the
problems and solutions we can imagine is very close. For this  reason
restricting  language  features  with  the intent of eliminating pro-
grammer errors is at best dangerous.
               - Bjarne Stroustrup in "The  C++ Programming Language"
#29 lore raw

PATCH 7/17 drivers/pcmcia: add missing i82365

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 5 lines · In message <[email protected]> you wrote:
---
 drivers/pcmcia/Makefile |    1 +
 drivers/pcmcia/i82365.c |    4 ----
 2 files changed, 1 insertions(+), 4 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 7 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
They weren't that important. They were merely at the top. The  people
who  really  run organizations are usually found several levels down,
where it's still possible to get things done.
                                      - Terry Pratchett, _Small Gods_
#30 lore raw

PATCH 6/17 ds1722: Fix mutliple warnings and errors and active the ssi for SC520 boards

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 5 lines · In message <[email protected]> you wrote:

ds1722.c:6:17: error: ssi.h: No such file or directory ds1722.c:6:17: error: ssi.h: No such file or directory
cc1: warnings being treated as errors
ds1722.c: In function 'ds1722_select':
ds1722.c:10: warning: implicit declaration of function 'ssi_set_interface'

Quoted 8 lines

ds1722.c:11: warning: implicit declaration of function 'ssi_chip_select' ds1722.c: In function 'ds1722_read':
ds1722.c:24: warning: implicit declaration of function 'ssi_tx_byte' ds1722.c:25: warning: implicit declaration of function 'ssi_rx_byte' ds1722.c: In function 'ds1722_probe':
ds1722.c:137: error: 'DS1722_RESOLUTION_12BIT' undeclared (first use in this function) ds1722.c:137: error: (Each undeclared identifier is reported only once ds1722.c:137: error: for each function it appears in.)

Please do NOT include such long lists of error messages into the commit message. Thanks.

Quoted 11 lines
include/ds1722.h new file +8 -0
@@ -0,0 +1,32 @@
+/*
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.

include/ds1722.h line 18

Quoted 10 lines
include/ds1722.h new file +10 -0
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA

Copyright entry missing.

Quoted 12 lines
include/ssi.h new file +9 -0
@@ -0,0 +1,29 @@
+/*
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *

include/ssi.h line 19

Quoted 10 lines
include/ssi.h new file +10 -0
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */

Copyright entry missing.

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 nice thing about  standards  is that there are  so many to choose
from.                                           - Andrew S. Tanenbaum
#31 lore raw

PATCH 5/17 i386/bootm: remove unused var

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 4 lines · In message <[email protected]> you wrote:
---
 lib_i386/bootm.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

Applied, thanks.

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
Minds are like parachutes - they only function when open.
#32 lore raw

PATCH 4/17 i386: Fix global_data declaration

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 1 line · In message <[email protected]> you wrote:

Fix a warning type in lib_i386/board.c

Um... you not only fix a warning; you change the code pretty heavily.

lib_i386/board.c line 43

Quoted 9 lines
lib_i386/board.c +3 -0
@@ -38,6 +38,9 @@
 #include <ide.h>
 #include <asm/u-boot-i386.h>
 
+gd_t gd_data;
+gd_t *gd;
+

Please do not name this 'gd_data'; stick with the 'global_data' name.

Also be aware that this is dangerous - this way it ends up in the BSS segment which most probably is uninitialized when you acess this data, and gets overwritten with zeroes some time later.

Is this really working code?

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
Inside every old person is a young person wondering what happened.
                              - Terry Pratchett, _Moving Pictures_
#33 lore raw

PATCH 3/17 example/gitignore: update with all generated examples

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 4 lines · In message <[email protected]> you wrote:
---
 examples/.gitignore |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

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
Perfection is reached, not when there is no longer anything  to  add,
but when there is no longer anything to take away.
                                           - Antoine de Saint-Exupery
#34 lore raw

PATCH 2/17 examples/eepro100_eeprom: Fix memcpy to return destination pointer

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 11 lines · In message <[email protected]> you wrote:
---
 examples/eepro100_eeprom.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
examples/eepro100_eeprom.c +0 -0
index 2b15d05..5f4eb78 100644
@@ -80,11 +80,13 @@ static inline short inw(long addr)
 static inline void *memcpy(void *dst, const void *src, unsigned int len)

examples/eepro100_eeprom.c static inline short inw(long addr) · line 89

Quoted 10 lines
examples/eepro100_eeprom.c +3 -1
 {
 	char *ret = dst;
+
 	while (len-- > 0) {
 		*ret++ = *((char *)src);
 		src++;
 	}
-	return (void *)ret;
+
+	return (void *)dst;

While technically correct, this is bogus. We have a variable ret, but we don't return it. And we have a variable dst, but we don't use it as destination pointer.

Please change the

	*ret++ = *((char *)src);
into
	*dst++ = *((char *)src);

and leave all the rest.

Best regards,

Wolfgang Denk

Signature · 7 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
On my planet, to rest is to rest -- to cease using energy. To me,  it
is  quite  illogical to run up and down on green grass, using energy,
instead of saving it.
	-- Spock, "Shore Leave", stardate 3025.2
#35 lore raw

PATCH 2/17 examples/eepro100_eeprom: Fix memcpy to return destination pointer

Quoted 27 lines · Wolfgang Denk
Quoted 11 lines · In message <[email protected]> you wrote:
---
 examples/eepro100_eeprom.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
examples/eepro100_eeprom.c +0 -0
index 2b15d05..5f4eb78 100644
@@ -80,11 +80,13 @@ static inline short inw(long addr)
 static inline void *memcpy(void *dst, const void *src, unsigned int len)

examples/eepro100_eeprom.c static inline short inw(long addr) · line 89

Quoted 10 lines
examples/eepro100_eeprom.c +3 -1
 {
 	char *ret = dst;
+
 	while (len-- > 0) {
 		*ret++ = *((char *)src);
 		src++;
 	}
-	return (void *)ret;
+
+	return (void *)dst;

While technically correct, this is bogus. We have a variable ret, but we don't return it. And we have a variable dst, but we don't use it as destination pointer.

Quoted 5 lines

Please change the

	*ret++ = *((char *)src);
into
	*dst++ = *((char *)src);

and leave all the rest.

You can not do this because dst is a void

we can do this

	char *tmp = dst;

	while (len-- > 0) {
		*tmp++ = *((char *)src);
		src++;
	}

	return (void *)dst;

Best Regards,
J.

#36 lore raw

PATCH 2/17 examples/eepro100_eeprom: Fix memcpy to return destination pointer

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

examples/eepro100_eeprom.c static inline short inw(long addr) · line 89

Quoted 12 lines

static inline void *memcpy(void *dst, const void *src, unsigned int len) {

examples/eepro100_eeprom.c +3 -1
 	char *ret = dst;
+
 	while (len-- > 0) {
 		*ret++ = *((char *)src);
 		src++;
 	}
-	return (void *)ret;
+
+	return (void *)dst;

While technically correct, this is bogus. We have a variable ret, but we don't return it. And we have a variable dst, but we don't use it as destination pointer.

Quoted 6 lines
Quoted 5 lines

Please change the

	*ret++ = *((char *)src);
into
	*dst++ = *((char *)src);

and leave all the rest.

You can not do this because dst is a void

Why not? src is void, too.

we can do this

Quoted 9 lines
	char *tmp = dst;

	while (len-- > 0) {
		*tmp++ = *((char *)src);
		src++;
	}

	return (void *)dst;

This is not a bit better.

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
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
#37 lore raw

PATCH 2/17 examples/eepro100_eeprom: Fix memcpy to return destination pointer

Quoted 18 lines · Wolfgang Denk
Quoted 17 lines · In message <[email protected]> you wrote:
Quoted 17 lines

examples/eepro100_eeprom.c static inline short inw(long addr) · line 89

Quoted 12 lines

static inline void *memcpy(void *dst, const void *src, unsigned int len) {

examples/eepro100_eeprom.c +3 -1
 	char *ret = dst;
+
 	while (len-- > 0) {
 		*ret++ = *((char *)src);
 		src++;
 	}
-	return (void *)ret;
+
+	return (void *)dst;

While technically correct, this is bogus. We have a variable ret, but we don't return it. And we have a variable dst, but we don't use it as destination pointer.

Quoted 8 lines
Quoted 6 lines
Quoted 5 lines

Please change the

	*ret++ = *((char *)src);
into
	*dst++ = *((char *)src);

and leave all the rest.

You can not do this because dst is a void

Why not? src is void, too.

gcc will claim about the cast.

we can do this

       void *ret = dst;
       char *d = dst;
       const char *s = src;

       while (len-- > 0)
               *d++ = *s++;

        return ret;

Best Regards,
J.

#38 lore raw

PATCH 2/17 examples/eepro100_eeprom: Fix memcpy to return destination pointer

Quoted 36 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 16 lines · Wolfgang Denk
Quoted 15 lines · In message <[email protected]> you wrote:
Quoted 15 lines

examples/eepro100_eeprom.c static inline short inw(long addr) · line 89

Quoted 11 lines

static inline void *memcpy(void *dst, const void *src, unsigned int len) {

examples/eepro100_eeprom.c +3 -1
 	char *ret = dst;
+
 	while (len-- > 0) {
 		*ret++ = *((char *)src);
 		src++;
 	}
-	return (void *)ret;
+
+	return (void *)dst;

While technically correct, this is bogus. We have a variable ret, but we don't return it. And we have a variable dst, but we don't use it as destination pointer.

Quoted 7 lines
Quoted 6 lines
Quoted 5 lines

Please change the

	*ret++ = *((char *)src);
into
	*dst++ = *((char *)src);

and leave all the rest.

You can not do this because dst is a void

Why not? src is void, too.

gcc will claim about the cast.

we can do this

       void *ret = dst;
       char *d = dst;
       const char *s = src;

       while (len-- > 0)
               *d++ = *s++;

        return ret;
Quoted 2 lines

Best Regards,
J.

YES! YES! YES! This gets my vote. I marked the start of this thread meaning to suggest using temp variables of the right type and get rid of the complex casting crap, exactly what you did here.

Thanks,
gvb

#39 lore raw

PATCH 2/17 examples/eepro100_eeprom: Fix memcpy to return destination pointer

Quoted 3 lines · Jerry Van Baren

YES! YES! YES! This gets my vote. I marked the start of this thread meaning to suggest using temp variables of the right type and get rid of the complex casting crap, exactly what you did here.

Ack, but BTW ....

...whats wrong with the generic memcpy, e.g. from lib_generic/string.c? Maybe this should be exported and used instead of duplicating generic code again and again?

Best regards

Markus Klotzbuecher

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de

#40 lore raw

PATCH 1/17 example/82559_eeprom: Fix multiple warnings and errors

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 7 lines · In message <[email protected]> you wrote:

include/image.h: In function 'image_set_name':
include/image.h:374: warning: implicit declaration of function 'strncpy' 82559_eeprom.c: In function 'memcpy':
82559_eeprom.c:57: error: lvalue required as increment operand
82559_eeprom.c:57: error: lvalue required as increment operand
82559_eeprom.c: In function 'main':
82559_eeprom.c:318: warning: pointer targets in passing argument 2 of 'gethwaddr' differ in signedness

...

examples/82559_eeprom.c line 22

Quoted 4 lines
examples/82559_eeprom.c +2 -2
-#define _PPC_STRING_H_		/* avoid unnecessary str/mem functions */
-#define _LINUX_STRING_H_	/* avoid unnecessary str/mem functions */
+#define __HAVE_ARCH_MEMCPY	1	/* avoid unnecessary memcpy function */
+#define _PPC_STRING_H_		1	/* avoid unnecessary str/mem functions */

Why these changes?

examples/82559_eeprom.c static inline unsigned short swap16(unsigned short x) · line 52

Quoted 2 lines
examples/82559_eeprom.c +1 -1
-static inline void *memcpy(void *dst, const void *src, unsigned int len)
+inline void *memcpy(void *dst, const void *src, unsigned int len)

If we define __HAVE_ARCH_MEMCPY, should we not delete the whole memcpy() part then?

include/asm-i386/string.h line 11

Quoted 10 lines
include/asm-i386/string.h +2 -0
@@ -5,6 +5,8 @@
  * We don't do inline string functions, since the
  * optimised inline asm versions are not small.
  */
+#undef __HAVE_ARCH_STRNCPY
+extern char *strncpy(char *dest, const char *src, size_t count);
 
 #undef __HAVE_ARCH_STRRCHR

This makes no sense to me. If the implementation has strrchr(), I bet a case of beer it will also have strncpy().

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
There are three things I always forget. Names, faces -  the  third  I
can't remember.                                         - Italo Svevo
#41 lore raw

cover x86: Fix warning: type qualifiers ignored on function return type

In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 1 line · In message <[email protected]> you wrote:

by sync asm/byteorder.h with linux

...

Quoted 1 line

+static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x)

...

Quoted 1 line

+static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 val)

etc.

Current Linux uses "inline" instead of "__inline__" - why the difference?

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
Man is the best computer we can put aboard a spacecraft ...  and  the
only one that can be mass produced with unskilled labor.
                                                  - Wernher von Braun
#42 lore raw

cover x86: Fix warning: type qualifiers ignored on function return type

Quoted 11 lines · Wolfgang Denk
Quoted 1 line · In message <[email protected]> you wrote:

by sync asm/byteorder.h with linux

...

Quoted 1 line

+static __inline__ __attribute_const__ __u32 ___arch__swab32(__u32 x)

...

Quoted 1 line

+static __inline__ __attribute_const__ __u64 ___arch__swab64(__u64 val)

etc.

Current Linux uses "inline" instead of "__inline__" - why the difference?

In Linux inline is redefined as strict inline and we use __inline__ in all other u-boot definition

I will change it, when I'll importer the compiler header from linux.

Best Regards
J.

#43 lore raw

cover x86: Fix warning: type qualifiers ignored on function return type

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

I will change it, when I'll importer the compiler header from linux.

Please do NOT import headers which we do not really, really need.

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
Of all possible committee reactions to any  given  agenda  item,  the
reaction  that will occur is the one which will liberate the greatest
amount of hot air.                                -- Thomas L. Martin