Skip to contentSkip to conversation

fix compile errors with gcc 3.4

PATCH In review Adrian Bunk 4 participants 12 messages Aug 26, 2004 – Aug 28, 2004

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

cover fix compile errors with gcc 3.4

Hi Marcelo,

the following six patches fix compile errors in 2.4.28-pre2 when using gcc 3.4 .

In my fixes, I tried to be as near at 2.6 as possible.

Please apply
Adrian

#1 lore raw

PATCH 1/6 lmc_media.c: fix gcc 3.4 compilation

I got the following compile error when trying to build 2.4.28-pre2 using gcc 3.4:

<-- snip -->

...
gcc-3.4 -D__KERNEL__
-I/home/bunk/linux/kernel-2.4/linux-2.4.28-pre2-full/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=athlon -fno-unit-at-a-time -I. -nostdinc -iwithprefix include -DKBUILD_BASENAME=lmc_media -c -o lmc_media.o lmc_media.c
lmc_media.c: In function `lmc_t1_get_link_status':
lmc_debug.h:50: sorry, unimplemented: inlining failed in call to
'lmc_trace': function body not available
lmc_media.c:1073: sorry, unimplemented: called from here
lmc_debug.h:50: sorry, unimplemented: inlining failed in call to
'lmc_trace': function body not available
lmc_media.c:1168: sorry, unimplemented: called from here
make[5]: *** [lmc_media.o] Error 1
make[5]: Leaving directory `/home/bunk/linux/kernel-2.4/linux-2.4.28-pre2-full/drivers/net/wan/lmc'

<-- snip -->

The patch below fixes this issue by uninlining lmc_trace.

drivers/net/wan/lmc/lmc_debug.h renamed from drivers/net/wan/lmc/lmc_debug.h.old +1 -1
@@ -47,6 +47,6 @@
 
 void lmcConsoleLog(char *type, unsigned char *ucData, int iLen);
 void lmcEventLog (u_int32_t EventNum, u_int32_t arg2, u_int32_t arg3);
-inline void lmc_trace(struct net_device *dev, char *msg);
+void lmc_trace(struct net_device *dev, char *msg);
 
 #endif
drivers/net/wan/lmc/lmc_debug.c renamed from drivers/net/wan/lmc/lmc_debug.c.old +1 -1
@@ -66,7 +66,7 @@
 #endif
 }
 
