From 6fa75d0b231a679a4eff600147a0cfad2d98710e Mon Sep 17 00:00:00 2001
From: Felix Fietkau <nbd@openwrt.org>
Date: Fri, 29 Apr 2005 17:50:19 +0000
Subject: add some gcc 4.0 fixes

SVN-Revision: 764
---
 .../package/linux/kernel-patches/313-gcc-4.0-fixes | 198 +++++++++++++++++++++
 .../linux/kernel-source/drivers/net/hnd/bcmutils.c |   2 +-
 .../linux/kernel-source/drivers/net/hnd/sbutils.c  |   4 +-
 3 files changed, 201 insertions(+), 3 deletions(-)
 create mode 100644 openwrt/package/linux/kernel-patches/313-gcc-4.0-fixes

(limited to 'openwrt/package')

diff --git a/openwrt/package/linux/kernel-patches/313-gcc-4.0-fixes b/openwrt/package/linux/kernel-patches/313-gcc-4.0-fixes
new file mode 100644
index 0000000..e670368
--- /dev/null
+++ b/openwrt/package/linux/kernel-patches/313-gcc-4.0-fixes
@@ -0,0 +1,198 @@
+diff -urN linux-2.4.30.old/drivers/i2c/i2c-core.c linux-2.4.30.dev/drivers/i2c/i2c-core.c
+--- linux-2.4.30.old/drivers/i2c/i2c-core.c	2005-04-29 17:59:04.000000000 +0200
++++ linux-2.4.30.dev/drivers/i2c/i2c-core.c	2005-04-29 18:42:37.000000000 +0200
+@@ -750,7 +750,7 @@
+ 		msg.addr   = client->addr;
+ 		msg.flags = client->flags & I2C_M_TEN;
+ 		msg.len = count;
+-		(const char *)msg.buf = buf;
++		msg.buf = (__u8 *)buf;
+ 	
+ 		DEB2(printk(KERN_DEBUG "i2c-core.o: master_send: writing %d bytes on %s.\n",
+ 			count,client->adapter->name));
+@@ -780,7 +780,7 @@
+ 		msg.flags = client->flags & I2C_M_TEN;
+ 		msg.flags |= I2C_M_RD;
+ 		msg.len = count;
+-		msg.buf = buf;
++		msg.buf = (__u8 *)buf;
+ 
+ 		DEB2(printk(KERN_DEBUG "i2c-core.o: master_recv: reading %d bytes on %s.\n",
+ 			count,client->adapter->name));
+diff -urN linux-2.4.30.old/drivers/usb/inode.c linux-2.4.30.dev/drivers/usb/inode.c
+--- linux-2.4.30.old/drivers/usb/inode.c	2004-02-18 14:36:31.000000000 +0100
++++ linux-2.4.30.dev/drivers/usb/inode.c	2005-04-29 18:42:37.000000000 +0200
+@@ -42,6 +42,8 @@
+ #include <asm/uaccess.h>
+ 
+ /* --------------------------------------------------------------------- */
++static struct file_operations usbdevfs_bus_file_operations;
++static struct inode_operations usbdevfs_bus_inode_operations;
+ 
+ /*
+  * This list of superblocks is still used,
+diff -urN linux-2.4.30.old/include/asm-mips/uaccess.h linux-2.4.30.dev/include/asm-mips/uaccess.h
+--- linux-2.4.30.old/include/asm-mips/uaccess.h	2005-01-19 15:10:12.000000000 +0100
++++ linux-2.4.30.dev/include/asm-mips/uaccess.h	2005-04-29 18:42:37.000000000 +0200
+@@ -149,7 +149,7 @@
+  * Returns zero on success, or -EFAULT on error.
+  */
+ #define put_user(x,ptr)	\
+-	__put_user_check((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
++	__put_user_check((x),(ptr),sizeof(*(ptr)))
+ 
+ /*
+  * get_user: - Get a simple variable from user space.
+@@ -169,7 +169,7 @@
+  * On error, the variable @x is set to zero.
+  */
+ #define get_user(x,ptr) \
+-	__get_user_check((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
++	__get_user_check((x),(ptr),sizeof(*(ptr)))
+ 
+ /*
+  * __put_user: - Write a simple value into user space, with less checking.
+@@ -191,7 +191,7 @@
+  * Returns zero on success, or -EFAULT on error.
+  */
+ #define __put_user(x,ptr) \
+-	__put_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
++	__put_user_nocheck((x),(ptr),sizeof(*(ptr)))
+ 
+ /*
+  * __get_user: - Get a simple variable from user space, with less checking.
+@@ -214,7 +214,7 @@
+  * On error, the variable @x is set to zero.
+  */
+ #define __get_user(x,ptr) \
+-	__get_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
++	__get_user_nocheck((x),(ptr),sizeof(*(ptr)))
+ 
+ struct __large_struct { unsigned long buf[100]; };
+ #define __m(x) (*(struct __large_struct *)(x))
+@@ -232,7 +232,7 @@
+ #define __get_user_nocheck(x,ptr,size)					\
+ ({									\
+ 	long __gu_err = 0;						\
+-	__typeof(*(ptr)) __gu_val = 0;					\
++	__typeof(*(ptr)) __gu_val = (__typeof(*(ptr))) 0;					\
+ 	long __gu_addr;							\
+ 	__gu_addr = (long) (ptr);					\
+ 	switch (size) {							\
+diff -urN linux-2.4.30.old/include/linux/byteorder/swab.h linux-2.4.30.dev/include/linux/byteorder/swab.h
+--- linux-2.4.30.old/include/linux/byteorder/swab.h	2002-11-29 00:53:15.000000000 +0100
++++ linux-2.4.30.dev/include/linux/byteorder/swab.h	2005-04-29 18:42:37.000000000 +0200
+@@ -156,7 +156,7 @@
+ #endif /* OPTIMIZE */
+ 
+ 
+-static __inline__ __const__ __u16 __fswab16(__u16 x)
++static __inline__ __u16 __fswab16(__u16 x)
+ {
+ 	return __arch__swab16(x);
+ }
+@@ -169,7 +169,7 @@
+ 	__arch__swab16s(addr);
+ }
+ 
+-static __inline__ __const__ __u32 __fswab24(__u32 x)
++static __inline__ __u32 __fswab24(__u32 x)
+ {
+ 	return __arch__swab24(x);
+ }
+@@ -182,7 +182,7 @@
+ 	__arch__swab24s(addr);
+ }
+ 
+-static __inline__ __const__ __u32 __fswab32(__u32 x)
++static __inline__ __u32 __fswab32(__u32 x)
+ {
+ 	return __arch__swab32(x);
+ }
+@@ -196,7 +196,7 @@
+ }
+ 
+ #ifdef __BYTEORDER_HAS_U64__
+-static __inline__ __const__ __u64 __fswab64(__u64 x)
++static __inline__ __u64 __fswab64(__u64 x)
+ {
+ #  ifdef __SWAB_64_THRU_32__
+ 	__u32 h = x >> 32;
+diff -urN linux-2.4.30.old/include/linux/fs.h linux-2.4.30.dev/include/linux/fs.h
+--- linux-2.4.30.old/include/linux/fs.h	2005-04-29 17:59:08.000000000 +0200
++++ linux-2.4.30.dev/include/linux/fs.h	2005-04-29 18:42:37.000000000 +0200
+@@ -1563,7 +1563,6 @@
+ unsigned long generate_cluster(kdev_t, int b[], int);
+ unsigned long generate_cluster_swab32(kdev_t, int b[], int);
+ extern kdev_t ROOT_DEV;
+-extern char root_device_name[];
+ 
+ 
+ extern void show_buffers(void);
+diff -urN linux-2.4.30.old/include/linux/i2c.h linux-2.4.30.dev/include/linux/i2c.h
+--- linux-2.4.30.old/include/linux/i2c.h	2005-01-19 15:10:12.000000000 +0100
++++ linux-2.4.30.dev/include/linux/i2c.h	2005-04-29 18:42:37.000000000 +0200
+@@ -70,7 +70,7 @@
+ 
+ /* Transfer num messages.
+  */
+-extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg msg[],int num);
++extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msg, int num);
+ 
+ /*
+  * Some adapter types (i.e. PCF 8584 based ones) may support slave behaviuor. 
+@@ -197,7 +197,7 @@
+ 	   to NULL. If an adapter algorithm can do SMBus access, set 
+ 	   smbus_xfer. If set to NULL, the SMBus protocol is simulated
+ 	   using common I2C messages */
+-	int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg msgs[], 
++	int (*master_xfer)(struct i2c_adapter *adap,struct i2c_msg *msgs, 
+ 	                   int num);
+ 	int (*smbus_xfer) (struct i2c_adapter *adap, u16 addr, 
+ 	                   unsigned short flags, char read_write,
+diff -urN linux-2.4.30.old/include/linux/usbdevice_fs.h linux-2.4.30.dev/include/linux/usbdevice_fs.h
+--- linux-2.4.30.old/include/linux/usbdevice_fs.h	2003-11-28 19:26:21.000000000 +0100
++++ linux-2.4.30.dev/include/linux/usbdevice_fs.h	2005-04-29 18:42:37.000000000 +0200
+@@ -185,8 +185,6 @@
+ extern struct file_operations usbdevfs_devices_fops;
+ extern struct file_operations usbdevfs_device_file_operations;
+ extern struct inode_operations usbdevfs_device_inode_operations;
+-extern struct inode_operations usbdevfs_bus_inode_operations;
+-extern struct file_operations usbdevfs_bus_file_operations;
+ extern void usbdevfs_conn_disc_event(void);
+ 
+ #endif /* __KERNEL__ */
+diff -urN linux-2.4.30.old/include/net/icmp.h linux-2.4.30.dev/include/net/icmp.h
+--- linux-2.4.30.old/include/net/icmp.h	2001-11-22 20:47:15.000000000 +0100
++++ linux-2.4.30.dev/include/net/icmp.h	2005-04-29 18:42:37.000000000 +0200
+@@ -23,6 +23,7 @@
+ 
+ #include <net/sock.h>
+ #include <net/protocol.h>
++#include <net/snmp.h>
+ 
+ struct icmp_err {
+   int		errno;
+diff -urN linux-2.4.30.old/include/net/ipv6.h linux-2.4.30.dev/include/net/ipv6.h
+--- linux-2.4.30.old/include/net/ipv6.h	2004-11-17 12:54:22.000000000 +0100
++++ linux-2.4.30.dev/include/net/ipv6.h	2005-04-29 18:42:37.000000000 +0200
+@@ -19,6 +19,7 @@
+ #include <asm/hardirq.h>
+ #include <net/ndisc.h>
+ #include <net/flow.h>
++#include <net/snmp.h>
+ 
+ #define SIN6_LEN_RFC2133	24
+ 
+diff -urN linux-2.4.30.old/include/linux/netfilter_ipv4/ip_tables.h linux-2.4.30.dev/include/linux/netfilter_ipv4/ip_tables.h
+--- linux-2.4.30.old/include/linux/netfilter_ipv4/ip_tables.h	2005-04-29 17:59:08.000000000 +0200
++++ linux-2.4.30.dev/include/linux/netfilter_ipv4/ip_tables.h	2005-04-29 19:06:36.000000000 +0200
+@@ -283,7 +283,7 @@
+ 	struct ipt_entry entrytable[0];
+ };
+ 
+-extern struct semaphore ipt_mutex;
++// extern struct semaphore ipt_mutex;
+ 
+ /* Standard return verdict, or do jump. */
+ #define IPT_STANDARD_TARGET ""
diff --git a/openwrt/package/linux/kernel-source/drivers/net/hnd/bcmutils.c b/openwrt/package/linux/kernel-source/drivers/net/hnd/bcmutils.c
index 0b704d4..1b37c51 100644
--- a/openwrt/package/linux/kernel-source/drivers/net/hnd/bcmutils.c
+++ b/openwrt/package/linux/kernel-source/drivers/net/hnd/bcmutils.c
@@ -745,7 +745,7 @@ crc32(
     /* handle bulk of data as 32-bit words */
     pend = pdata + (nbytes & 0xfffffffc);
     while (pdata < pend) {
-	*tptr = *((ulong *)pdata)++;
+	*tptr = (*((ulong *)pdata))++;
         CRC_INNER_LOOP(32, crc, tmp[0]);
         CRC_INNER_LOOP(32, crc, tmp[1]);
         CRC_INNER_LOOP(32, crc, tmp[2]);
diff --git a/openwrt/package/linux/kernel-source/drivers/net/hnd/sbutils.c b/openwrt/package/linux/kernel-source/drivers/net/hnd/sbutils.c
index 50ec339..2c9cb55 100644
--- a/openwrt/package/linux/kernel-source/drivers/net/hnd/sbutils.c
+++ b/openwrt/package/linux/kernel-source/drivers/net/hnd/sbutils.c
@@ -136,7 +136,7 @@ sb_read_sbreg(void *sbh, volatile uint32 *sbr)
 		INTR_OFF(si, intr_val);
 		tmp = 1;
 		OSL_PCMCIA_WRITE_ATTR(si->osh, MEM_SEG, &tmp, 1);
-		(uint32)sbr &= ~(1 << 11);	/* mask out bit 11*/
+		sbr = (uint32 *) (((uint32) sbr) & ~(1 << 11));	/* mask out bit 11*/
 	}
 
 	val = R_REG(sbr);
@@ -170,7 +170,7 @@ sb_write_sbreg(void *sbh, volatile uint32 *sbr, uint32 v)
 		INTR_OFF(si, intr_val);
 		tmp = 1;
 		OSL_PCMCIA_WRITE_ATTR(si->osh, MEM_SEG, &tmp, 1);
-		(uint32)sbr &= ~(1 << 11);	/* mask out bit 11 */
+		sbr = (uint32 *) (((uint32) sbr) & ~(1 << 11));	/* mask out bit 11*/
 	}
 
 	if (si->bus == PCMCIA_BUS) {
-- 
cgit v1.1