From 809453fe2c2624c49b8edb8beb6be766bd4c9b4a Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Sun, 13 Aug 2006 15:27:43 +0200 Subject: [GCC4] fix build error in drivers/net/hamradio/baycom_epp.c This patch fixes these errors with gcc 4 : baycom_epp.c:373: error: static declaration of 'errno' follows non-static declaration /usr/src/git/linux-2.4/include/linux/unistd.h:4: error: previous declaration of 'errno' was here baycom_epp.c: In function 'encode_hdlc': baycom_epp.c:530: error: jump into statement expression baycom_epp.c:539: error: jump into statement expression (...) --- drivers/net/hamradio/baycom_epp.c | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/net/hamradio/baycom_epp.c b/drivers/net/hamradio/baycom_epp.c index 76f26b6..2f76d9c 100644 --- a/drivers/net/hamradio/baycom_epp.c +++ b/drivers/net/hamradio/baycom_epp.c @@ -60,8 +60,10 @@ #if defined(CONFIG_AX25) || defined(CONF #include #endif /* CONFIG_AX25 || CONFIG_AX25_MODULE */ +static int my_errno; +#define errno my_errno #define __KERNEL_SYSCALLS__ -#include +#include /* --------------------------------------------------------------------- */ @@ -370,8 +372,6 @@ static char eppconfig_path[256] = "/usr/ static char *envp[] = { "HOME=/", "TERM=linux", "PATH=/usr/bin:/bin", NULL }; -static int errno; - static int exec_eppfpga(void *b) { struct baycom_state *bc = (struct baycom_state *)b; @@ -478,14 +478,14 @@ #undef PKP */ #define ENCODEITERA(j) \ -({ \ +do { \ if (!(notbitstream & (0x1f0 << j))) \ goto stuff##j; \ encodeend##j: ; \ -}) +} while (0) #define ENCODEITERB(j) \ -({ \ +do { \ stuff##j: \ bitstream &= ~(0x100 << j); \ bitbuf = (bitbuf & (((2 << j) << numbit) - 1)) | \ @@ -493,7 +493,7 @@ ({ numbit++; \ notbitstream = ~bitstream; \ goto encodeend##j; \ -}) +} while (0) static void encode_hdlc(struct baycom_state *bc) @@ -710,16 +710,16 @@ static void do_rxpacket(struct net_devic } #define DECODEITERA(j) \ -({ \ +do { \ if (!(notbitstream & (0x0fc << j))) /* flag or abort */ \ goto flgabrt##j; \ if ((bitstream & (0x1f8 << j)) == (0xf8 << j)) /* stuffed bit */ \ goto stuff##j; \ enditer##j: ; \ -}) +} while (0) #define DECODEITERB(j) \ -({ \ +do { \ flgabrt##j: \ if (!(notbitstream & (0x1fc << j))) { /* abort received */ \ state = 0; \ @@ -738,7 +738,7 @@ ({ numbits--; \ bitbuf = (bitbuf & ((~0xff) << j)) | ((bitbuf & ~((~0xff) << j)) << 1); \ goto enditer##j; \ -}) +} while (0) static int receive(struct net_device *dev, int cnt) { -- 1.4.2