-inline void lmc_trace(struct net_device *dev, char *msg){
+void lmc_trace(struct net_device *dev, char *msg){
 #ifdef LMC_TRACE
     unsigned long j = jiffies + 3; /* Wait for 50 ms */
 
#2 lore raw

Re: [2.4 patch][1/6] lmc_media.c: fix gcc 3.4 compilation

I only got patches 1/6 and 6/6... was that intentional?

#3 lore raw

Re: [2.4 patch][1/6] lmc_media.c: fix gcc 3.4 compilation

Quoted 1 line · Jeff Garzik

I only got patches 1/6 and 6/6... was that intentional?

Yes, I only sent you an explicit Cc of the patches that affected net drivers (but you should have gotten all six via linux-kernel).

cu
Adrian

BTW: Marcelo has already merged all six patches.

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#4 lore raw

PATCH 3/6 ircomm_param.c: fix __FUNCTION__ paste error

In reply to Adrian Bunk

I got the following compile error when trying to build 2.4.28-pre2 using gcc 3.4:

<-- snip -->

...
gcc-3.4 -D__KERNEL__ -I/home/bunk/linux/kernel-2.4/linux-2.4.28-pre2-full/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=athlon
-fno-unit-at-a-time -nostdinc -iwithprefix include
-DKBUILD_BASENAME=ircomm_param -c -o ircomm_param.o ircomm_param.c ircomm_param.c: In function `ircomm_param_service_type':
ircomm_param.c:201: error: parse error before "__FUNCTION__"
make[4]: *** [ircomm_param.o] Error 1
make[4]: Leaving directory `/home/bunk/linux/kernel-2.4/linux-2.4.28-pre2-full/net/irda/ircomm'

<-- snip -->

The patch below fixes this issue by removing the superfluous __FUNCTION__ (similar to how it is in 2.6).

net/irda/ircomm/ircomm_param.c renamed from net/irda/ircomm/ircomm_param.c.old +1 -1
@@ -198,7 +198,7 @@
 		IRDA_DEBUG(2, "%s(), No common service type to use!\n", __FUNCTION__);
 		return -1;
 	}
-	IRDA_DEBUG(0, __FUNCTION__ "%s(), services in common=%02x\n", __FUNCTION__,
+	IRDA_DEBUG(0, "%s(), services in common=%02x\n", __FUNCTION__ ,
 		   service_type);
 
 	/*
#5 lore raw

PATCH 4/6 irlmp.c: fix gcc 3.4 compilation

In reply to Adrian Bunk

I got the following compile error when trying to build 2.4.28-pre2 using gcc 3.4:

<-- snip -->

...
gcc-3.4 -D__KERNEL__ -I/home/bunk/linux/kernel-2.4/linux-2.4.28-pre2-full/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=athlon
-fno-unit-at-a-time -nostdinc -iwithprefix include
-DKBUILD_BASENAME=irlmp -c -o irlmp.o irlmp.c
irlmp.c: In function `irlmp_flow_indication':
irlmp.c:1244: error: parse error before "__FUNCTION__"
irlmp.c:1258: error: parse error before "__FUNCTION__"
irlmp.c:1277: error: parse error before "__FUNCTION__"
irlmp.c:1284: error: parse error before "__FUNCTION__"
make[3]: *** [irlmp.o] Error 1
make[3]: Leaving directory `/home/bunk/linux/kernel-2.4/linux-2.4.28-pre2-full/net/irda'

<-- snip -->

The patch below fixes this issue (similar to how it was done in 2.6).

net/irda/irlmp.c renamed from net/irda/irlmp.c.old +4 -4
@@ -1241,7 +1241,7 @@
 	/* Get the number of lsap. That's the only safe way to know
 	 * that we have looped around... - Jean II */
 	lsap_todo = HASHBIN_GET_SIZE(self->lsaps);
-	IRDA_DEBUG(4, __FUNCTION__ "() : %d lsaps to scan\n", lsap_todo);
+	IRDA_DEBUG(4, "%s() : %d lsaps to scan\n", __FUNCTION__ , lsap_todo);
 
 	/* Poll lsap in order until the queue is full or until we
 	 * tried them all.
@@ -1255,7 +1255,7 @@
 			/* Note that if there is only one LSAP on the LAP
 			 * (most common case), self->flow_next is always NULL,
 			 * so we always avoid this loop. - Jean II */
-			IRDA_DEBUG(4, __FUNCTION__ "() : searching my LSAP\n");
+			IRDA_DEBUG(4, "%s() : searching my LSAP\n", __FUNCTION__ );
 
 			/* We look again in hashbins, because the lsap
 			 * might have gone away... - Jean II */
@@ -1274,14 +1274,14 @@
 
 		/* Next time, we will get the next one (or the first one) */
 		self->flow_next = (struct lsap_cb *) hashbin_get_next(self->lsaps);
-		IRDA_DEBUG(4, __FUNCTION__ "() : curr is %p, next was %p and is now %p, still %d to go - queue len = %d\n", curr, next, self->flow_next, lsap_todo, IRLAP_GET_TX_QUEUE_LEN(self->irlap));
+		IRDA_DEBUG(4, "%s() : curr is %p, next was %p and is now %p, still %d to go - queue len = %d\n", __FUNCTION__ , curr, next, self->flow_next, lsap_todo, IRLAP_GET_TX_QUEUE_LEN(self->irlap));
 
 		/* Inform lsap user that it can send one more packet. */
 		if (curr->notify.flow_indication != NULL)
 			curr->notify.flow_indication(curr->notify.instance, 
 						     curr, flow);
 		else
-			IRDA_DEBUG(1, __FUNCTION__ "(), no handler\n");
+			IRDA_DEBUG(1, "%s(), no handler\n", __FUNCTION__ );
 	}
 }
 
