summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xMAKEALL51
-rw-r--r--arch/arm/cpu/arm920t/ks8695/timer.c16
-rw-r--r--arch/arm/cpu/pxa/cpu.c2
-rw-r--r--board/cm4008/flash.c2
-rw-r--r--board/cm41xx/flash.c2
-rw-r--r--common/cmd_sf.c2
-rw-r--r--common/cmd_yaffs2.c2
-rw-r--r--common/dlmalloc.c7
-rw-r--r--drivers/net/phy/phy.c10
-rw-r--r--drivers/net/smc911x.c36
-rw-r--r--fs/ubifs/ubifs.c6
-rw-r--r--fs/yaffs2/Makefile2
-rw-r--r--fs/yaffs2/yaffs_guts.c25
-rw-r--r--fs/yaffs2/yaffs_nand.c2
-rw-r--r--fs/yaffs2/yaffs_nand.h2
-rw-r--r--fs/yaffs2/yaffscfg.c4
-rw-r--r--include/common.h23
-rw-r--r--include/configs/cm4008.h3
-rw-r--r--include/configs/cm41xx.h3
-rw-r--r--include/configs/mx31pdk.h1
-rw-r--r--include/malloc.h8
-rw-r--r--lib/qsort.c5
-rw-r--r--lib/vsprintf.c8
-rw-r--r--net/eth.c2
24 files changed, 113 insertions, 111 deletions
diff --git a/MAKEALL b/MAKEALL
index 2e39d2c..4d18c11 100755
--- a/MAKEALL
+++ b/MAKEALL
@@ -300,67 +300,24 @@ LIST_SA="$(boards_by_cpu sa1100)"
## ARM9 Systems
#########################################################################
-LIST_ARM9=" \
- a320evb \
- aspenite \
- da830evm \
- da850evm \
- edminiv2 \
- guruplug \
- imx27lite \
- jadecpu \
- km_kirkwood \
- magnesium \
- mv88f6281gtw_ge \
- mx1ads \
- nhk8815 \
- nhk8815_onenand \
- omap1510inn \
+LIST_ARM9="$(boards_by_cpu arm920t) \
+ $(boards_by_cpu arm926ejs) \
+ $(boards_by_cpu arm925t) \
omap1610h2 \
omap1610inn \
- omap5912osk \
omap730p2 \
- openrd_base \
- openrd_client \
- openrd_ultimate \
- portl2 \
- rd6281a \
- scb9328 \
- sheevaplug \
- smdk2410 \
- spear300 \
- spear310 \
- spear320 \
- spear600 \
- VCMA9 \
- versatile \
- versatileab \
- versatilepb \
- davinci_dvevm \
- davinci_schmoogie \
- davinci_sffsdr \
- davinci_sonata \
- davinci_dm355evm \
- davinci_dm355leopard \
- davinci_dm365evm \
- davinci_dm6467evm \
"
#########################################################################
## ARM11 Systems
#########################################################################
-LIST_ARM11=" \
- omap2420h4 \
+LIST_ARM11="$(boards_by_cpu arm1136) \
apollon \
- imx31_litekit \
imx31_phycore \
imx31_phycore_eet \
- mx31ads \
mx31pdk \
mx31pdk_nand \
- qong \
smdk6400 \
- tnetv107x_evm \
"
#########################################################################
diff --git a/arch/arm/cpu/arm920t/ks8695/timer.c b/arch/arm/cpu/arm920t/ks8695/timer.c
index 234fe91..0852502 100644
--- a/arch/arm/cpu/arm920t/ks8695/timer.c
+++ b/arch/arm/cpu/arm920t/ks8695/timer.c
@@ -24,6 +24,14 @@
#include <asm/arch/platform.h>
/*
+ * Initial timer set constants. Nothing complicated, just set for a 1ms
+ * tick.
+ */
+#define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_1)
+#define TIMER_COUNT (TIMER_INTERVAL / 2)
+#define TIMER_PULSE TIMER_COUNT
+
+/*
* Handy KS8695 register access functions.
*/
#define ks8695_read(a) *((volatile ulong *) (KS8695_IO_BASE + (a)))
@@ -42,14 +50,6 @@ int timer_init (void)
return 0;
}
-/*
- * Initial timer set constants. Nothing complicated, just set for a 1ms
- * tick.
- */
-#define TIMER_INTERVAL (TICKS_PER_uSEC * mSEC_1)
-#define TIMER_COUNT (TIMER_INTERVAL / 2)
-#define TIMER_PULSE TIMER_COUNT
-
ulong get_timer_masked(void)
{
/* Check for timer wrap */
diff --git a/arch/arm/cpu/pxa/cpu.c b/arch/arm/cpu/pxa/cpu.c
index 9970a4b..df351c7 100644
--- a/arch/arm/cpu/pxa/cpu.c
+++ b/arch/arm/cpu/pxa/cpu.c
@@ -305,7 +305,7 @@ void pxa_wakeup(void)
pxa_dram_init();
icache_disable();
dcache_disable();
- asm volatile("mov pc, %0"::"r"(readl(PSSR)));
+ asm volatile("mov pc, %0"::"r"(readl(PSPR)));
}
}
diff --git a/board/cm4008/flash.c b/board/cm4008/flash.c
index d6fd519..2e1356f 100644
--- a/board/cm4008/flash.c
+++ b/board/cm4008/flash.c
@@ -72,7 +72,7 @@ unsigned long flash_init (void)
*/
flash_protect (FLAG_PROTECT_SET,
CONFIG_SYS_FLASH_BASE,
- CONFIG_SYS_FLASH_BASE + _bss_start - _armboot_start,
+ CONFIG_SYS_FLASH_BASE + _bss_start_ofs,
&flash_info[0]);
return size;
diff --git a/board/cm41xx/flash.c b/board/cm41xx/flash.c
index d6fd519..2e1356f 100644
--- a/board/cm41xx/flash.c
+++ b/board/cm41xx/flash.c
@@ -72,7 +72,7 @@ unsigned long flash_init (void)
*/
flash_protect (FLAG_PROTECT_SET,
CONFIG_SYS_FLASH_BASE,
- CONFIG_SYS_FLASH_BASE + _bss_start - _armboot_start,
+ CONFIG_SYS_FLASH_BASE + _bss_start_ofs,
&flash_info[0]);
return size;
diff --git a/common/cmd_sf.c b/common/cmd_sf.c
index 11a491d..27d6e39 100644
--- a/common/cmd_sf.c
+++ b/common/cmd_sf.c
@@ -53,7 +53,7 @@ static int sf_parse_len_arg(char *arg, ulong *len)
return -1;
if (round_up_len && flash->sector_size > 0)
- *len = ROUND(len_arg - 1, flash->sector_size);
+ *len = ROUND(len_arg, flash->sector_size);
else
*len = len_arg;
diff --git a/common/cmd_yaffs2.c b/common/cmd_yaffs2.c
index 7c01ea2..0e22d90 100644
--- a/common/cmd_yaffs2.c
+++ b/common/cmd_yaffs2.c
@@ -66,7 +66,7 @@ int do_ywr (cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
ulong value = simple_strtoul(argv[2], NULL, 16);
ulong numValues = simple_strtoul(argv[3], NULL, 16);
- printf ("Writing value (%x) %x times to %s... ", value, numValues, filename);
+ printf ("Writing value (%lx) %lx times to %s... ", value, numValues, filename);
cmd_yaffs_write_file(filename,value,numValues);
diff --git a/common/dlmalloc.c b/common/dlmalloc.c
index e9bab09..f2080c6 100644
--- a/common/dlmalloc.c
+++ b/common/dlmalloc.c
@@ -286,13 +286,6 @@ extern "C" {
*/
-#ifdef DEBUG
-#include <assert.h>
-#else
-#define assert(x) ((void)0)
-#endif
-
-
/*
INTERNAL_SIZE_T is the word-size used for internal bookkeeping
of chunk sizes. On a 64-bit machine, you can reduce malloc
diff --git a/drivers/net/phy/phy.c b/drivers/net/phy/phy.c
index ce69c19..833a051 100644
--- a/drivers/net/phy/phy.c
+++ b/drivers/net/phy/phy.c
@@ -318,13 +318,10 @@ static int genphy_parse_link(struct phy_device *phydev)
lpa = phy_read(phydev, MDIO_DEVAD_NONE, MII_ADVERTISE);
lpa &= phy_read(phydev, MDIO_DEVAD_NONE, MII_LPA);
- if (lpa & (LPA_100FULL | LPA_100HALF)) {
+ if (lpa & (LPA_100FULL | LPA_100HALF))
phydev->speed = SPEED_100;
- if (lpa & LPA_100FULL)
- phydev->duplex = DUPLEX_FULL;
-
- } else if (lpa & LPA_10FULL)
+ if (lpa & (LPA_100FULL | LPA_10FULL))
phydev->duplex = DUPLEX_FULL;
} else {
u32 bmcr = phy_read(phydev, MDIO_DEVAD_NONE, MII_BMCR);
@@ -692,7 +689,8 @@ struct phy_device *phy_connect(struct mii_dev *bus, int addr,
struct phy_device *phydev;
/* Reset the bus */
- bus->reset(bus);
+ if (bus->reset)
+ bus->reset(bus);
/* Wait 15ms to make sure the PHY has come out of hard reset */
udelay(15000);
diff --git a/drivers/net/smc911x.c b/drivers/net/smc911x.c
index aeafeba..a677fd4 100644
--- a/drivers/net/smc911x.c
+++ b/drivers/net/smc911x.c
@@ -50,7 +50,7 @@ static void smc911x_handle_mac_address(struct eth_device *dev)
printf(DRIVERNAME ": MAC %pM\n", m);
}
-static int smc911x_miiphy_read(struct eth_device *dev,
+static int smc911x_eth_phy_read(struct eth_device *dev,
u8 phy, u8 reg, u16 *val)
{
while (smc911x_get_mac_csr(dev, MII_ACC) & MII_ACC_MII_BUSY)
@@ -67,7 +67,7 @@ static int smc911x_miiphy_read(struct eth_device *dev,
return 0;
}
-static int smc911x_miiphy_write(struct eth_device *dev,
+static int smc911x_eth_phy_write(struct eth_device *dev,
u8 phy, u8 reg, u16 val)
{
while (smc911x_get_mac_csr(dev, MII_ACC) & MII_ACC_MII_BUSY)
@@ -103,10 +103,10 @@ static void smc911x_phy_configure(struct eth_device *dev)
smc911x_phy_reset(dev);
- smc911x_miiphy_write(dev, 1, MII_BMCR, BMCR_RESET);
+ smc911x_eth_phy_write(dev, 1, MII_BMCR, BMCR_RESET);
mdelay(1);
- smc911x_miiphy_write(dev, 1, MII_ADVERTISE, 0x01e1);
- smc911x_miiphy_write(dev, 1, MII_BMCR, BMCR_ANENABLE |
+ smc911x_eth_phy_write(dev, 1, MII_ADVERTISE, 0x01e1);
+ smc911x_eth_phy_write(dev, 1, MII_BMCR, BMCR_ANENABLE |
BMCR_ANRESTART);
timeout = 5000;
@@ -115,7 +115,7 @@ static void smc911x_phy_configure(struct eth_device *dev)
if ((timeout--) == 0)
goto err_out;
- if (smc911x_miiphy_read(dev, 1, MII_BMSR, &status) != 0)
+ if (smc911x_eth_phy_read(dev, 1, MII_BMSR, &status) != 0)
goto err_out;
} while (!(status & BMSR_LSTATUS));
@@ -235,6 +235,25 @@ static int smc911x_rx(struct eth_device *dev)
return 0;
}
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
+/* wrapper for smc911x_eth_phy_read */
+static int smc911x_miiphy_read(const char *devname, u8 phy, u8 reg, u16 *val)
+{
+ struct eth_device *dev = eth_get_dev_by_name(devname);
+ if (dev)
+ return smc911x_eth_phy_read(dev, phy, reg, val);
+ return -1;
+}
+/* wrapper for smc911x_eth_phy_write */
+static int smc911x_miiphy_write(const char *devname, u8 phy, u8 reg, u16 val)
+{
+ struct eth_device *dev = eth_get_dev_by_name(devname);
+ if (dev)
+ return smc911x_eth_phy_write(dev, phy, reg, val);
+ return -1;
+}
+#endif
+
int smc911x_initialize(u8 dev_num, int base_addr)
{
unsigned long addrl, addrh;
@@ -273,5 +292,10 @@ int smc911x_initialize(u8 dev_num, int base_addr)
sprintf(dev->name, "%s-%hu", DRIVERNAME, dev_num);
eth_register(dev);
+
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
+ miiphy_register(dev->name, smc911x_miiphy_read, smc911x_miiphy_write);
+#endif
+
return 1;
}
diff --git a/fs/ubifs/ubifs.c b/fs/ubifs/ubifs.c
index 61f70b2..2e6313a 100644
--- a/fs/ubifs/ubifs.c
+++ b/fs/ubifs/ubifs.c
@@ -686,6 +686,7 @@ int ubifs_load(char *filename, u32 addr, u32 size)
int i;
int count;
int last_block_size = 0;
+ char buf [10];
c->ubi = ubi_open_volume(c->vi.ubi_num, c->vi.vol_id, UBI_READONLY);
/* ubifs_findfile will resolve symlinks, so we know that we get
@@ -737,8 +738,11 @@ int ubifs_load(char *filename, u32 addr, u32 size)
if (err)
printf("Error reading file '%s'\n", filename);
- else
+ else {
+ sprintf(buf, "%lX", size);
+ setenv("filesize", buf);
printf("Done\n");
+ }
ubifs_iput(inode);
diff --git a/fs/yaffs2/Makefile b/fs/yaffs2/Makefile
index 7753cfc..6c50c81 100644
--- a/fs/yaffs2/Makefile
+++ b/fs/yaffs2/Makefile
@@ -31,7 +31,7 @@ SRCS := $(COBJS-y:.o=.c)
OBJS := $(addprefix $(obj),$(COBJS-y))
# -DCONFIG_YAFFS_NO_YAFFS1
-CFLAGS += -DCONFIG_YAFFS_DIRECT -DCONFIG_YAFFS_SHORT_NAMES_IN_RAM -DCONFIG_YAFFS_YAFFS2 -DNO_Y_INLINE -DLINUX_VERSION_CODE=0x20622
+CFLAGS += -DCONFIG_YAFFS_DIRECT -DCONFIG_YAFFS_SHORT_NAMES_IN_RAM -DCONFIG_YAFFS_YAFFS2 -DLINUX_VERSION_CODE=0x20622
all: $(LIB)
diff --git a/fs/yaffs2/yaffs_guts.c b/fs/yaffs2/yaffs_guts.c
index b368844..c67a085 100644
--- a/fs/yaffs2/yaffs_guts.c
+++ b/fs/yaffs2/yaffs_guts.c
@@ -391,17 +391,17 @@ static int yaffs_CountChunkBits(yaffs_Device * dev, int blk)
* Verification code
*/
-static int yaffs_SkipVerification(yaffs_Device *dev)
+static Y_INLINE int yaffs_SkipVerification(yaffs_Device *dev)
{
return !(yaffs_traceMask & (YAFFS_TRACE_VERIFY | YAFFS_TRACE_VERIFY_FULL));
}
-static int yaffs_SkipFullVerification(yaffs_Device *dev)
+static Y_INLINE int yaffs_SkipFullVerification(yaffs_Device *dev)
{
return !(yaffs_traceMask & (YAFFS_TRACE_VERIFY_FULL));
}
-static int yaffs_SkipNANDVerification(yaffs_Device *dev)
+static Y_INLINE int yaffs_SkipNANDVerification(yaffs_Device *dev)
{
return !(yaffs_traceMask & (YAFFS_TRACE_VERIFY_NAND));
}
@@ -2140,7 +2140,7 @@ yaffs_Object *yaffs_CreateNewObject(yaffs_Device * dev, int number,
{
yaffs_Object *theObject;
- yaffs_Tnode *tn;
+ yaffs_Tnode *tn = NULL;
if (number < 0) {
number = yaffs_CreateNewObjectNumber(dev);
@@ -2255,7 +2255,7 @@ static yaffs_Object *yaffs_MknodObject(yaffs_ObjectType type,
const YCHAR * aliasString, __u32 rdev)
{
yaffs_Object *in;
- YCHAR *str;
+ YCHAR *str = NULL;
yaffs_Device *dev = parent->myDev;
@@ -4605,8 +4605,8 @@ int yaffs_ReadDataFromFile(yaffs_Object * in, __u8 * buffer, loff_t offset,
int nBytes)
{
- int chunk;
- int start;
+ __u32 chunk;
+ __u32 start;
int nToCopy;
int n = nBytes;
int nDone = 0;
@@ -4725,8 +4725,8 @@ int yaffs_WriteDataToFile(yaffs_Object * in, const __u8 * buffer, loff_t offset,
int nBytes, int writeThrough)
{
- int chunk;
- int start;
+ __u32 chunk;
+ __u32 start;
int nToCopy;
int n = nBytes;
int nDone = 0;
@@ -4960,8 +4960,8 @@ int yaffs_ResizeFile(yaffs_Object * in, loff_t newSize)
{
int oldFileSize = in->variant.fileVariant.fileSize;
- int newSizeOfPartialChunk;
- int newFullChunks;
+ __u32 newSizeOfPartialChunk;
+ __u32 newFullChunks;
yaffs_Device *dev = in->myDev;
@@ -7232,7 +7232,8 @@ int yaffs_GutsInitialise(yaffs_Device * dev)
dev->nShortOpCaches = YAFFS_MAX_SHORT_OP_CACHES;
}
- buf = dev->srCache = YMALLOC(srCacheBytes);
+ dev->srCache = YMALLOC(srCacheBytes);
+ buf = (__u8 *)dev->srCache;
if(dev->srCache)
memset(dev->srCache,0,srCacheBytes);
diff --git a/fs/yaffs2/yaffs_nand.c b/fs/yaffs2/yaffs_nand.c
index e790be6..ce048cc 100644
--- a/fs/yaffs2/yaffs_nand.c
+++ b/fs/yaffs2/yaffs_nand.c
@@ -101,7 +101,7 @@ int yaffs_MarkBlockBad(yaffs_Device * dev, int blockNo)
int yaffs_QueryInitialBlockState(yaffs_Device * dev,
int blockNo,
yaffs_BlockState * state,
- unsigned *sequenceNumber)
+ int *sequenceNumber)
{
blockNo -= dev->blockOffset;
diff --git a/fs/yaffs2/yaffs_nand.h b/fs/yaffs2/yaffs_nand.h
index 48e3f7e..f3bedcf 100644
--- a/fs/yaffs2/yaffs_nand.h
+++ b/fs/yaffs2/yaffs_nand.h
@@ -33,7 +33,7 @@ int yaffs_MarkBlockBad(yaffs_Device * dev, int blockNo);
int yaffs_QueryInitialBlockState(yaffs_Device * dev,
int blockNo,
yaffs_BlockState * state,
- unsigned *sequenceNumber);
+ int *sequenceNumber);
int yaffs_EraseBlockInNAND(struct yaffs_DeviceStruct *dev,
int blockInNAND);
diff --git a/fs/yaffs2/yaffscfg.c b/fs/yaffs2/yaffscfg.c
index 16e84a4..01399ea 100644
--- a/fs/yaffs2/yaffscfg.c
+++ b/fs/yaffs2/yaffscfg.c
@@ -313,7 +313,7 @@ void cmd_yaffs_mread_file(char *fn, char *addr)
yaffs_stat(fn,&s);
- printf ("Copy %s to 0x%08x... ", fn, addr);
+ printf ("Copy %s to 0x%p... ", fn, addr);
h = yaffs_open(fn, O_RDWR,0);
if(h<0)
{
@@ -368,7 +368,7 @@ void cmd_yaffs_ls(const char *mountpt, int longlist)
{
sprintf(tempstr, "%s/%s", mountpt, de->d_name);
yaffs_stat(tempstr, &stat);
- printf("%-25s\t%7d\n",de->d_name, stat.st_size);
+ printf("%-25s\t%7ld\n",de->d_name, stat.st_size);
}
else
{
diff --git a/include/common.h b/include/common.h
index bd10f31..d244bd4 100644
--- a/include/common.h
+++ b/include/common.h
@@ -124,6 +124,27 @@ typedef volatile unsigned char vu_char;
#define debugX(level,fmt,args...)
#endif /* DEBUG */
+#ifdef DEBUG
+# define _DEBUG 1
+#else
+# define _DEBUG 0
+#endif
+
+/*
+ * An assertion is run-time check done in debug mode only. If DEBUG is not
+ * defined then it is skipped. If DEBUG is defined and the assertion fails,
+ * then it calls panic*( which may or may not reset/halt U-Boot (see
+ * CONFIG_PANIC_HANG), It is hoped that all failing assertions are found
+ * before release, and after release it is hoped that they don't matter. But
+ * in any case these failing assertions cannot be fixed with a reset (which
+ * may just do the same assertion again).
+ */
+void __assert_fail(const char *assertion, const char *file, unsigned line,
+ const char *function);
+#define assert(x) \
+ ({ if (!(x) && _DEBUG) \
+ __assert_fail(#x, __FILE__, __LINE__, __func__); })
+
#define error(fmt, args...) do { \
printf("ERROR: " fmt "\nat %s:%d/%s()\n", \
##args, __FILE__, __LINE__, __func__); \
@@ -760,7 +781,7 @@ int cpu_release(int nr, int argc, char * const argv[]);
#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
-#define ROUND(a,b) (((a) + (b)) & ~((b) - 1))
+#define ROUND(a,b) (((a) + (b) - 1) & ~((b) - 1))
#define DIV_ROUND(n,d) (((n) + ((d)/2)) / (d))
#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
#define roundup(x, y) ((((x) + ((y) - 1)) / (y)) * (y))
diff --git a/include/configs/cm4008.h b/include/configs/cm4008.h
index 6e4a3b4..81e4de4 100644
--- a/include/configs/cm4008.h
+++ b/include/configs/cm4008.h
@@ -114,6 +114,9 @@
#define CONFIG_NR_DRAM_BANKS 1 /* we have 1 bank of DRAM */
#define PHYS_SDRAM_1 0x00000000 /* SDRAM Bank #1 */
#define PHYS_SDRAM_1_SIZE 0x01000000 /* 16 MB */
+#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
+
+#define CONFIG_SYS_INIT_SP_ADDR 0x00020000 /* lowest 128k of RAM */
#define PHYS_FLASH_1 0x02000000 /* Flash Bank #1 */
#define PHYS_FLASH_SECT_SIZE 0x00020000 /* 128 KB sectors (x1) */
diff --git a/include/configs/cm41xx.h b/include/configs/cm41xx.h
index dca7d54..785ab0a 100644
--- a/include/configs/cm41xx.h
+++ b/include/configs/cm41xx.h
@@ -114,6 +114,9 @@
#define CONFIG_NR_DRAM_BANKS 1 /* we have 1 bank of DRAM */
#define PHYS_SDRAM_1 0x00000000 /* SDRAM Bank #1 */
#define PHYS_SDRAM_1_SIZE 0x02000000 /* 32 MB */
+#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM_1
+
+#define CONFIG_SYS_INIT_SP_ADDR 0x00020000 /* lowest 128k of RAM */
#define PHYS_FLASH_1 0x02000000 /* Flash Bank #1 */
#define PHYS_FLASH_SECT_SIZE 0x00020000 /* 128 KB sectors (x1) */
diff --git a/include/configs/mx31pdk.h b/include/configs/mx31pdk.h
index 35ceacd..1a5bdd1 100644
--- a/include/configs/mx31pdk.h
+++ b/include/configs/mx31pdk.h
@@ -61,6 +61,7 @@
#define CONFIG_MXC_UART
#define CONFIG_SYS_MX31_UART1
#define CONFIG_HW_WATCHDOG
+#define CONFIG_MXC_GPIO
#define CONFIG_HARD_SPI
#define CONFIG_MXC_SPI
diff --git a/include/malloc.h b/include/malloc.h
index 3e145ad..ecf3c67 100644
--- a/include/malloc.h
+++ b/include/malloc.h
@@ -285,14 +285,6 @@ extern "C" {
*/
-#ifdef DEBUG
-/* #include <assert.h> */
-#define assert(x) ((void)0)
-#else
-#define assert(x) ((void)0)
-#endif
-
-
/*
INTERNAL_SIZE_T is the word-size used for internal bookkeeping
of chunk sizes. On a 64-bit machine, you can reduce malloc
diff --git a/lib/qsort.c b/lib/qsort.c
index 1cc0d31..86c392c 100644
--- a/lib/qsort.c
+++ b/lib/qsort.c
@@ -17,11 +17,6 @@
#include <linux/types.h>
#include <exports.h>
-#if 0
-#include <assert.h>
-#else
-#define assert(arg)
-#endif
void qsort(void *base,
size_t nel,
diff --git a/lib/vsprintf.c b/lib/vsprintf.c
index c029fbb..79dead3 100644
--- a/lib/vsprintf.c
+++ b/lib/vsprintf.c
@@ -730,3 +730,11 @@ void panic(const char *fmt, ...)
while (1)
;
}
+
+void __assert_fail(const char *assertion, const char *file, unsigned line,
+ const char *function)
+{
+ /* This will not return */
+ panic("%s:%u: %s: Assertion `%s' failed.", file, line, function,
+ assertion);
+}
diff --git a/net/eth.c b/net/eth.c
index dbd1e2d..5911b1c 100644
--- a/net/eth.c
+++ b/net/eth.c
@@ -108,6 +108,8 @@ struct eth_device *eth_get_dev_by_name(const char *devname)
{
struct eth_device *dev, *target_dev;
+ BUG_ON(devname == NULL);
+
if (!eth_devices)
return NULL;