#6 lore raw

PATCH 5/6 asm-i386/smpboot.h: fix gcc 3.4 compilation

In reply to Adrian Bunk

I got the following compile error when trying to build 2.4.28-pre2 using gcc 3.4:

<-- snip -->

...
gcc-3.4 -D__KERNEL__ -I/home/bunk/linux/kernel-2.4/linux-2.4.28-pre2-full/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=athlon
-fno-unit-at-a-time -nostdinc -iwithprefix include
-DKBUILD_BASENAME=process -c -o process.o process.c
In file included from process.c:47:
/home/bunk/linux/kernel-2.4/linux-2.4.28-pre2-full/include/asm/smpboot.h:
In function `target_cpus':
/home/bunk/linux/kernel-2.4/linux-2.4.28-pre2-full/include/asm/smpboot.h:133:
error: label at end of compound statement
make[1]: *** [process.o] Error 1
make[1]: Leaving directory `/home/bunk/linux/kernel-2.4/linux-2.4.28-pre2-full/arch/i386/kernel'

<-- snip -->

The patch below fixes this issue.

include/asm-i386/smpboot.h renamed from include/asm-i386/smpboot.h.old +1 -1
@@ -130,8 +130,8 @@
 			cpu = (cpu+1)%smp_num_cpus;
 			return cpu_to_physical_apicid(cpu);
 		default:
+			return cpu_online_map;
 	}
-	return cpu_online_map;
 }
 #else
 #define target_cpus() (cpu_online_map)
#7 lore raw

Re: [2.4 patch][1/6] ibmphp_res.c: fix gcc 3.4 compilation

In reply to Adrian Bunk

I got the following compile error when trying to build 2.4.28-pre2 using gcc 3.4:

<-- snip -->

...
gcc-3.4 -D__KERNEL__ -I/home/bunk/linux/kernel-2.4/linux-2.4.28-pre2-full/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=athlon -fno-unit-at-a-time -D_LINUX -I/home/bunk/linux/kernel-2.4/linux-2.4.28-pre2-full/drivers/acpi
-nostdinc -iwithprefix include -DKBUILD_BASENAME=ibmphp_res -c -o
ibmphp_res.o ibmphp_res.c
ibmphp_res.c: In function `ibmphp_rsrc_init':
ibmphp_res.c:45: sorry, unimplemented: inlining failed in call to 'find_bus_wprev': function body not available
ibmphp_res.c:237: sorry, unimplemented: called from here
ibmphp_res.c:45: sorry, unimplemented: inlining failed in call to 'find_bus_wprev': function body not available
ibmphp_res.c:261: sorry, unimplemented: called from here
ibmphp_res.c:45: sorry, unimplemented: inlining failed in call to 'find_bus_wprev': function body not available
ibmphp_res.c:284: sorry, unimplemented: called from here
make[3]: *** [ibmphp_res.o] Error 1
make[3]: Leaving directory `/home/bunk/linux/kernel-2.4/linux-2.4.28-pre2-full/drivers/hotplug'

<-- snip -->

The patch below fixes this issue by uninlining find_bus_wprev (as done in 2.6).

drivers/hotplug/ibmphp_res.c renamed from drivers/hotplug/ibmphp_res.c.old +2 -2
@@ -42,7 +42,7 @@
 static int update_bridge_ranges (struct bus_node **);
 static int add_range (int type, struct range_node *, struct bus_node *);
 static void fix_resources (struct bus_node *);
-static inline struct bus_node *find_bus_wprev (u8, struct bus_node **, u8);
+static struct bus_node *find_bus_wprev (u8, struct bus_node **, u8);
 
 static LIST_HEAD(gbuses);
 LIST_HEAD(ibmphp_res_head);
@@ -1757,7 +1757,7 @@
 	return find_bus_wprev (bus_number, NULL, 0);
 }
 
-static inline struct bus_node *find_bus_wprev (u8 bus_number, struct bus_node **prev, u8 flag)
+static struct bus_node *find_bus_wprev (u8 bus_number, struct bus_node **prev, u8 flag)
 {
 	struct bus_node *bus_cur;
 	struct list_head *tmp;
#8 lore raw

Re: [2.4 patch][1/6] ibmphp_res.c: fix gcc 3.4 compilation

Quoted 27 lines · Adrian Bunk

I got the following compile error when trying to build 2.4.28-pre2 using gcc 3.4:

<-- snip -->

...
gcc-3.4 -D__KERNEL__

(quoted diff) +0 -6
-I/home/bunk/linux/kernel-2.4/linux-2.4.28-pre2-full/include -Wall 
-Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common 
-fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=athlon 
-fno-unit-at-a-time  -D_LINUX 
-I/home/bunk/linux/kernel-2.4/linux-2.4.28-pre2-full/drivers/acpi  
-nostdinc -iwithprefix include -DKBUILD_BASENAME=ibmphp_res  -c -o 

ibmphp_res.o ibmphp_res.c
ibmphp_res.c: In function `ibmphp_rsrc_init':
ibmphp_res.c:45: sorry, unimplemented: inlining failed in call to 'find_bus_wprev': function body not available
ibmphp_res.c:237: sorry, unimplemented: called from here
ibmphp_res.c:45: sorry, unimplemented: inlining failed in call to 'find_bus_wprev': function body not available
ibmphp_res.c:261: sorry, unimplemented: called from here
ibmphp_res.c:45: sorry, unimplemented: inlining failed in call to 'find_bus_wprev': function body not available
ibmphp_res.c:284: sorry, unimplemented: called from here
make[3]: *** [ibmphp_res.o] Error 1
make[3]: Leaving directory `/home/bunk/linux/kernel-2.4/linux-2.4.28-pre2-full/drivers/hotplug'

Quoted 5 lines

<-- snip -->

The patch below fixes this issue by uninlining find_bus_wprev (as done in 2.6).

Just out of curiosity, if you move the inlined function up to the beginning of the file (before any calls to it), and remove the declaration (at 45), does it stop complaining?

#9 lore raw

Re: [2.4 patch][1/6] ibmphp_res.c: fix gcc 3.4 compilation

Quoted 7 lines · Marcelo Tosatti
Quoted 3 lines

The patch below fixes this issue by uninlining find_bus_wprev (as done in 2.6).

Just out of curiosity, if you move the inlined function up to the beginning of the file (before any calls to it), and remove the declaration (at 45), does it stop complaining?

Yes it does.

For all these inline errors you can choose between uninlining and reordering the file.

In this case I did choose unlinlining because find_bus_wprev is uninlined in 2.6 .

cu
Adrian

Signature · 4 lines
       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed
#10 lore raw

PATCH 6/6 dscc4.c: fix gcc 3.4 compilation

In reply to Adrian Bunk

I got compile errors starting with the following when trying to build 2.4.28-pre2 using gcc 3.4:

<-- snip -->

...
gcc-3.4 -D__KERNEL__ -I/home/bunk/linux/kernel-2.4/linux-2.4.28-pre2-modular/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fno-strict-aliasing -fno-common -fomit-frame-pointer -pipe -mpreferred-stack-boundary=2 -march=athlon -fno-unit-at-a-time -DMODULE -DMODVERSIONS -include /home/bunk/linux/kernel-2.4/linux-2.4.28-pre2-modular/include/linux/modversions.h -nostdinc -iwithprefix include -DKBUILD_BASENAME=dscc4 -c -o dscc4.o
dscc4.c
dscc4.c: In function `dscc4_found1':
dscc4.c:369: sorry, unimplemented: inlining failed in call to
'dscc4_set_quartz': function body not available
dscc4.c:921: sorry, unimplemented: called from here
make[3]: *** [dscc4.o] Error 1
make[3]: Leaving directory `/home/bunk/linux/kernel-2.4/linux-2.4.28-pre2-modular/drivers/net/wan'

<-- snip -->

The patch below fixes this issue (similar to how it was done in 2.6).

diffstat output:

 drivers/net/wan/dscc4.c |   33 ++++++++++++++++-----------------
 1 files changed, 16 insertions(+), 17 deletions(-)
drivers/net/wan/dscc4.c renamed from drivers/net/wan/dscc4.c.old +16 -17
@@ -351,8 +351,8 @@
 #endif
 
 /* Functions prototypes */
-static inline void dscc4_rx_irq(struct dscc4_pci_priv *, struct dscc4_dev_priv *);
-static inline void dscc4_tx_irq(struct dscc4_pci_priv *, struct dscc4_dev_priv *);
+static void dscc4_rx_irq(struct dscc4_pci_priv *, struct dscc4_dev_priv *);
+static void dscc4_tx_irq(struct dscc4_pci_priv *, struct dscc4_dev_priv *);
 static int dscc4_found1(struct pci_dev *, unsigned long ioaddr);
 static int dscc4_init_one(struct pci_dev *, const struct pci_device_id *ent);
 static int dscc4_open(struct net_device *);
@@ -366,7 +366,6 @@
 static void dscc4_irq(int irq, void *dev_id, struct pt_regs *ptregs);
 static int dscc4_hdlc_attach(hdlc_device *, unsigned short, unsigned short);
 static int dscc4_set_iface(struct dscc4_dev_priv *, struct net_device *);
-static inline int dscc4_set_quartz(struct dscc4_dev_priv *, int);
 #ifdef DSCC4_POLLING
 static int dscc4_tx_poll(struct dscc4_dev_priv *, struct net_device *);
 #endif
@@ -857,6 +856,18 @@
 	//scc_writel(0x00250008 & ~RxActivate, dpriv, dev, CCR2);
 }
 
+static inline int dscc4_set_quartz(struct dscc4_dev_priv *dpriv, int hz)
+{
+	int ret = 0;
+
+	if ((hz < 0) || (hz > DSCC4_HZ_MAX))
+		ret = -EOPNOTSUPP;
+	else
+		dpriv->pci_priv->xtal_hz = hz;
+
+	return ret;
+}
+
 static int dscc4_found1(struct pci_dev *pdev, unsigned long ioaddr)
 {
 	struct dscc4_pci_priv *ppriv;
@@ -1325,18 +1336,6 @@
 	return ret;
 }
 
-static inline int dscc4_set_quartz(struct dscc4_dev_priv *dpriv, int hz)
-{
-	int ret = 0;
-
-	if ((hz < 0) || (hz > DSCC4_HZ_MAX))
-		ret = -EOPNOTSUPP;
-	else
-		dpriv->pci_priv->xtal_hz = hz;
-
-	return ret;
-}
-
 static int dscc4_match(struct thingie *p, int value)
 {
 	int i;
@@ -1512,7 +1511,7 @@
 	spin_unlock_irqrestore(&priv->lock, flags);
 }
 
-static inline void dscc4_tx_irq(struct dscc4_pci_priv *ppriv,
+static void dscc4_tx_irq(struct dscc4_pci_priv *ppriv,
 				struct dscc4_dev_priv *dpriv)
 {
 	struct net_device *dev = hdlc_to_dev(&dpriv->hdlc);
@@ -1681,7 +1680,7 @@
 	goto try;
 }
 
-static inline void dscc4_rx_irq(struct dscc4_pci_priv *priv,
+static void dscc4_rx_irq(struct dscc4_pci_priv *priv,
 				    struct dscc4_dev_priv *dpriv)
 {
 	struct net_device *dev = hdlc_to_dev(&dpriv->hdlc);
#11 lore raw

Re: [2.4 patch][6/6] dscc4.c: fix gcc 3.4 compilation

Adrian Bunk <[email protected]> :

Quoted 4 lines

I got compile errors starting with the following when trying to build 2.4.28-pre2 using gcc 3.4:

<-- snip -->

[patch snipped]

Thanks for the patch.

Please apply.

Signature · 1 line
Ueimor