Skip to contentSkip to conversation

Makefile cleanup and u-boot size reduction

U-Boot Superseded Jean-Christophe PLAGNIOL-VILLARD 4 participants 42 messages Aug 28, 2008 – Aug 31, 2008

Subsystems (10)
Network drivers VFS Kbuild SPI +6 more subsystems
lore
Share & tools
lore
#0 lore raw

Hi,

1)The following patchset will continue the move of conditional compile to Makefile and do some file location move

2) It will merge the current list implementation for common/device & co to linux list.h in order to reduce u-boot size. During test It did show the the patch will reduce u-boot size by 1KB min.

Best Regards,
J.

#1 lore raw

PATCH 1/12 gunzip: move to lib_generic

---
 common/Makefile                  |    1 -
 lib_generic/Makefile             |    1 +
 {common => lib_generic}/gunzip.c |    0 
 3 files changed, 1 insertions(+), 1 deletions(-)
 rename {common => lib_generic}/gunzip.c (100%)
common/Makefile +0 -1
index 944b1c0..d974823 100644
@@ -36,7 +36,6 @@ COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
 COBJS-$(CONFIG_CMD_BEDBUG) += cmd_bedbug.o
 COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o
 COBJS-y += image.o
-COBJS-y += gunzip.o
 COBJS-y += cmd_boot.o
 COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o
 COBJS-y += cmd_bootm.o
lib_generic/Makefile +1 -0
index bf0e31d..a820f97 100644
@@ -34,6 +34,7 @@ COBJS-y += crc32.o
 COBJS-y += ctype.o
 COBJS-y += display_options.o
 COBJS-y += div64.o
+COBJS-y += gunzip.o
 COBJS-y += lmb.o
 COBJS-y += ldiv.o
 COBJS-$(CONFIG_MD5) += md5.o
lib_generic/gunzip.c renamed from common/gunzip.c +0 -0
similarity index 100%
rename from common/gunzip.c
rename to lib_generic/gunzip.c
Signature · 1 line
1.5.6.3
#2 lore raw

PATCH 2/12 soft_i2c: move to drivers/i2c

---
 common/Makefile                    |    1 -
 drivers/i2c/Makefile               |    1 +
 {common => drivers/i2c}/soft_i2c.c |    0 
 3 files changed, 1 insertions(+), 1 deletions(-)
 rename {common => drivers/i2c}/soft_i2c.c (100%)
common/Makefile +0 -1
index d974823..faeac86 100644
@@ -137,7 +137,6 @@ COBJS-$(CONFIG_BITBANGMII) += miiphybb.o
 COBJS-y += miiphyutil.o
 COBJS-y += s_record.o
 COBJS-y += serial.o
-COBJS-$(CONFIG_SOFT_I2C) += soft_i2c.o
 COBJS-$(CONFIG_SOFT_SPI) += soft_spi.o
 ifdef CONFIG_CMD_USB
 COBJS-y += usb.o
drivers/i2c/Makefile +1 -0
index 1f25afb..6079c05 100644
@@ -29,6 +29,7 @@ COBJS-$(CONFIG_FSL_I2C) += fsl_i2c.o
 COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP1510_I2C) += omap1510_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP24XX_I2C) += omap24xx_i2c.o
+COBJS-$(CONFIG_SOFT_I2C) += soft_i2c.o
 COBJS-$(CONFIG_TSI108_I2C) += tsi108_i2c.o
 
 COBJS	:= $(COBJS-y)
drivers/i2c/soft_i2c.c renamed from common/soft_i2c.c +0 -0
similarity index 100%
rename from common/soft_i2c.c
rename to drivers/i2c/soft_i2c.c
Signature · 1 line
1.5.6.3
#3 lore raw

PATCH 3/12 soft_spi: move to drivers/spi

---
 common/Makefile                    |    1 -
 drivers/spi/Makefile               |    3 ++-
 {common => drivers/spi}/soft_spi.c |    0 
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename {common => drivers/spi}/soft_spi.c (100%)
common/Makefile +0 -1
index faeac86..3e4829f 100644
@@ -137,7 +137,6 @@ COBJS-$(CONFIG_BITBANGMII) += miiphybb.o
 COBJS-y += miiphyutil.o
 COBJS-y += s_record.o
 COBJS-y += serial.o
-COBJS-$(CONFIG_SOFT_SPI) += soft_spi.o
 ifdef CONFIG_CMD_USB
 COBJS-y += usb.o
 COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
drivers/spi/Makefile +2 -1
index 4f7b679..15e0f7a 100644
@@ -25,9 +25,10 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libspi.a
 
-COBJS-$(CONFIG_MPC8XXX_SPI) += mpc8xxx_spi.o
 COBJS-$(CONFIG_ATMEL_SPI) += atmel_spi.o
+COBJS-$(CONFIG_MPC8XXX_SPI) += mpc8xxx_spi.o
 COBJS-$(CONFIG_MXC_SPI) += mxc_spi.o
+COBJS-$(CONFIG_SOFT_SPI) += soft_spi.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
drivers/spi/soft_spi.c renamed from common/soft_spi.c +0 -0
similarity index 100%
rename from common/soft_spi.c
rename to drivers/spi/soft_spi.c
Signature · 1 line
1.5.6.3
#4 lore raw

PATCH 4/12 miiphybb: move to drivers/net

---
 common/Makefile                    |    1 -
 drivers/net/Makefile               |    1 +
 {common => drivers/net}/miiphybb.c |    0 
 3 files changed, 1 insertions(+), 1 deletions(-)
 rename {common => drivers/net}/miiphybb.c (100%)
common/Makefile +0 -1
index 3e4829f..ff2e6c6 100644
@@ -133,7 +133,6 @@ COBJS-$(CONFIG_LCD) += lcd.o
 COBJS-y += lists.o
 COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
 COBJS-y += memsize.o
-COBJS-$(CONFIG_BITBANGMII) += miiphybb.o
 COBJS-y += miiphyutil.o
 COBJS-y += s_record.o
 COBJS-y += serial.o
drivers/net/Makefile +1 -0
index bcf31cb..0e86b72 100644
@@ -41,6 +41,7 @@ COBJS-$(CONFIG_DRIVER_KS8695ETH) += ks8695eth.o
 COBJS-$(CONFIG_DRIVER_LAN91C96) += lan91c96.o
 COBJS-$(CONFIG_MACB) += macb.o
 COBJS-$(CONFIG_MCFFEC) += mcffec.o
+COBJS-$(CONFIG_BITBANGMII) += miiphybb.o
 COBJS-$(CONFIG_NATSEMI) += natsemi.o
 ifeq ($(CONFIG_DRIVER_NE2000),y)
 COBJS-y += ne2000.o
drivers/net/miiphybb.c renamed from common/miiphybb.c +0 -0
similarity index 100%
rename from common/miiphybb.c
rename to drivers/net/miiphybb.c
Signature · 1 line
1.5.6.3
#5 lore raw

PATCH 5/12 crc16: move to lib_generic

---
 common/Makefile                 |    1 -
 lib_generic/Makefile            |    1 +
 {common => lib_generic}/crc16.c |    0 
 3 files changed, 1 insertions(+), 1 deletions(-)
 rename {common => lib_generic}/crc16.c (100%)
common/Makefile +0 -1
index ff2e6c6..0c8ef5b 100644
@@ -141,7 +141,6 @@ COBJS-y += usb.o
 COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
 endif
 COBJS-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
-COBJS-y += crc16.o
 COBJS-y += xyzModem.o
 COBJS-y += cmd_mac.o
 COBJS-$(CONFIG_CMD_MFSL) += cmd_mfsl.o
lib_generic/Makefile +1 -0
index a820f97..7df5a2c 100644
@@ -30,6 +30,7 @@ COBJS-y += bzlib_crctable.o
 COBJS-y += bzlib_decompress.o
 COBJS-y += bzlib_randtable.o
 COBJS-y += bzlib_huffman.o
+COBJS-y += crc16.o
 COBJS-y += crc32.o
 COBJS-y += ctype.o
 COBJS-y += display_options.o
lib_generic/crc16.c renamed from common/crc16.c +0 -0
similarity index 100%
rename from common/crc16.c
rename to lib_generic/crc16.c
Signature · 1 line
1.5.6.3
#6 lore raw

PATCH 6/12 autoscript: Move conditional compilation to Makefile

---
 common/Makefile                           |    3 +-
 common/{cmd_autoscript.c => autoscript.c} |   44 --------
 common/cmd_autoscript.c                   |  158 -----------------------------
 3 files changed, 2 insertions(+), 203 deletions(-)
 copy common/{cmd_autoscript.c => autoscript.c} (79%)
common/Makefile +2 -1
index 0c8ef5b..92d7a9e 100644
@@ -31,7 +31,8 @@ COBJS-y += main.o
 COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o
 COBJS-y += circbuf.o
 COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o
-COBJS-y += cmd_autoscript.o
+COBJS-$(CONFIG_AUTOSCRIPT)$(CONFIG_CMD_AUTOSCRIPT) += autoscript.o
+COBJS-$(CONFIG_CMD_AUTOSCRIPT) += cmd_autoscript.o
 COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
 COBJS-$(CONFIG_CMD_BEDBUG) += cmd_bedbug.o
 COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o
common/autoscript.c renamed from common/cmd_autoscript.c +0 -44

53 lines not on this page · raw message

common/cmd_autoscript.c +0 -158

167 lines not on this page · raw message

Signature · 1 line
1.5.6.3
#7 lore raw

PATCH 7/12 miiphyutil: Move conditional compilation to Makefile

---
 common/Makefile     |    2 +-
 common/miiphyutil.c |    2 --
 2 files changed, 1 insertions(+), 3 deletions(-)
common/Makefile +1 -1
index 92d7a9e..7db70f5 100644
@@ -85,6 +85,7 @@ COBJS-$(CONFIG_CMD_LICENSE) += cmd_license.o
 COBJS-y += cmd_load.o
 COBJS-$(CONFIG_LOGBUFFER) += cmd_log.o
 COBJS-y += cmd_mem.o
+COBJS-$(CONFIG_MII)$(CONFIG_CMD_MII) += miiphyutil.o
 COBJS-$(CONFIG_CMD_MII) += cmd_mii.o
 COBJS-$(CONFIG_CMD_MISC) += cmd_misc.o
 COBJS-$(CONFIG_CMD_MMC) += cmd_mmc.o
@@ -134,7 +135,6 @@ COBJS-$(CONFIG_LCD) += lcd.o
 COBJS-y += lists.o
 COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
 COBJS-y += memsize.o
-COBJS-y += miiphyutil.o
 COBJS-y += s_record.o
 COBJS-y += serial.o
 ifdef CONFIG_CMD_USB
common/miiphyutil.c +0 -2
index eac8275..5ef4a33 100644
@@ -29,7 +29,6 @@
 #include <common.h>
 #include <miiphy.h>
 
-#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
 #include <asm/types.h>
 #include <linux/list.h>
 #include <malloc.h>
@@ -487,4 +486,3 @@ int miiphy_link (char *devname, unsigned char addr)
 	}
 }
 #endif
-#endif /* CONFIG_MII */
Signature · 1 line
1.5.6.3
#8 lore raw

PATCH 8/12 common/Makefile: order by functionality

---
 common/Makefile |   71 +++++++++++++++++++++++++++++-------------------------
 1 files changed, 38 insertions(+), 33 deletions(-)
common/Makefile +38 -33
index 7db70f5..99781fe 100644
@@ -27,16 +27,41 @@ LIB	= $(obj)libcommon.a
 
 AOBJS	=
 
+# core
 COBJS-y += main.o
-COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o
 COBJS-y += circbuf.o
+COBJS-y += console.o
+COBJS-y += command.o
+COBJS-y += devices.o
+COBJS-y += dlmalloc.o
+COBJS-y += exports.o
+COBJS-y += hush.o
+COBJS-y += image.o
+COBJS-y += lists.o
+COBJS-y += memsize.o
+COBJS-y += s_record.o
+COBJS-y += serial.o
+COBJS-y += xyzModem.o
+
+# environment
+COBJS-y += environment.o
+COBJS-y += env_common.o
+COBJS-y += env_dataflash.o
+COBJS-y += env_eeprom.o
+COBJS-y += env_flash.o
+COBJS-y += env_nand.o
+COBJS-y += env_nvram.o
+COBJS-y += env_onenand.o
+COBJS-y += env_sf.o
+COBJS-y += env_nowhere.o
+
+# command
 COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o
 COBJS-$(CONFIG_AUTOSCRIPT)$(CONFIG_CMD_AUTOSCRIPT) += autoscript.o
 COBJS-$(CONFIG_CMD_AUTOSCRIPT) += cmd_autoscript.o
 COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
-COBJS-$(CONFIG_CMD_BEDBUG) += cmd_bedbug.o
+COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o cmd_bedbug.o
 COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o
-COBJS-y += image.o
 COBJS-y += cmd_boot.o
 COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o
 COBJS-y += cmd_bootm.o
@@ -84,11 +109,14 @@ COBJS-$(CONFIG_CMD_JFFS2) += cmd_jffs2.o
 COBJS-$(CONFIG_CMD_LICENSE) += cmd_license.o
 COBJS-y += cmd_load.o
 COBJS-$(CONFIG_LOGBUFFER) += cmd_log.o
+COBJS-y += cmd_mac.o
 COBJS-y += cmd_mem.o
+COBJS-$(CONFIG_CMD_MFSL) += cmd_mfsl.o
 COBJS-$(CONFIG_MII)$(CONFIG_CMD_MII) += miiphyutil.o
 COBJS-$(CONFIG_CMD_MII) += cmd_mii.o
 COBJS-$(CONFIG_CMD_MISC) += cmd_misc.o
 COBJS-$(CONFIG_CMD_MMC) += cmd_mmc.o
+COBJS-$(CONFIG_MP) += cmd_mp.o
 COBJS-y += cmd_nand.o
 COBJS-$(CONFIG_CMD_NET) += cmd_net.o
 COBJS-y += cmd_nvedit.o
@@ -102,53 +130,30 @@ COBJS-$(CONFIG_CMD_PORTIO) += cmd_portio.o
 COBJS-$(CONFIG_CMD_REGINFO) += cmd_reginfo.o
 COBJS-$(CONFIG_CMD_REISER) += cmd_reiser.o
 COBJS-$(CONFIG_CMD_SATA) += cmd_sata.o
+COBJS-$(CONFIG_CMD_SF) += cmd_sf.o
 COBJS-$(CONFIG_CMD_SCSI) += cmd_scsi.o
 COBJS-$(CONFIG_CMD_SETEXPR) += cmd_setexpr.o
 COBJS-$(CONFIG_CMD_SPI) += cmd_spi.o
 COBJS-$(CONFIG_CMD_STRINGS) += cmd_strings.o
 COBJS-$(CONFIG_CMD_TERMINAL) += cmd_terminal.o
 COBJS-$(CONFIG_CMD_UNIVERSE) += cmd_universe.o
-COBJS-$(CONFIG_CMD_USB) += cmd_usb.o
+ifdef CONFIG_CMD_USB
+COBJS-y += cmd_usb.o
+COBJS-y += usb.o
+COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
+endif
 COBJS-$(CONFIG_CMD_XIMG) += cmd_ximg.o
 COBJS-$(CONFIG_YAFFS2) += cmd_yaffs2.o
 COBJS-y += cmd_vfd.o
-COBJS-y += command.o
-COBJS-y += console.o
-COBJS-y += devices.o
-COBJS-y += dlmalloc.o
 COBJS-$(CONFIG_CMD_DOC) += docecc.o
-COBJS-y += environment.o
-COBJS-y += env_common.o
-COBJS-y += env_nand.o
-COBJS-y += env_dataflash.o
-COBJS-y += env_flash.o
-COBJS-y += env_eeprom.o
-COBJS-y += env_onenand.o
-COBJS-y += env_sf.o
-COBJS-y += env_nvram.o
-COBJS-y += env_nowhere.o
-COBJS-y += exports.o
 COBJS-y += flash.o
-COBJS-y += hush.o
 COBJS-y += kgdb.o
 COBJS-$(CONFIG_LCD) += lcd.o
-COBJS-y += lists.o
 COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
-COBJS-y += memsize.o
-COBJS-y += s_record.o
-COBJS-y += serial.o
-ifdef CONFIG_CMD_USB
-COBJS-y += usb.o
-COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
-endif
 COBJS-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
-COBJS-y += xyzModem.o
-COBJS-y += cmd_mac.o
-COBJS-$(CONFIG_CMD_MFSL) += cmd_mfsl.o
-COBJS-$(CONFIG_MP) += cmd_mp.o
-COBJS-$(CONFIG_CMD_SF) += cmd_sf.o
 COBJS-$(CONFIG_DDR_SPD) += ddr_spd.o
 
+COBJS-y	+= $(COBJS-yy)
 COBJS	:= $(COBJS-y)
 SRCS	:= $(AOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS))
Signature · 1 line
1.5.6.3
#9 lore raw

PATCH 9/12 cmd_terminal: remove no need ifdef

---
 common/cmd_terminal.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
common/cmd_terminal.c +0 -4
index 8871607..57943c1 100644
@@ -28,8 +28,6 @@
 #include <command.h>
 #include <devices.h>
 
-#if defined(CONFIG_CMD_TERMINAL)
-
 int do_terminal(cmd_tbl_t * cmd, int flag, int argc, char *argv[])
 {
 	int i, l;
@@ -98,5 +96,3 @@ U_BOOT_CMD(
 	"terminal - start terminal emulator\n",
 	""
 );
-
-#endif /* CONFIG_CMD_TERMINAL */
Signature · 1 line
1.5.6.3
#10 lore raw

PATCH 10/12 update linux/list

---
 include/linux/list.h   |  506 +++++++++++++++++++++++++++++++++++++++++++-----
 include/linux/poison.h |   13 ++
 2 files changed, 474 insertions(+), 45 deletions(-)
 create mode 100644 include/linux/poison.h
include/linux/list.h +461 -45
index e6492f7..aeeeb21 100644
@@ -1,6 +1,9 @@
 #ifndef _LINUX_LIST_H
 #define _LINUX_LIST_H
 
+#include <linux/stddef.h>
+#include <linux/poison.h>
+
 #ifndef ARCH_HAS_PREFETCH
 #define ARCH_HAS_PREFETCH
 static inline void prefetch(const void *x) {;}
@@ -25,9 +28,11 @@ struct list_head {
 #define LIST_HEAD(name) \
 	struct list_head name = LIST_HEAD_INIT(name)
 
-#define INIT_LIST_HEAD(ptr) do { \
-	(ptr)->next = (ptr); (ptr)->prev = (ptr); \
-} while (0)
+static inline void INIT_LIST_HEAD(struct list_head *list)
+{
+	list->next = list;
+	list->prev = list;
+}
 
 /*
  * Insert a new entry between two known consecutive entries.
@@ -87,13 +92,37 @@ static inline void __list_del(struct list_head *prev, struct list_head *next)
 /**
  * list_del - deletes entry from list.
  * @entry: the element to delete from the list.
- * Note: list_empty on entry does not return true after this, the entry is in an undefined state.
+ * Note: list_empty() on entry does not return true after this, the entry is
+ * in an undefined state.
  */
 static inline void list_del(struct list_head *entry)
 {
 	__list_del(entry->prev, entry->next);
-	entry->next = (void *) 0;
-	entry->prev = (void *) 0;
+	entry->next = LIST_POISON1;
+	entry->prev = LIST_POISON2;
+}
+
+/**
+ * list_replace - replace old entry by new one
+ * @old : the element to be replaced
+ * @new : the new element to insert
+ *
+ * If @old was empty, it will be overwritten.
+ */
+static inline void list_replace(struct list_head *old,
+				struct list_head *new)
+{
+	new->next = old->next;
+	new->next->prev = new;
+	new->prev = old->prev;
+	new->prev->next = new;
+}
+
+static inline void list_replace_init(struct list_head *old,
+					struct list_head *new)
+{
+	list_replace(old, new);
+	INIT_LIST_HEAD(old);
 }
 
 /**
@@ -130,37 +159,129 @@ static inline void list_move_tail(struct list_head *list,
 }
 
 /**
+ * list_is_last - tests whether @list is the last entry in list @head
+ * @list: the entry to test
+ * @head: the head of the list
+ */
+static inline int list_is_last(const struct list_head *list,
+				const struct list_head *head)
+{
+	return list->next == head;
+}
+
+/**
  * list_empty - tests whether a list is empty
  * @head: the list to test.
  */
-static inline int list_empty(struct list_head *head)
+static inline int list_empty(const struct list_head *head)
 {
 	return head->next == head;
 }
 
-static inline void __list_splice(struct list_head *list,
-				 struct list_head *head)
+/**
+ * list_empty_careful - tests whether a list is empty and not being modified
+ * @head: the list to test
+ *
+ * Description:
+ * tests whether a list is empty _and_ checks that no other CPU might be
+ * in the process of modifying either member (next or prev)
+ *
+ * NOTE: using list_empty_careful() without synchronization
+ * can only be safe if the only activity that can happen
+ * to the list entry is list_del_init(). Eg. it cannot be used
+ * if another CPU could re-list_add() it.
+ */
+static inline int list_empty_careful(const struct list_head *head)
+{
+	struct list_head *next = head->next;
+	return (next == head) && (next == head->prev);
+}
+
+/**
+ * list_is_singular - tests whether a list has just one entry.
+ * @head: the list to test.
+ */
+static inline int list_is_singular(const struct list_head *head)
+{
+	return !list_empty(head) && (head->next == head->prev);
+}
+
+static inline void __list_cut_position(struct list_head *list,
+		struct list_head *head, struct list_head *entry)
+{
+	struct list_head *new_first = entry->next;
+	list->next = head->next;
+	list->next->prev = list;
+	list->prev = entry;
+	entry->next = list;
+	head->next = new_first;
+	new_first->prev = head;
+}
+
+/**
+ * list_cut_position - cut a list into two
+ * @list: a new list to add all removed entries
+ * @head: a list with entries
+ * @entry: an entry within head, could be the head itself
+ *	and if so we won't cut the list
+ *
+ * This helper moves the initial part of @head, up to and
+ * including @entry, from @head to @list. You should
+ * pass on @entry an element you know is on @head. @list
+ * should be an empty list or a list you do not care about
+ * losing its data.
+ *
+ */
+static inline void list_cut_position(struct list_head *list,
+		struct list_head *head, struct list_head *entry)
+{
+	if (list_empty(head))
+		return;
+	if (list_is_singular(head) &&
+		(head->next != entry && head != entry))
+		return;
+	if (entry == head)
+		INIT_LIST_HEAD(list);
+	else
+		__list_cut_position(list, head, entry);
+}
+
+static inline void __list_splice(const struct list_head *list,
+				 struct list_head *prev,
+				 struct list_head *next)
 {
 	struct list_head *first = list->next;
 	struct list_head *last = list->prev;
-	struct list_head *at = head->next;
 
-	first->prev = head;
-	head->next = first;
+	first->prev = prev;
+	prev->next = first;
 
-	last->next = at;
-	at->prev = last;
+	last->next = next;
+	next->prev = last;
 }
 
 /**
- * list_splice - join two lists
+ * list_splice - join two lists, this is designed for stacks
  * @list: the new list to add.
  * @head: the place to add it in the first list.
  */
-static inline void list_splice(struct list_head *list, struct list_head *head)
+static inline void list_splice(const struct list_head *list,
+				struct list_head *head)
 {
 	if (!list_empty(list))
-		__list_splice(list, head);
+		__list_splice(list, head, head->next);
+}
+
+/**
+ * list_splice_tail - join two lists, each list being a queue
+ * @list: the new list to add.
+ * @head: the place to add it in the first list.
+ */
+static inline void list_splice_tail(struct list_head *list,
+				struct list_head *head)
+{
+	if (!list_empty(list))
+		__list_splice(list, head->prev, head);
 }
 
 /**
@@ -174,7 +295,24 @@ static inline void list_splice_init(struct list_head *list,
 				    struct list_head *head)
 {
 	if (!list_empty(list)) {
-		__list_splice(list, head);
+		__list_splice(list, head, head->next);
+		INIT_LIST_HEAD(list);
+	}
+}
+
+/**
+ * list_splice_tail_init - join two lists and reinitialise the emptied list
+ * @list: the new list to add.
+ * @head: the place to add it in the first list.
+ *
+ * Each of the lists is a queue.
+ * The list at @list is reinitialised
+ */
+static inline void list_splice_tail_init(struct list_head *list,
+					 struct list_head *head)
+{
+	if (!list_empty(list)) {
+		__list_splice(list, head->prev, head);
 		INIT_LIST_HEAD(list);
 	}
 }
@@ -186,28 +324,53 @@ static inline void list_splice_init(struct list_head *list,
  * @member:	the name of the list_struct within the struct.
  */
 #define list_entry(ptr, type, member) \
-	((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
+	container_of(ptr, type, member)
+
+/**
+ * list_first_entry - get the first element from a list
+ * @ptr:	the list head to take the element from.
+ * @type:	the type of the struct this is embedded in.
+ * @member:	the name of the list_struct within the struct.
+ *
+ * Note, that list is expected to be not empty.
+ */
+#define list_first_entry(ptr, type, member) \
+	list_entry((ptr)->next, type, member)
 
 /**
  * list_for_each	-	iterate over a list
- * @pos:	the &struct list_head to use as a loop counter.
+ * @pos:	the &struct list_head to use as a loop cursor.
  * @head:	the head for your list.
  */
 #define list_for_each(pos, head) \
-	for (pos = (head)->next, prefetch(pos->next); pos != (head); \
-		pos = pos->next, prefetch(pos->next))
+	for (pos = (head)->next; prefetch(pos->next), pos != (head); \
+        	pos = pos->next)
+
+/**
+ * __list_for_each	-	iterate over a list
+ * @pos:	the &struct list_head to use as a loop cursor.
+ * @head:	the head for your list.
+ *
+ * This variant differs from list_for_each() in that it's the
+ * simplest possible list iteration code, no prefetching is done.
+ * Use this for code that knows the list to be very short (empty
+ * or 1 entry) most of the time.
+ */
+#define __list_for_each(pos, head) \
+	for (pos = (head)->next; pos != (head); pos = pos->next)
+
 /**
  * list_for_each_prev	-	iterate over a list backwards
- * @pos:	the &struct list_head to use as a loop counter.
+ * @pos:	the &struct list_head to use as a loop cursor.
  * @head:	the head for your list.
  */
 #define list_for_each_prev(pos, head) \
-	for (pos = (head)->prev, prefetch(pos->prev); pos != (head); \
-		pos = pos->prev, prefetch(pos->prev))
+	for (pos = (head)->prev; prefetch(pos->prev), pos != (head); \
+        	pos = pos->prev)
 
 /**
- * list_for_each_safe	-	iterate over a list safe against removal of list entry
- * @pos:	the &struct list_head to use as a loop counter.
+ * list_for_each_safe - iterate over a list safe against removal of list entry
+ * @pos:	the &struct list_head to use as a loop cursor.
  * @n:		another &struct list_head to use as temporary storage
  * @head:	the head for your list.
  */
@@ -216,43 +379,296 @@ static inline void list_splice_init(struct list_head *list,
 		pos = n, n = pos->next)
 
 /**
+ * list_for_each_prev_safe - iterate over a list backwards safe against removal of list entry
+ * @pos:	the &struct list_head to use as a loop cursor.
+ * @n:		another &struct list_head to use as temporary storage
+ * @head:	the head for your list.
+ */
+#define list_for_each_prev_safe(pos, n, head) \
+	for (pos = (head)->prev, n = pos->prev; \
+	     prefetch(pos->prev), pos != (head); \
+	     pos = n, n = pos->prev)
+
+/**
  * list_for_each_entry	-	iterate over list of given type
- * @pos:	the type * to use as a loop counter.
+ * @pos:	the type * to use as a loop cursor.
  * @head:	the head for your list.
  * @member:	the name of the list_struct within the struct.
  */
 #define list_for_each_entry(pos, head, member)				\
-	for (pos = list_entry((head)->next, typeof(*pos), member),	\
-		     prefetch(pos->member.next);			\
-	     &pos->member != (head);					\
-	     pos = list_entry(pos->member.next, typeof(*pos), member),	\
-		     prefetch(pos->member.next))
+	for (pos = list_entry((head)->next, typeof(*pos), member);	\
+	     prefetch(pos->member.next), &pos->member != (head); 	\
+	     pos = list_entry(pos->member.next, typeof(*pos), member))
+
+/**
+ * list_for_each_entry_reverse - iterate backwards over list of given type.
+ * @pos:	the type * to use as a loop cursor.
+ * @head:	the head for your list.
+ * @member:	the name of the list_struct within the struct.
+ */
+#define list_for_each_entry_reverse(pos, head, member)			\
+	for (pos = list_entry((head)->prev, typeof(*pos), member);	\
+	     prefetch(pos->member.prev), &pos->member != (head); 	\
+	     pos = list_entry(pos->member.prev, typeof(*pos), member))
+
+/**
+ * list_prepare_entry - prepare a pos entry for use in list_for_each_entry_continue()
+ * @pos:	the type * to use as a start point
+ * @head:	the head of the list
+ * @member:	the name of the list_struct within the struct.
+ *
+ * Prepares a pos entry for use as a start point in list_for_each_entry_continue().
+ */
+#define list_prepare_entry(pos, head, member) \
+	((pos) ? : list_entry(head, typeof(*pos), member))
+
+/**
+ * list_for_each_entry_continue - continue iteration over list of given type
+ * @pos:	the type * to use as a loop cursor.
+ * @head:	the head for your list.
+ * @member:	the name of the list_struct within the struct.
+ *
+ * Continue to iterate over list of given type, continuing after
+ * the current position.
+ */
+#define list_for_each_entry_continue(pos, head, member) 		\
+	for (pos = list_entry(pos->member.next, typeof(*pos), member);	\
+	     prefetch(pos->member.next), &pos->member != (head);	\
+	     pos = list_entry(pos->member.next, typeof(*pos), member))
+
+/**
+ * list_for_each_entry_continue_reverse - iterate backwards from the given point
+ * @pos:	the type * to use as a loop cursor.
+ * @head:	the head for your list.
+ * @member:	the name of the list_struct within the struct.
+ *
+ * Start to iterate over list of given type backwards, continuing after
+ * the current position.
+ */
+#define list_for_each_entry_continue_reverse(pos, head, member)		\
+	for (pos = list_entry(pos->member.prev, typeof(*pos), member);	\
+	     prefetch(pos->member.prev), &pos->member != (head);	\
+	     pos = list_entry(pos->member.prev, typeof(*pos), member))
+
+/**
+ * list_for_each_entry_from - iterate over list of given type from the current point
+ * @pos:	the type * to use as a loop cursor.
+ * @head:	the head for your list.
+ * @member:	the name of the list_struct within the struct.
+ *
+ * Iterate over list of given type, continuing from current position.
+ */
+#define list_for_each_entry_from(pos, head, member) 			\
+	for (; prefetch(pos->member.next), &pos->member != (head);	\
+	     pos = list_entry(pos->member.next, typeof(*pos), member))
 
 /**
  * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
- * @pos:	the type * to use as a loop counter.
+ * @pos:	the type * to use as a loop cursor.
  * @n:		another type * to use as temporary storage
  * @head:	the head for your list.
  * @member:	the name of the list_struct within the struct.
  */
 #define list_for_each_entry_safe(pos, n, head, member)			\
 	for (pos = list_entry((head)->next, typeof(*pos), member),	\
-		n = list_entry(pos->member.next, typeof(*pos), member); \
-	     &pos->member != (head);					\
+		n = list_entry(pos->member.next, typeof(*pos), member);	\
+	     &pos->member != (head); 					\
 	     pos = n, n = list_entry(n->member.next, typeof(*n), member))
 
 /**
- * list_for_each_entry_continue -	iterate over list of given type
- *			continuing after existing point
- * @pos:	the type * to use as a loop counter.
+ * list_for_each_entry_safe_continue
+ * @pos:	the type * to use as a loop cursor.
+ * @n:		another type * to use as temporary storage
  * @head:	the head for your list.
  * @member:	the name of the list_struct within the struct.
+ *
+ * Iterate over list of given type, continuing after current point,
+ * safe against removal of list entry.
+ */
+#define list_for_each_entry_safe_continue(pos, n, head, member) 		\
+	for (pos = list_entry(pos->member.next, typeof(*pos), member), 		\
+		n = list_entry(pos->member.next, typeof(*pos), member);		\
+	     &pos->member != (head);						\
+	     pos = n, n = list_entry(n->member.next, typeof(*n), member))
+
+/**
+ * list_for_each_entry_safe_from
+ * @pos:	the type * to use as a loop cursor.
+ * @n:		another type * to use as temporary storage
+ * @head:	the head for your list.
+ * @member:	the name of the list_struct within the struct.
+ *
+ * Iterate over list of given type from current point, safe against
+ * removal of list entry.
+ */
+#define list_for_each_entry_safe_from(pos, n, head, member) 			\
+	for (n = list_entry(pos->member.next, typeof(*pos), member);		\
+	     &pos->member != (head);						\
+	     pos = n, n = list_entry(n->member.next, typeof(*n), member))
+
+/**
+ * list_for_each_entry_safe_reverse
+ * @pos:	the type * to use as a loop cursor.
+ * @n:		another type * to use as temporary storage
+ * @head:	the head for your list.
+ * @member:	the name of the list_struct within the struct.
+ *
+ * Iterate backwards over list of given type, safe against removal
+ * of list entry.
+ */
+#define list_for_each_entry_safe_reverse(pos, n, head, member)		\
+	for (pos = list_entry((head)->prev, typeof(*pos), member),	\
+		n = list_entry(pos->member.prev, typeof(*pos), member);	\
+	     &pos->member != (head); 					\
+	     pos = n, n = list_entry(n->member.prev, typeof(*n), member))
+
+/*
+ * Double linked lists with a single pointer list head.
+ * Mostly useful for hash tables where the two pointer list head is
+ * too wasteful.
+ * You lose the ability to access the tail in O(1).
+ */
+
+struct hlist_head {
+	struct hlist_node *first;
+};
+
+struct hlist_node {
+	struct hlist_node *next, **pprev;
+};
+
+#define HLIST_HEAD_INIT { .first = NULL }
+#define HLIST_HEAD(name) struct hlist_head name = {  .first = NULL }
+#define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL)
+static inline void INIT_HLIST_NODE(struct hlist_node *h)
+{
+	h->next = NULL;
+	h->pprev = NULL;
+}
+
+static inline int hlist_unhashed(const struct hlist_node *h)
+{
+	return !h->pprev;
+}
+
+static inline int hlist_empty(const struct hlist_head *h)
+{
+	return !h->first;
+}
+
+static inline void __hlist_del(struct hlist_node *n)
+{
+	struct hlist_node *next = n->next;
+	struct hlist_node **pprev = n->pprev;
+	*pprev = next;
+	if (next)
+		next->pprev = pprev;
+}
+
+static inline void hlist_del(struct hlist_node *n)
+{
+	__hlist_del(n);
+	n->next = LIST_POISON1;
+	n->pprev = LIST_POISON2;
+}
+
+static inline void hlist_del_init(struct hlist_node *n)
+{
+	if (!hlist_unhashed(n)) {
+		__hlist_del(n);
+		INIT_HLIST_NODE(n);
+	}
+}
+
+static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
+{
+	struct hlist_node *first = h->first;
+	n->next = first;
+	if (first)
+		first->pprev = &n->next;
+	h->first = n;
+	n->pprev = &h->first;
+}
+
+/* next must be != NULL */
+static inline void hlist_add_before(struct hlist_node *n,
+					struct hlist_node *next)
+{
+	n->pprev = next->pprev;
+	n->next = next;
+	next->pprev = &n->next;
+	*(n->pprev) = n;
+}
+
+static inline void hlist_add_after(struct hlist_node *n,
+					struct hlist_node *next)
+{
+	next->next = n->next;
+	n->next = next;
+	next->pprev = &n->next;
+
+	if(next->next)
+		next->next->pprev  = &next->next;
+}
+
+#define hlist_entry(ptr, type, member) container_of(ptr,type,member)
+
+#define hlist_for_each(pos, head) \
+	for (pos = (head)->first; pos && ({ prefetch(pos->next); 1; }); \
+	     pos = pos->next)
+
+#define hlist_for_each_safe(pos, n, head) \
+	for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
+	     pos = n)
+
+/**
+ * hlist_for_each_entry	- iterate over list of given type
+ * @tpos:	the type * to use as a loop cursor.
+ * @pos:	the &struct hlist_node to use as a loop cursor.
+ * @head:	the head for your list.
+ * @member:	the name of the hlist_node within the struct.
+ */
+#define hlist_for_each_entry(tpos, pos, head, member)			 \
+	for (pos = (head)->first;					 \
+	     pos && ({ prefetch(pos->next); 1;}) &&			 \
+		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
+	     pos = pos->next)
+
+/**
+ * hlist_for_each_entry_continue - iterate over a hlist continuing after current point
+ * @tpos:	the type * to use as a loop cursor.
+ * @pos:	the &struct hlist_node to use as a loop cursor.
+ * @member:	the name of the hlist_node within the struct.
+ */
+#define hlist_for_each_entry_continue(tpos, pos, member)		 \
+	for (pos = (pos)->next;						 \
+	     pos && ({ prefetch(pos->next); 1;}) &&			 \
+		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
+	     pos = pos->next)
+
+/**
+ * hlist_for_each_entry_from - iterate over a hlist continuing from current point
+ * @tpos:	the type * to use as a loop cursor.
+ * @pos:	the &struct hlist_node to use as a loop cursor.
+ * @member:	the name of the hlist_node within the struct.
+ */
+#define hlist_for_each_entry_from(tpos, pos, member)			 \
+	for (; pos && ({ prefetch(pos->next); 1;}) &&			 \
+		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
+	     pos = pos->next)
+
+/**
+ * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry
+ * @tpos:	the type * to use as a loop cursor.
+ * @pos:	the &struct hlist_node to use as a loop cursor.
+ * @n:		another &struct hlist_node to use as temporary storage
+ * @head:	the head for your list.
+ * @member:	the name of the hlist_node within the struct.
  */
-#define list_for_each_entry_continue(pos, head, member)			\
-	for (pos = list_entry(pos->member.next, typeof(*pos), member),	\
-		     prefetch(pos->member.next);			\
-	     &pos->member != (head);					\
-	     pos = list_entry(pos->member.next, typeof(*pos), member),	\
-		     prefetch(pos->member.next))
+#define hlist_for_each_entry_safe(tpos, pos, n, head, member) 		 \
+	for (pos = (head)->first;					 \
+	     pos && ({ n = pos->next; 1; }) && 				 \
+		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
+	     pos = n)
 
 #endif
include/linux/poison.h new file +13 -0
new file mode 100644
index 0000000..ba7ff84
@@ -0,0 +1,13 @@
+#ifndef _LINUX_POISON_H
+#define _LINUX_POISON_H
+
+/********** include/linux/list.h **********/
+/*
+ * These are non-NULL pointers that will result in page faults
+ * under normal circumstances, used to verify that nobody uses
+ * non-initialized list entries.
+ */
+#define LIST_POISON1  ((void *) 0x00100100)
+#define LIST_POISON2  ((void *) 0x00200200)
+
+#endif
Signature · 1 line
1.5.6.3
#11 lore raw

PATCH 11/12 devices: merge to list_head

---
 common/Makefile       |    1 -
 common/cmd_console.c  |    9 +-
 common/cmd_terminal.c |   10 +-
 common/console.c      |   62 ++---
 common/devices.c      |   79 +++---
 common/lists.c        |  734 -------------------------------------------------
 common/usb_kbd.c      |   14 +-
 include/devices.h     |    8 +-
 include/lists.h       |   77 -----
 9 files changed, 87 insertions(+), 907 deletions(-)
 delete mode 100644 common/lists.c
 delete mode 100644 include/lists.h
common/Makefile +0 -1
index 99781fe..102259d 100644
@@ -37,7 +37,6 @@ COBJS-y += dlmalloc.o
 COBJS-y += exports.o
 COBJS-y += hush.o
 COBJS-y += image.o
-COBJS-y += lists.o
 COBJS-y += memsize.o
 COBJS-y += s_record.o
 COBJS-y += serial.o
common/cmd_console.c +6 -3
index 50ddb01..e2bc2a3 100644
@@ -31,14 +31,17 @@
 extern void _do_coninfo (void);
 int do_coninfo (cmd_tbl_t * cmd, int flag, int argc, char *argv[])
 {
-	int i, l;
+	int l;
+	struct list_head *list = device_get_list();
+	struct list_head *pos;
+	device_t *dev;
 
 	/* Scan for valid output and input devices */
 
 	puts ("List of available devices:\n");
 
-	for (i = 1; i <= ListNumItems (devlist); i++) {
-		device_t *dev = ListGetPtrToItem (devlist, i);
+	list_for_each(pos, list) {
+		dev = list_entry(pos, device_t, list);
 
 		printf ("%-8s %08x %c%c%c ",
 			dev->name,
common/cmd_terminal.c +2 -8
index 57943c1..67a2546 100644
@@ -27,10 +27,10 @@
 #include <common.h>
 #include <command.h>
 #include <devices.h>
+#include <serial.h>
 
 int do_terminal(cmd_tbl_t * cmd, int flag, int argc, char *argv[])
 {
-	int i, l;
 	int last_tilde = 0;
 	device_t *dev = NULL;
 
@@ -38,13 +38,7 @@ int do_terminal(cmd_tbl_t * cmd, int flag, int argc, char *argv[])
 		return -1;
 
 	/* Scan for selected output/input device */
-	for (i = 1; i <= ListNumItems (devlist); i++) {
-		device_t *tmp = ListGetPtrToItem (devlist, i);
-		if (!strcmp(tmp->name, argv[1])) {
-			dev = tmp;
-			break;
-		}
-	}
+	dev = device_get_by_name(argv[1]);
 	if (!dev)
 		return -1;
 
common/console.c +25 -37

101 lines not on this page · raw message

common/devices.c +43 -36

141 lines not on this page · raw message

common/lists.c deleted +0 -734

734 lines not on this page · raw message

common/usb_kbd.c +6 -8
index 04d9730..108bd60 100644
@@ -152,7 +152,7 @@ static int usb_kbd_probe(struct usb_device *dev, unsigned int ifnum);
 /* search for keyboard and register it if found */
 int drv_usb_kbd_init(void)
 {
-	int error,i,index;
+	int error,i;
 	device_t usb_kbd_dev,*old_dev;
 	struct usb_device *dev;
 	char *stdinname  = getenv ("stdin");
@@ -166,13 +166,11 @@ int drv_usb_kbd_init(void)
 			if(usb_kbd_probe(dev,0)==1) { /* Ok, we found a keyboard */
 				/* check, if it is already registered */
 				USB_KBD_PRINTF("USB KBD found set up device.\n");
-				for (index=1; index<=ListNumItems(devlist); index++) {
-					old_dev = ListGetPtrToItem(devlist, index);
-					if(strcmp(old_dev->name,DEVNAME)==0) {
-						/* ok, already registered, just return ok */
-						USB_KBD_PRINTF("USB KBD is already registered.\n");
-						return 1;
-					}
+				old_dev = device_get_by_name(DEVNAME);
+				if(old_dev) {
+					/* ok, already registered, just return ok */
+					USB_KBD_PRINTF("USB KBD is already registered.\n");
+					return 1;
 				}
 				/* register the keyboard */
 				USB_KBD_PRINTF("USB KBD register.\n");
include/devices.h +5 -3
index 2d9e282..490016b 100644
@@ -21,7 +21,7 @@
  * MA 02111-1307 USA
  */
 
-#include <lists.h>
+#include <linux/list.h>
 
 #ifndef _DEVICES_H_
 #define _DEVICES_H_
@@ -59,6 +59,7 @@ typedef struct {
 /* Other functions */
 
 	void *priv;			/* Private extensions			*/
+	struct list_head list;
 } device_t;
 
 /*
@@ -82,7 +83,6 @@ typedef struct {
 /*
  * VARIABLES
  */
-extern list_t devlist;
 extern device_t *stdio_devices[];
 extern char *stdio_names[MAX_FILES];
 
@@ -91,8 +91,10 @@ extern char *stdio_names[MAX_FILES];
  */
 int	device_register (device_t * dev);
 int	devices_init (void);
-int	devices_done (void);
 int	device_deregister(char *devname);
+struct list_head* device_get_list(void);
+device_t* device_get_by_name(char* name);
+
 #ifdef CONFIG_LCD
 int	drv_lcd_init (void);
 #endif
include/lists.h deleted +0 -77

77 lines not on this page · raw message

Signature · 1 line
1.5.6.3
#12 lore raw

PATCH 12/12 fs: Move conditional compilation to Makefile

---
 fs/Makefile                 |   10 +++++++++-
 fs/cramfs/Makefile          |    7 ++++---
 fs/cramfs/cramfs.c          |    5 -----
 fs/cramfs/uncompress.c      |    4 ----
 fs/ext2/Makefile            |    6 +++---
 fs/ext2/dev.c               |    3 ---
 fs/ext2/ext2fs.c            |    4 ----
 fs/fat/Makefile             |    6 +++---
 fs/fat/fat.c                |    4 ----
 fs/fat/file.c               |    4 ----
 fs/fdos/Makefile            |    6 +++---
 fs/fdos/dev.c               |    5 -----
 fs/fdos/fat.c               |    4 ----
 fs/fdos/fdos.c              |    5 +----
 fs/fdos/fs.c                |    4 ----
 fs/fdos/subdir.c            |    3 ---
 fs/fdos/vfat.c              |    5 -----
 fs/jffs2/Makefile           |    8 +++++---
 fs/jffs2/compr_lzari.c      |    3 ---
 fs/jffs2/compr_lzo.c        |    4 ----
 fs/jffs2/compr_rtime.c      |    4 ----
 fs/jffs2/compr_rubin.c      |    4 ----
 fs/jffs2/compr_zlib.c       |    4 ----
 fs/jffs2/jffs2_1pass.c      |    5 -----
 fs/jffs2/jffs2_nand_1pass.c |    2 +-
 fs/jffs2/mini_inflate.c     |    5 -----
 fs/reiserfs/Makefile        |    6 +++---
 fs/reiserfs/dev.c           |    4 ----
 fs/reiserfs/mode_string.c   |    3 ---
 fs/reiserfs/reiserfs.c      |    4 ----
 30 files changed, 32 insertions(+), 109 deletions(-)
fs/Makefile +9 -1
index 95ac0e9..8bbd563 100644
@@ -22,7 +22,15 @@
 #
 #
 
-SUBDIRS	:= jffs2 cramfs fdos fat reiserfs ext2 yaffs2
+subdirs-$(CONFIG_CMD_CRAMFS) := cramfs
+subdirs-$(CONFIG_CMD_EXT2) += ext2
+subdirs-$(CONFIG_CMD_FAT) += fat
+subdirs-$(CONFIG_CMD_FDOS) += fdos
+subdirs-$(CONFIG_CMD_JFFS2) += jffs2
+subdirs-$(CONFIG_CMD_REISER) += reiserfs
+subdirs-$(CONFIG_YAFFS2) += yaffs2
+
+SUBDIRS	:= $(subdirs-y)
 
 $(obj).depend all:
 	@for dir in $(SUBDIRS) ; do \
fs/cramfs/Makefile +4 -3
index 13c043f..7b6cc0a 100644
@@ -26,10 +26,11 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)libcramfs.a
 
 AOBJS	=
-COBJS	= cramfs.o uncompress.o
+COBJS-$(CONFIG_CMD_CRAMFS) := cramfs.o
+COBJS-$(CONFIG_CMD_CRAMFS) += uncompress.o
 
-SRCS	:= $(AOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS))
+SRCS	:= $(AOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS-y))
 
 #CPPFLAGS +=
 
fs/cramfs/cramfs.c +0 -5
index e53c783..2956d39 100644
@@ -26,9 +26,6 @@
 
 #include <common.h>
 #include <malloc.h>
-
-#if defined(CONFIG_CMD_CRAMFS)
-
 #include <asm/byteorder.h>
 #include <linux/stat.h>
 #include <jffs2/jffs2.h>
@@ -343,5 +340,3 @@ int cramfs_check (struct part_info *info)
 	}
 	return 1;
 }
-
-#endif /* CFG_FS_CRAMFS */
fs/cramfs/uncompress.c +0 -4
index cf67967..39dd275 100644
@@ -25,8 +25,6 @@
 #include <watchdog.h>
 #include <zlib.h>
 
-#if defined(CONFIG_CMD_CRAMFS)
-
 static z_stream stream;
 
 void *zalloc(void *, unsigned, unsigned);
@@ -86,5 +84,3 @@ int cramfs_uncompress_exit (void)
 	inflateEnd (&stream);
 	return 0;
 }
-
-#endif /* CFG_FS_CRAMFS */
fs/ext2/Makefile +3 -3
index 8313cdc..712e348 100644
@@ -30,10 +30,10 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)libext2fs.a
 
 AOBJS	=
-COBJS	= ext2fs.o dev.o
+COBJS-$(CONFIG_CMD_EXT2) := ext2fs.o dev.o
 
-SRCS	:= $(AOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS))
+SRCS	:= $(AOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS-y))
 
 #CPPFLAGS +=
 
fs/ext2/dev.c +0 -3
index 1728b34..3b49650 100644
@@ -25,8 +25,6 @@
 
 
 #include <common.h>
-#if defined(CONFIG_CMD_EXT2)
-
 #include <config.h>
 #include <ext2fs.h>
 
@@ -139,4 +137,3 @@ int ext2fs_devread (int sector, int byte_offset, int byte_len, char *buf) {
 	}
 	return (1);
 }
-#endif
fs/ext2/ext2fs.c +0 -4
index 7833551..436f4a4 100644
@@ -24,8 +24,6 @@
  */
 
 #include <common.h>
-
-#if defined(CONFIG_CMD_EXT2)
 #include <ext2fs.h>
 #include <malloc.h>
 #include <asm/byteorder.h>
@@ -874,5 +872,3 @@ fail:
 	ext2fs_root = NULL;
 	return (0);
 }
-
-#endif
fs/fat/Makefile +3 -3
index 87af73b..b711460 100644
@@ -24,10 +24,10 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)libfat.a
 
 AOBJS	=
-COBJS	= fat.o file.o
+COBJS-$(CONFIG_CMD_FAT)	:= fat.o file.o
 
-SRCS	:= $(AOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS))
+SRCS	:= $(AOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS-y))
 
 all:	$(LIB) $(AOBJS)
 
fs/fat/fat.c +0 -4
index 49c78ed..2f0bd8c 100644
@@ -31,8 +31,6 @@
 #include <asm/byteorder.h>
 #include <part.h>
 
-#if defined(CONFIG_CMD_FAT)
-
 /*
  * Convert a string to lowercase.
  */
@@ -1024,5 +1022,3 @@ file_fat_read(const char *filename, void *buffer, unsigned long maxsize)
 	printf("reading %s\n",filename);
 	return do_fat_read(filename, buffer, maxsize, LS_NO);
 }
-
-#endif
fs/fat/file.c +0 -4
index 514dbae..e870734 100644
@@ -32,8 +32,6 @@
 #include <linux/stat.h>
 #include <linux/time.h>
 
-#if defined(CONFIG_CMD_FAT)
-
 /* Supported filesystems */
 static const struct filesystem filesystems[] = {
 	{ file_fat_detectfs,  file_fat_ls,  file_fat_read,  "FAT" },
@@ -204,5 +202,3 @@ file_read(const char *filename, void *buffer, unsigned long maxsize)
 
 	return filesystems[current_filesystem].read(arg, buffer, maxsize);
 }
-
-#endif
fs/fdos/Makefile +3 -3
index 2dba0fb..fce2032 100644
@@ -31,10 +31,10 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)libfdos.a
 
 AOBJS	=
-COBJS	= fat.o vfat.o dev.o fdos.o fs.o subdir.o
+COBJS-$(CONFIG_CMD_FDOS) := fat.o vfat.o dev.o fdos.o fs.o subdir.o
 
-SRCS	:= $(AOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS))
+SRCS	:= $(AOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS-y))
 
 #CPPFLAGS +=
 
fs/fdos/dev.c +0 -5
index 271d0e7..b55b6ed 100644
@@ -28,8 +28,6 @@
 #include "dos.h"
 #include "fdos.h"
 
-#if defined(CONFIG_CMD_FDOS)
-
 #define NB_HEADS        2
 #define NB_TRACKS       80
 #define NB_SECTORS      18
@@ -190,6 +188,3 @@ int check_dev (BootSector_t *boot, Fs_t *fs)
 
     return (0);
 }
-
-
-#endif
fs/fdos/fat.c +0 -4
index 2e2d2b8..5707c19 100644
@@ -26,8 +26,6 @@
 #include <config.h>
 #include <malloc.h>
 
-#if defined(CONFIG_CMD_FDOS)
-
 #include "dos.h"
 #include "fdos.h"
 
@@ -138,5 +136,3 @@ int read_fat (BootSector_t *boot, Fs_t *fs)
     }
     return (0);
 }
-
-#endif
fs/fdos/fdos.c +1 -4
index 5be6a96..db58562 100644
@@ -24,9 +24,8 @@
 
 #include <common.h>
 #include <config.h>
-
-#if defined(CONFIG_CMD_FDOS)
 #include <malloc.h>
+
 #include "dos.h"
 #include "fdos.h"
 
@@ -171,5 +170,3 @@ int dos_dir (void)
     free (name);
     return (0);
 }
-
-#endif
fs/fdos/fs.c +0 -4
index aded670..5acf123 100644
@@ -26,8 +26,6 @@
 #include <config.h>
 #include <malloc.h>
 
-#if defined(CONFIG_CMD_FDOS)
-
 #include "dos.h"
 #include "fdos.h"
 
@@ -114,5 +112,3 @@ int fs_init (Fs_t *fs)
     free (boot);
     return (0);
 }
-
-#endif
fs/fdos/subdir.c +0 -3
index 497f554..5e96b0a 100644
@@ -26,8 +26,6 @@
 #include <config.h>
 #include <malloc.h>
 
-#if defined(CONFIG_CMD_FDOS)
-
 #include "dos.h"
 #include "fdos.h"
 
@@ -345,4 +343,3 @@ int read_file (Fs_t *fs,
     }
     return (read);
 }
-#endif
fs/fdos/vfat.c +0 -5
index 0e7883b..9f357a6 100644
@@ -24,8 +24,6 @@
 
 #include <common.h>
 #include <config.h>
-
-#if defined(CONFIG_CMD_FDOS)
 #include <linux/ctype.h>
 
 #include "dos.h"
@@ -352,6 +350,3 @@ static char *conv_name (char *name, char *ext, char Case, char *ans)
     }
     return (ans);
 }
-
-
-#endif
fs/jffs2/Makefile +5 -3
index a071af1..fd6a105 100644
@@ -26,13 +26,15 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)libjffs2.a
 
 AOBJS	=
-COBJS-y += jffs2_1pass.o
+ifdef CONFIG_CMD_JFFS2
+COBJS-$(CONFIG_JFFS2_LZO_LZARI) += compr_lzari.o
+COBJS-$(CONFIG_JFFS2_LZO_LZARI) += compr_lzo.o
 COBJS-y += compr_rtime.o
 COBJS-y += compr_rubin.o
 COBJS-y += compr_zlib.o
+COBJS-y += jffs2_1pass.o
 COBJS-y += mini_inflate.o
-COBJS-y += compr_lzo.o
-COBJS-y += compr_lzari.o
+endif
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(AOBJS:.o=.S) $(COBJS:.o=.c)
fs/jffs2/compr_lzari.c +0 -3
index f64bc74..6a29608 100644
@@ -50,8 +50,6 @@ All rights reserved. Permission granted for non-commercial use.
 
 
 #include <config.h>
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_LZO_LZARI)
-
 #include <linux/stddef.h>
 #include <jffs2/jffs2.h>
 
@@ -259,4 +257,3 @@ int lzari_decompress(unsigned char *data_in, unsigned char *cpage_out,
 {
     return Decode(data_in, cpage_out, srclen, destlen);
 }
-#endif
fs/jffs2/compr_lzo.c +0 -4
index a32b993..e648ec4 100644
@@ -67,8 +67,6 @@
 
 
 #include <config.h>
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_LZO_LZARI)
-
 #include <linux/stddef.h>
 #include <jffs2/jffs2.h>
 #include <jffs2/compr_rubin.h>
@@ -401,5 +399,3 @@ int lzo_decompress(unsigned char *data_in, unsigned char *cpage_out,
 	lzo_uint outlen = destlen;
 	return lzo1x_decompress (data_in, srclen, cpage_out, &outlen, NULL);
 }
-
-#endif
fs/jffs2/compr_rtime.c +0 -4
index 144263c..89b9f2f 100644
@@ -46,8 +46,6 @@
  */
 
 #include <config.h>
-#if defined(CONFIG_CMD_JFFS2)
-
 #include <jffs2/jffs2.h>
 
 void rtime_decompress(unsigned char *data_in, unsigned char *cpage_out,
@@ -87,5 +85,3 @@ void rtime_decompress(unsigned char *data_in, unsigned char *cpage_out,
 		}
 	}
 }
-
-#endif
fs/jffs2/compr_rubin.c +0 -4
index f6f3fa1..9ff2217 100644
@@ -39,8 +39,6 @@
  */
 
 #include <config.h>
-#if defined(CONFIG_CMD_JFFS2)
-
 #include <jffs2/jffs2.h>
 #include <jffs2/compr_rubin.h>
 
@@ -122,5 +120,3 @@ void dynrubin_decompress(unsigned char *data_in, unsigned char *cpage_out,
 
 	rubin_do_decompress(bits, data_in+8, cpage_out, dstlen);
 }
-
-#endif
fs/jffs2/compr_zlib.c +0 -4
index 29dfe1b..d306b6d 100644
@@ -37,8 +37,6 @@
 
 #include <common.h>
 #include <config.h>
-#if defined(CONFIG_CMD_JFFS2)
-
 #include <jffs2/jffs2.h>
 #include <jffs2/mini_inflate.h>
 
@@ -48,5 +46,3 @@ long zlib_decompress(unsigned char *data_in, unsigned char *cpage_out,
     return (decompress_block(cpage_out, data_in + 2, (void *) ldr_memcpy));
 
 }
-
-#endif
fs/jffs2/jffs2_1pass.c +0 -5
index b5e7ab8..5d22dd7 100644
@@ -117,9 +117,6 @@
 #include <linux/stat.h>
 #include <linux/time.h>
 #include <watchdog.h>
-
-#if defined(CONFIG_CMD_JFFS2)
-
 #include <jffs2/jffs2.h>
 #include <jffs2/jffs2_1pass.h>
 
@@ -1394,5 +1391,3 @@ jffs2_1pass_info(struct part_info * part)
 	}
 	return 1;
 }
-
-#endif
fs/jffs2/jffs2_nand_1pass.c +1 -1
index 9f6de7d..e288d5a 100644
@@ -1,6 +1,6 @@
 #include <common.h>
 
-#if !defined(CONFIG_NAND_LEGACY) && defined(CONFIG_CMD_JFFS2)
+#if !defined(CONFIG_NAND_LEGACY)
 
 #include <malloc.h>
 #include <linux/stat.h>
fs/jffs2/mini_inflate.c +0 -5
index 4c50fc3..bd40a57 100644
@@ -24,9 +24,6 @@
  */
 
 #include <config.h>
-
-#if defined(CONFIG_CMD_JFFS2)
-
 #include <jffs2/mini_inflate.h>
 
 /* The order that the code lengths in section 3.2.7 are in */
@@ -392,5 +389,3 @@ long decompress_block(unsigned char *dest, unsigned char *source,
 #endif
 	return stream.error ? -stream.error : stream.decoded;
 }
-
-#endif
fs/reiserfs/Makefile +3 -3
index e8711a4..9cef8ee 100644
@@ -30,10 +30,10 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)libreiserfs.a
 
 AOBJS	=
-COBJS	= reiserfs.o dev.o mode_string.o
+COBJS-$(CONFIG_CMD_REISER) := reiserfs.o dev.o mode_string.o
 
-SRCS	:= $(AOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS))
+SRCS	:= $(AOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS-y))
 
 #CPPFLAGS +=
 
fs/reiserfs/dev.c +0 -4
index 46dc414..1facfaf 100644
@@ -19,8 +19,6 @@
 
 
 #include <common.h>
-#if defined(CONFIG_CMD_REISER)
-
 #include <config.h>
 #include <reiserfs.h>
 
@@ -119,5 +117,3 @@ int reiserfs_devread (int sector, int byte_offset, int byte_len, char *buf)
 
 	return 1;
 }
-
-#endif
fs/reiserfs/mode_string.c +0 -3
index 3e57ee4..801263d 100644
@@ -25,7 +25,6 @@
 
 
 #include <common.h>
-#if defined(CONFIG_CMD_REISER)
 #include <linux/stat.h>
 
 #if ( S_ISUID != 04000 ) || ( S_ISGID != 02000 ) || ( S_ISVTX != 01000 ) \
@@ -137,5 +136,3 @@ const char *bb_mode_string(int mode)
 }
 
 #endif
-
-#endif
fs/reiserfs/reiserfs.c +0 -4
index aa96361..d84fb20 100644
@@ -29,8 +29,6 @@
  */
 
 #include <common.h>
-#if defined(CONFIG_CMD_REISER)
-
 #include <malloc.h>
 #include <linux/ctype.h>
 #include <linux/time.h>
@@ -982,5 +980,3 @@ reiserfs_open (char *filename)
 	}
 	return filemax;
 }
-
-#endif
Signature · 1 line
1.5.6.3
#13 lore raw

PATCH 10/12 update linux/list

In reply to Jean-Christophe PLAGNIOL-VILLARD

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 4 lines · In message <[email protected]> you wrote:
---
 include/linux/list.h   |  506 +++++++++++++++++++++++++++++++++++++++++++-----
 include/linux/poison.h |   13 ++

Do we really need this?

Quoted 7 lines
include/linux/poison.h new file +1 -0
new file mode 100644
index 0000000..ba7ff84
@@ -0,0 +1,13 @@
+#ifndef _LINUX_POISON_H

include/linux/poison.h line 11

Quoted 10 lines
include/linux/poison.h new file +10 -0
+#define _LINUX_POISON_H
+
+/********** include/linux/list.h **********/
+/*
+ * These are non-NULL pointers that will result in page faults
+ * under normal circumstances, used to verify that nobody uses
+ * non-initialized list entries.
+ */
+#define LIST_POISON1  ((void *) 0x00100100)
+#define LIST_POISON2  ((void *) 0x00200200)

I think this will not work at all in U-Boot, so we can leave it out as well.

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
There's a way out of any cage.
	-- Captain Christopher Pike, "The Menagerie" ("The Cage"),
	   stardate unknown.
#14 lore raw

PATCH 6/12 autoscript: Move conditional compilation to Makefile

In reply to Jean-Christophe PLAGNIOL-VILLARD

Hi Jean-Chritophe,

Quoted 13 lines · Jean-Christophe PLAGNIOL-VILLARD
---
 common/Makefile                           |    3 +-
 common/{cmd_autoscript.c => autoscript.c} |   44 --------
 common/cmd_autoscript.c                   |  158 -----------------------------
 3 files changed, 2 insertions(+), 203 deletions(-)
 copy common/{cmd_autoscript.c => autoscript.c} (79%)
common/Makefile +0 -0
index 0c8ef5b..92d7a9e 100644

common/Makefile COBJS-y += main.o · line 34

Quoted 5 lines
common/Makefile +1 -1
@@ -31,7 +31,8 @@ COBJS-y += main.o
 COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o
 COBJS-y += circbuf.o
 COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o
-COBJS-y += cmd_autoscript.o
+COBJS-$(CONFIG_AUTOSCRIPT)$(CONFIG_CMD_AUTOSCRIPT) += autoscript.o

Will we run into problems when both CONFIG_AUTOSCRIPT and CONFIG_CMD_AUTOSCRIPT are defined? Adding the following should account for that situation:

COBJS-y += $(COBJS-yy)

common/Makefile COBJS-y += main.o · line 38

Quoted 4 lines
common/Makefile +1 -0
+COBJS-$(CONFIG_CMD_AUTOSCRIPT) += cmd_autoscript.o
 COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
 COBJS-$(CONFIG_CMD_BEDBUG) += cmd_bedbug.o
 COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o

Best,
Peter

#15 lore raw

PATCH 6/12 autoscript: Move conditional compilation to Makefile

Hi Jean-Christophe,
(Sorry for misspelling your name in the last email;)

Quoted 27 lines · Peter Tyser

Hi Jean-Chritophe,

Quoted 13 lines · Jean-Christophe PLAGNIOL-VILLARD
---
 common/Makefile                           |    3 +-
 common/{cmd_autoscript.c => autoscript.c} |   44 --------
 common/cmd_autoscript.c                   |  158 -----------------------------
 3 files changed, 2 insertions(+), 203 deletions(-)
 copy common/{cmd_autoscript.c => autoscript.c} (79%)
common/Makefile +0 -0
index 0c8ef5b..92d7a9e 100644

common/Makefile COBJS-y += main.o · line 34

Quoted 5 lines
common/Makefile +1 -1
@@ -31,7 +31,8 @@ COBJS-y += main.o
 COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o
 COBJS-y += circbuf.o
 COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o
-COBJS-y += cmd_autoscript.o
+COBJS-$(CONFIG_AUTOSCRIPT)$(CONFIG_CMD_AUTOSCRIPT) += autoscript.o

Will we run into problems when both CONFIG_AUTOSCRIPT and CONFIG_CMD_AUTOSCRIPT are defined? Adding the following should account for that situation:

Quoted 7 lines

COBJS-y += $(COBJS-yy)

Quoted 4 lines
common/Makefile +1 -0
+COBJS-$(CONFIG_CMD_AUTOSCRIPT) += cmd_autoscript.o
 COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
 COBJS-$(CONFIG_CMD_BEDBUG) += cmd_bedbug.o
 COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o

Forget that last comment - it looks like you made the fix later in the patch series ([PATCH 08/12] common/Makefile: order by functionality). It might be good to move the addition of "COBJS-y += $(COBJS-yy)" to [PATCH 06/12] so that compiles don't break between those 2 commits when bisecting in the future.

Sorry for the noise.

Best,
Peter

#16 lore raw

PATCH 6/12 autoscript: Move conditional compilation to Makefile

Quoted 6 lines

Forget that last comment - it looks like you made the fix later in the patch series ([PATCH 08/12] common/Makefile: order by functionality). It might be good to move the addition of "COBJS-y += $(COBJS-yy)" to [PATCH 06/12] so that compiles don't break between those 2 commits when bisecting in the future.

Moved

Best Regards,
J.

#17 lore raw

PATCH v2 6/12 autoscript: Move conditional compilation to Makefile

---
 common/Makefile                           |    4 +-
 common/{cmd_autoscript.c => autoscript.c} |   44 --------
 common/cmd_autoscript.c                   |  158 -----------------------------
 3 files changed, 3 insertions(+), 203 deletions(-)
common/Makefile +3 -1
index 0c8ef5b..56cc764 100644
@@ -31,7 +31,8 @@ COBJS-y += main.o
 COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o
 COBJS-y += circbuf.o
 COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o
-COBJS-y += cmd_autoscript.o
+COBJS-$(CONFIG_AUTOSCRIPT)$(CONFIG_CMD_AUTOSCRIPT) += autoscript.o
+COBJS-$(CONFIG_CMD_AUTOSCRIPT) += cmd_autoscript.o
 COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
 COBJS-$(CONFIG_CMD_BEDBUG) += cmd_bedbug.o
 COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o
@@ -148,6 +149,7 @@ COBJS-$(CONFIG_MP) += cmd_mp.o
 COBJS-$(CONFIG_CMD_SF) += cmd_sf.o
 COBJS-$(CONFIG_DDR_SPD) += ddr_spd.o
 
+COBJS-y	+= $(COBJS-yy)
 COBJS	:= $(COBJS-y)
 SRCS	:= $(AOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS))
common/autoscript.c renamed from common/cmd_autoscript.c +0 -44

53 lines not on this page · raw message

common/cmd_autoscript.c +0 -158

167 lines not on this page · raw message

Signature · 1 line
1.5.6.3
#18 lore raw

PATCH v2 8/12 common/Makefile: order by functionality

---
 common/Makefile |   70 +++++++++++++++++++++++++++++--------------------------
 1 files changed, 37 insertions(+), 33 deletions(-)
common/Makefile +37 -33
index 68aded6..99781fe 100644
@@ -27,16 +27,41 @@ LIB	= $(obj)libcommon.a
 
 AOBJS	=
 
+# core
 COBJS-y += main.o
-COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o
 COBJS-y += circbuf.o
+COBJS-y += console.o
+COBJS-y += command.o
+COBJS-y += devices.o
+COBJS-y += dlmalloc.o
+COBJS-y += exports.o
+COBJS-y += hush.o
+COBJS-y += image.o
+COBJS-y += lists.o
+COBJS-y += memsize.o
+COBJS-y += s_record.o
+COBJS-y += serial.o
+COBJS-y += xyzModem.o
+
+# environment
+COBJS-y += environment.o
+COBJS-y += env_common.o
+COBJS-y += env_dataflash.o
+COBJS-y += env_eeprom.o
+COBJS-y += env_flash.o
+COBJS-y += env_nand.o
+COBJS-y += env_nvram.o
+COBJS-y += env_onenand.o
+COBJS-y += env_sf.o
+COBJS-y += env_nowhere.o
+
+# command
 COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o
 COBJS-$(CONFIG_AUTOSCRIPT)$(CONFIG_CMD_AUTOSCRIPT) += autoscript.o
 COBJS-$(CONFIG_CMD_AUTOSCRIPT) += cmd_autoscript.o
 COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
-COBJS-$(CONFIG_CMD_BEDBUG) += cmd_bedbug.o
+COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o cmd_bedbug.o
 COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o
-COBJS-y += image.o
 COBJS-y += cmd_boot.o
 COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o
 COBJS-y += cmd_bootm.o
@@ -84,11 +109,14 @@ COBJS-$(CONFIG_CMD_JFFS2) += cmd_jffs2.o
 COBJS-$(CONFIG_CMD_LICENSE) += cmd_license.o
 COBJS-y += cmd_load.o
 COBJS-$(CONFIG_LOGBUFFER) += cmd_log.o
+COBJS-y += cmd_mac.o
 COBJS-y += cmd_mem.o
+COBJS-$(CONFIG_CMD_MFSL) += cmd_mfsl.o
 COBJS-$(CONFIG_MII)$(CONFIG_CMD_MII) += miiphyutil.o
 COBJS-$(CONFIG_CMD_MII) += cmd_mii.o
 COBJS-$(CONFIG_CMD_MISC) += cmd_misc.o
 COBJS-$(CONFIG_CMD_MMC) += cmd_mmc.o
+COBJS-$(CONFIG_MP) += cmd_mp.o
 COBJS-y += cmd_nand.o
 COBJS-$(CONFIG_CMD_NET) += cmd_net.o
 COBJS-y += cmd_nvedit.o
@@ -102,51 +130,27 @@ COBJS-$(CONFIG_CMD_PORTIO) += cmd_portio.o
 COBJS-$(CONFIG_CMD_REGINFO) += cmd_reginfo.o
 COBJS-$(CONFIG_CMD_REISER) += cmd_reiser.o
 COBJS-$(CONFIG_CMD_SATA) += cmd_sata.o
+COBJS-$(CONFIG_CMD_SF) += cmd_sf.o
 COBJS-$(CONFIG_CMD_SCSI) += cmd_scsi.o
 COBJS-$(CONFIG_CMD_SETEXPR) += cmd_setexpr.o
 COBJS-$(CONFIG_CMD_SPI) += cmd_spi.o
 COBJS-$(CONFIG_CMD_STRINGS) += cmd_strings.o
 COBJS-$(CONFIG_CMD_TERMINAL) += cmd_terminal.o
 COBJS-$(CONFIG_CMD_UNIVERSE) += cmd_universe.o
-COBJS-$(CONFIG_CMD_USB) += cmd_usb.o
+ifdef CONFIG_CMD_USB
+COBJS-y += cmd_usb.o
+COBJS-y += usb.o
+COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
+endif
 COBJS-$(CONFIG_CMD_XIMG) += cmd_ximg.o
 COBJS-$(CONFIG_YAFFS2) += cmd_yaffs2.o
 COBJS-y += cmd_vfd.o
-COBJS-y += command.o
-COBJS-y += console.o
-COBJS-y += devices.o
-COBJS-y += dlmalloc.o
 COBJS-$(CONFIG_CMD_DOC) += docecc.o
-COBJS-y += environment.o
-COBJS-y += env_common.o
-COBJS-y += env_nand.o
-COBJS-y += env_dataflash.o
-COBJS-y += env_flash.o
-COBJS-y += env_eeprom.o
-COBJS-y += env_onenand.o
-COBJS-y += env_sf.o
-COBJS-y += env_nvram.o
-COBJS-y += env_nowhere.o
-COBJS-y += exports.o
 COBJS-y += flash.o
-COBJS-y += hush.o
 COBJS-y += kgdb.o
 COBJS-$(CONFIG_LCD) += lcd.o
-COBJS-y += lists.o
 COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
-COBJS-y += memsize.o
-COBJS-y += s_record.o
-COBJS-y += serial.o
-ifdef CONFIG_CMD_USB
-COBJS-y += usb.o
-COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
-endif
 COBJS-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
-COBJS-y += xyzModem.o
-COBJS-y += cmd_mac.o
-COBJS-$(CONFIG_CMD_MFSL) += cmd_mfsl.o
-COBJS-$(CONFIG_MP) += cmd_mp.o
-COBJS-$(CONFIG_CMD_SF) += cmd_sf.o
 COBJS-$(CONFIG_DDR_SPD) += ddr_spd.o
 
 COBJS-y	+= $(COBJS-yy)
Signature · 1 line
1.5.6.3
#19 lore raw

PATCH v2 6/12 autoscript: Move conditional compilation to Makefile

In reply to Jean-Christophe PLAGNIOL-VILLARD

Dear Jean-Christophe PLAGNIOL-VILLARD,

Quoted 6 lines · In message <[email protected]> you wrote:
---
 common/Makefile                           |    4 +-
 common/{cmd_autoscript.c => autoscript.c} |   44 --------
 common/cmd_autoscript.c                   |  158 -----------------------------
 3 files changed, 3 insertions(+), 203 deletions(-)

Patch description (Mode conditional compilation to Makefile) and patch content (major code reorganisation) don't match.

What is th eintention of splitting up cmd_autoscript.c into two files? This makes no sense to me.

Also, when we reorganize this, than including the preparations to rename the command as planned.

I suggest we just do that the SUbject says, i. e. deal with the Makefile changes, and leave the rest for now.

Please clean up and resubmit.

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
      Bugs are by far the largest and  most successful class of
      entity, with nearly a million known species. In this res-
      pect they outnumber all the other  known  creatures about
      four to one.  -- Professor Snope's Encyclopedia of Animal
#20 lore raw

PATCH 4/12 miiphybb: move to drivers/net

In reply to Jean-Christophe PLAGNIOL-VILLARD

drivers/net/miiphybb.c

Quoted 37 lines · Jean-Christophe PLAGNIOL-VILLARD
---
 common/Makefile                    |    1 -
 drivers/net/Makefile               |    1 +
 {common => drivers/net}/miiphybb.c |    0 
 3 files changed, 1 insertions(+), 1 deletions(-)
 rename {common => drivers/net}/miiphybb.c (100%)
common/Makefile +0 -1
index 3e4829f..ff2e6c6 100644
@@ -133,7 +133,6 @@ COBJS-$(CONFIG_LCD) += lcd.o
 COBJS-y += lists.o
 COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
 COBJS-y += memsize.o
-COBJS-$(CONFIG_BITBANGMII) += miiphybb.o
 COBJS-y += miiphyutil.o
 COBJS-y += s_record.o
 COBJS-y += serial.o
drivers/net/Makefile +1 -0
index bcf31cb..0e86b72 100644
@@ -41,6 +41,7 @@ COBJS-$(CONFIG_DRIVER_KS8695ETH) += ks8695eth.o
 COBJS-$(CONFIG_DRIVER_LAN91C96) += lan91c96.o
 COBJS-$(CONFIG_MACB) += macb.o
 COBJS-$(CONFIG_MCFFEC) += mcffec.o
+COBJS-$(CONFIG_BITBANGMII) += miiphybb.o
 COBJS-$(CONFIG_NATSEMI) += natsemi.o
 ifeq ($(CONFIG_DRIVER_NE2000),y)
 COBJS-y += ne2000.o
drivers/net/miiphybb.c renamed from common/miiphybb.c +0 -0
similarity index 100%
rename from common/miiphybb.c
rename to drivers/net/miiphybb.c

I'd prefer for the PHY CONFIGs to be a separate list from the controller list.

regards,
Ben

#21 lore raw

PATCH v2 4/12 miiphybb: move to drivers/net/phy

---
 Makefile                               |    1 +
 common/Makefile                        |    1 -
 drivers/net/phy/Makefile               |   46 ++++++++++++++++++++++++++++++++
 {common => drivers/net/phy}/miiphybb.c |    0 
 4 files changed, 47 insertions(+), 1 deletions(-)
Makefile +1 -0
index 89fea72..9129300 100644
@@ -227,6 +227,7 @@ LIBS += drivers/mtd/nand_legacy/libnand_legacy.a
 LIBS += drivers/mtd/onenand/libonenand.a
 LIBS += drivers/mtd/spi/libspi_flash.a
 LIBS += drivers/net/libnet.a
+LIBS += drivers/net/phy/libphy.a
 LIBS += drivers/net/sk98lin/libsk98lin.a
 LIBS += drivers/pci/libpci.a
 LIBS += drivers/pcmcia/libpcmcia.a
common/Makefile +0 -1
index 3e4829f..ff2e6c6 100644
@@ -133,7 +133,6 @@ COBJS-$(CONFIG_LCD) += lcd.o
 COBJS-y += lists.o
 COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
 COBJS-y += memsize.o
-COBJS-$(CONFIG_BITBANGMII) += miiphybb.o
 COBJS-y += miiphyutil.o
 COBJS-y += s_record.o
 COBJS-y += serial.o
drivers/net/phy/Makefile new file +46 -0

46 lines not on this page · raw message

drivers/net/phy/miiphybb.c renamed from common/miiphybb.c +0 -0
similarity index 100%
rename from common/miiphybb.c
rename to drivers/net/phy/miiphybb.c
Signature · 1 line
1.5.6.3
#22 lore raw

PATCH v2 4/12 miiphybb: move to drivers/net/phy

Quoted 2 lines · Jean-Christophe PLAGNIOL-VILLARD
Quoted 88 lines
---
 Makefile                               |    1 +
 common/Makefile                        |    1 -
 drivers/net/phy/Makefile               |   46 ++++++++++++++++++++++++++++++++
 {common => drivers/net/phy}/miiphybb.c |    0 
 4 files changed, 47 insertions(+), 1 deletions(-)
Makefile +1 -0
index 89fea72..9129300 100644
@@ -227,6 +227,7 @@ LIBS += drivers/mtd/nand_legacy/libnand_legacy.a
 LIBS += drivers/mtd/onenand/libonenand.a
 LIBS += drivers/mtd/spi/libspi_flash.a
 LIBS += drivers/net/libnet.a
+LIBS += drivers/net/phy/libphy.a
 LIBS += drivers/net/sk98lin/libsk98lin.a
 LIBS += drivers/pci/libpci.a
 LIBS += drivers/pcmcia/libpcmcia.a
common/Makefile +0 -1
index 3e4829f..ff2e6c6 100644
@@ -133,7 +133,6 @@ COBJS-$(CONFIG_LCD) += lcd.o
 COBJS-y += lists.o
 COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
 COBJS-y += memsize.o
-COBJS-$(CONFIG_BITBANGMII) += miiphybb.o
 COBJS-y += miiphyutil.o
 COBJS-y += s_record.o
 COBJS-y += serial.o
drivers/net/phy/Makefile new file +46 -0
new file mode 100644
index 0000000..10dc082
@@ -0,0 +1,46 @@
+#
+# (C) Copyright 2006
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# 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
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	:= $(obj)libphy.a
+
+COBJS-$(CONFIG_BITBANGMII) += miiphybb.o
+
+COBJS	:= $(COBJS-y)
+SRCS	:= $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+
+all:	$(LIB)
+
+$(LIB):	$(obj).depend $(OBJS)
+	$(AR) $(ARFLAGS) $@ $(OBJS)
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
drivers/net/phy/miiphybb.c renamed from common/miiphybb.c +0 -0
similarity index 100%
rename from common/miiphybb.c
rename to drivers/net/phy/miiphybb.c
#23 lore raw
In reply to Jean-Christophe PLAGNIOL-VILLARD
Quoted 9 lines · Jean-Christophe PLAGNIOL-VILLARD

Hi,

1)The following patchset will continue the move of conditional compile to Makefile and do some file location move

2) It will merge the current list implementation for common/device & co to linux list.h in order to reduce u-boot size. During test It did show the the patch will reduce u-boot size by 1KB min.

It's available on
git://git.denx.de/u-boot-arm.git branch Makefile

Best Regards,
J.

#24 lore raw

[U-Boot] Makefile Pull Request

In reply to Jean-Christophe PLAGNIOL-VILLARD

Hi Wolfgang
Please pull
The following changes since commit 33aa4eac66b71c797bbc13b3afe432a2132947d4:
Wolfgang Denk (1):
Merge branch 'master' of /home/wd/git/u-boot/custodians

are available in the git repository at:

git://git.denx.de/u-boot-arm.git Makefile

Jean-Christophe PLAGNIOL-VILLARD (12):
gunzip: move to lib_generic
soft_i2c: move to drivers/i2c
soft_spi: move to drivers/spi
miiphybb: move to drivers/net/phy
crc16: move to lib_generic
autoscript: Move conditional compilation to Makefile
miiphyutil: Move conditional compilation to Makefile common/Makefile: order by functionality
cmd_terminal: remove no need ifdef
update linux/list
devices: merge to list_head
fs: Move conditional compilation to Makefile

 Makefile                               |    1 +
 common/Makefile                        |   80 ++--
 common/autoscript.c                    |  199 +++++++++
 common/cmd_autoscript.c                |  158 -------
 common/cmd_console.c                   |    9 +-
 common/cmd_terminal.c                  |   14 +-
 common/console.c                       |   62 ++--
 common/devices.c                       |   79 ++--
 common/lists.c                         |  734 --------------------------------
 common/miiphyutil.c                    |    2 -
 common/usb_kbd.c                       |   14 +-
 drivers/i2c/Makefile                   |    1 +
 {common => drivers/i2c}/soft_i2c.c     |    0 
 drivers/net/phy/Makefile               |   46 ++
 {common => drivers/net/phy}/miiphybb.c |    0 
 drivers/spi/Makefile                   |    3 +-
 {common => drivers/spi}/soft_spi.c     |    0 
 fs/Makefile                            |   10 +-
 fs/cramfs/Makefile                     |    7 +-
 fs/cramfs/cramfs.c                     |    5 -
 fs/cramfs/uncompress.c                 |    4 -
 fs/ext2/Makefile                       |    6 +-
 fs/ext2/dev.c                          |    3 -
 fs/ext2/ext2fs.c                       |    4 -
 fs/fat/Makefile                        |    6 +-
 fs/fat/fat.c                           |    4 -
 fs/fat/file.c                          |    4 -
 fs/fdos/Makefile                       |    6 +-
 fs/fdos/dev.c                          |    5 -
 fs/fdos/fat.c                          |    4 -
 fs/fdos/fdos.c                         |    5 +-
 fs/fdos/fs.c                           |    4 -
 fs/fdos/subdir.c                       |    3 -
 fs/fdos/vfat.c                         |    5 -
 fs/jffs2/Makefile                      |    8 +-
 fs/jffs2/compr_lzari.c                 |    3 -
 fs/jffs2/compr_lzo.c                   |    4 -
 fs/jffs2/compr_rtime.c                 |    4 -
 fs/jffs2/compr_rubin.c                 |    4 -
 fs/jffs2/compr_zlib.c                  |    4 -
 fs/jffs2/jffs2_1pass.c                 |    5 -
 fs/jffs2/jffs2_nand_1pass.c            |    2 +-
 fs/jffs2/mini_inflate.c                |    5 -
 fs/reiserfs/Makefile                   |    6 +-
 fs/reiserfs/dev.c                      |    4 -
 fs/reiserfs/mode_string.c              |    3 -
 fs/reiserfs/reiserfs.c                 |    4 -
 include/devices.h                      |    8 +-
 include/linux/list.h                   |  506 ++++++++++++++++++++--
 include/linux/poison.h                 |   13 +
 include/lists.h                        |   77 ----
 lib_generic/Makefile                   |    2 +
 {common => lib_generic}/crc16.c        |    0 
 {common => lib_generic}/gunzip.c       |    0 
 54 files changed, 884 insertions(+), 1265 deletions(-)
 create mode 100644 common/autoscript.c
 delete mode 100644 common/lists.c
 rename {common => drivers/i2c}/soft_i2c.c (100%)
 create mode 100644 drivers/net/phy/Makefile
 rename {common => drivers/net/phy}/miiphybb.c (100%)
 rename {common => drivers/spi}/soft_spi.c (100%)
 create mode 100644 include/linux/poison.h
 delete mode 100644 include/lists.h
 rename {common => lib_generic}/crc16.c (100%)
 rename {common => lib_generic}/gunzip.c (100%)

Best Regards,
J.

#25 lore raw

[U-Boot] Makefile Pull Request

Dear Jean-Christophe PLAGNIOL-VILLARD,

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

Hi Wolfgang
Please pull
The following changes since commit 33aa4eac66b71c797bbc13b3afe432a2132947d4:
Wolfgang Denk (1):
Merge branch 'master' of /home/wd/git/u-boot/custodians

are available in the git repository at:

Please cleanup as requested first, then rebase your tree.

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
Mandrell: "You know what I think?"
Doctor:   "Ah, ah that's a catch question. With a brain your size you
          don't think, right?"
                - Dr. Who
#26 lore raw

[U-Boot] Makefile Pull Request

Quoted 9 lines · Wolfgang Denk

Dear Jean-Christophe PLAGNIOL-VILLARD,

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

Hi Wolfgang
Please pull
The following changes since commit 33aa4eac66b71c797bbc13b3afe432a2132947d4:
Wolfgang Denk (1):
Merge branch 'master' of /home/wd/git/u-boot/custodians

Quoted 5 lines
Quoted 1 line

are available in the git repository at:

Please cleanup as requested first, then rebase your tree.

Thanks.

done as your comment in V3 reply to this mail

add please pull

The following changes since commit 33aa4eac66b71c797bbc13b3afe432a2132947d4:
Wolfgang Denk (1):
Merge branch 'master' of /home/wd/git/u-boot/custodians

are available in the git repository at:

git://git.denx.de/u-boot-arm.git Makefile

Jean-Christophe PLAGNIOL-VILLARD (12):
gunzip: move to lib_generic
soft_i2c: move to drivers/i2c
soft_spi: move to drivers/spi
miiphybb: move to drivers/net/phy
crc16: move to lib_generic
autoscript: Move conditional compilation to Makefile
miiphyutil: Move conditional compilation to Makefile common/Makefile: order by functionality
cmd_terminal: remove no need ifdef
update linux/list
devices: merge to list_head
fs: Move conditional compilation to Makefile

 Makefile                               |    1 +
 common/Makefile                        |   79 ++--
 common/cmd_autoscript.c                |    4 -
 common/cmd_console.c                   |    9 +-
 common/cmd_terminal.c                  |   14 +-
 common/console.c                       |   62 ++--
 common/devices.c                       |   79 ++--
 common/lists.c                         |  734 --------------------------------
 common/miiphyutil.c                    |    2 -
 common/usb_kbd.c                       |   14 +-
 drivers/i2c/Makefile                   |    1 +
 {common => drivers/i2c}/soft_i2c.c     |    0 
 drivers/net/phy/Makefile               |   46 ++
 {common => drivers/net/phy}/miiphybb.c |    0 
 drivers/spi/Makefile                   |    3 +-
 {common => drivers/spi}/soft_spi.c     |    0 
 fs/Makefile                            |   10 +-
 fs/cramfs/Makefile                     |    7 +-
 fs/cramfs/cramfs.c                     |    5 -
 fs/cramfs/uncompress.c                 |    4 -
 fs/ext2/Makefile                       |    6 +-
 fs/ext2/dev.c                          |    3 -
 fs/ext2/ext2fs.c                       |    4 -
 fs/fat/Makefile                        |    6 +-
 fs/fat/fat.c                           |    4 -
 fs/fat/file.c                          |    4 -
 fs/fdos/Makefile                       |    6 +-
 fs/fdos/dev.c                          |    5 -
 fs/fdos/fat.c                          |    4 -
 fs/fdos/fdos.c                         |    5 +-
 fs/fdos/fs.c                           |    4 -
 fs/fdos/subdir.c                       |    3 -
 fs/fdos/vfat.c                         |    5 -
 fs/jffs2/Makefile                      |    8 +-
 fs/jffs2/compr_lzari.c                 |    3 -
 fs/jffs2/compr_lzo.c                   |    4 -
 fs/jffs2/compr_rtime.c                 |    4 -
 fs/jffs2/compr_rubin.c                 |    4 -
 fs/jffs2/compr_zlib.c                  |    4 -
 fs/jffs2/jffs2_1pass.c                 |    5 -
 fs/jffs2/jffs2_nand_1pass.c            |    2 +-
 fs/jffs2/mini_inflate.c                |    5 -
 fs/reiserfs/Makefile                   |    6 +-
 fs/reiserfs/dev.c                      |    4 -
 fs/reiserfs/mode_string.c              |    3 -
 fs/reiserfs/reiserfs.c                 |    4 -
 include/devices.h                      |    8 +-
 include/linux/list.h                   |  506 ++++++++++++++++++++--
 include/linux/poison.h                 |   11 +
 include/lists.h                        |   77 ----
 lib_generic/Makefile                   |    2 +
 {common => lib_generic}/crc16.c        |    0 
 {common => lib_generic}/gunzip.c       |    0 
 53 files changed, 682 insertions(+), 1111 deletions(-)
 delete mode 100644 common/lists.c
 rename {common => drivers/i2c}/soft_i2c.c (100%)
 create mode 100644 drivers/net/phy/Makefile
 rename {common => drivers/net/phy}/miiphybb.c (100%)
 rename {common => drivers/spi}/soft_spi.c (100%)
 create mode 100644 include/linux/poison.h
 delete mode 100644 include/lists.h
 rename {common => lib_generic}/crc16.c (100%)
 rename {common => lib_generic}/gunzip.c (100%)

Best Regards,
J.

#27 lore raw

PATCH v3 1/12 gunzip: move to lib_generic

---
 common/Makefile                  |    1 -
 lib_generic/Makefile             |    1 +
 {common => lib_generic}/gunzip.c |    0 
 3 files changed, 1 insertions(+), 1 deletions(-)
common/Makefile +0 -1
index 944b1c0..d974823 100644
@@ -36,7 +36,6 @@ COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
 COBJS-$(CONFIG_CMD_BEDBUG) += cmd_bedbug.o
 COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o
 COBJS-y += image.o
-COBJS-y += gunzip.o
 COBJS-y += cmd_boot.o
 COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o
 COBJS-y += cmd_bootm.o
lib_generic/Makefile +1 -0
index bf0e31d..a820f97 100644
@@ -34,6 +34,7 @@ COBJS-y += crc32.o
 COBJS-y += ctype.o
 COBJS-y += display_options.o
 COBJS-y += div64.o
+COBJS-y += gunzip.o
 COBJS-y += lmb.o
 COBJS-y += ldiv.o
 COBJS-$(CONFIG_MD5) += md5.o
lib_generic/gunzip.c renamed from common/gunzip.c +0 -0
similarity index 100%
rename from common/gunzip.c
rename to lib_generic/gunzip.c
Signature · 1 line
1.5.6.3
#28 lore raw

PATCH v3 2/12 soft_i2c: move to drivers/i2c

---
 common/Makefile                    |    1 -
 drivers/i2c/Makefile               |    1 +
 {common => drivers/i2c}/soft_i2c.c |    0 
 3 files changed, 1 insertions(+), 1 deletions(-)
common/Makefile +0 -1
index d974823..faeac86 100644
@@ -137,7 +137,6 @@ COBJS-$(CONFIG_BITBANGMII) += miiphybb.o
 COBJS-y += miiphyutil.o
 COBJS-y += s_record.o
 COBJS-y += serial.o
-COBJS-$(CONFIG_SOFT_I2C) += soft_i2c.o
 COBJS-$(CONFIG_SOFT_SPI) += soft_spi.o
 ifdef CONFIG_CMD_USB
 COBJS-y += usb.o
drivers/i2c/Makefile +1 -0
index 1f25afb..6079c05 100644
@@ -29,6 +29,7 @@ COBJS-$(CONFIG_FSL_I2C) += fsl_i2c.o
 COBJS-$(CONFIG_I2C_MXC) += mxc_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP1510_I2C) += omap1510_i2c.o
 COBJS-$(CONFIG_DRIVER_OMAP24XX_I2C) += omap24xx_i2c.o
+COBJS-$(CONFIG_SOFT_I2C) += soft_i2c.o
 COBJS-$(CONFIG_TSI108_I2C) += tsi108_i2c.o
 
 COBJS	:= $(COBJS-y)
drivers/i2c/soft_i2c.c renamed from common/soft_i2c.c +0 -0
similarity index 100%
rename from common/soft_i2c.c
rename to drivers/i2c/soft_i2c.c
Signature · 1 line
1.5.6.3
#29 lore raw

PATCH v3 3/12 soft_spi: move to drivers/spi

---
 common/Makefile                    |    1 -
 drivers/spi/Makefile               |    3 ++-
 {common => drivers/spi}/soft_spi.c |    0 
 3 files changed, 2 insertions(+), 2 deletions(-)
common/Makefile +0 -1
index faeac86..3e4829f 100644
@@ -137,7 +137,6 @@ COBJS-$(CONFIG_BITBANGMII) += miiphybb.o
 COBJS-y += miiphyutil.o
 COBJS-y += s_record.o
 COBJS-y += serial.o
-COBJS-$(CONFIG_SOFT_SPI) += soft_spi.o
 ifdef CONFIG_CMD_USB
 COBJS-y += usb.o
 COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
drivers/spi/Makefile +2 -1
index 4f7b679..15e0f7a 100644
@@ -25,9 +25,10 @@ include $(TOPDIR)/config.mk
 
 LIB	:= $(obj)libspi.a
 
-COBJS-$(CONFIG_MPC8XXX_SPI) += mpc8xxx_spi.o
 COBJS-$(CONFIG_ATMEL_SPI) += atmel_spi.o
+COBJS-$(CONFIG_MPC8XXX_SPI) += mpc8xxx_spi.o
 COBJS-$(CONFIG_MXC_SPI) += mxc_spi.o
+COBJS-$(CONFIG_SOFT_SPI) += soft_spi.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
drivers/spi/soft_spi.c renamed from common/soft_spi.c +0 -0
similarity index 100%
rename from common/soft_spi.c
rename to drivers/spi/soft_spi.c
Signature · 1 line
1.5.6.3
#30 lore raw

PATCH v3 4/12 miiphybb: move to drivers/net/phy

---
 Makefile                               |    1 +
 common/Makefile                        |    1 -
 drivers/net/phy/Makefile               |   46 ++++++++++++++++++++++++++++++++
 {common => drivers/net/phy}/miiphybb.c |    0 
 4 files changed, 47 insertions(+), 1 deletions(-)
Makefile +1 -0
index 0f82e71..a00195c 100644
@@ -227,6 +227,7 @@ LIBS += drivers/mtd/nand_legacy/libnand_legacy.a
 LIBS += drivers/mtd/onenand/libonenand.a
 LIBS += drivers/mtd/spi/libspi_flash.a
 LIBS += drivers/net/libnet.a
+LIBS += drivers/net/phy/libphy.a
 LIBS += drivers/net/sk98lin/libsk98lin.a
 LIBS += drivers/pci/libpci.a
 LIBS += drivers/pcmcia/libpcmcia.a
common/Makefile +0 -1
index 3e4829f..ff2e6c6 100644
@@ -133,7 +133,6 @@ COBJS-$(CONFIG_LCD) += lcd.o
 COBJS-y += lists.o
 COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
 COBJS-y += memsize.o
-COBJS-$(CONFIG_BITBANGMII) += miiphybb.o
 COBJS-y += miiphyutil.o
 COBJS-y += s_record.o
 COBJS-y += serial.o
drivers/net/phy/Makefile new file +46 -0

46 lines not on this page · raw message

drivers/net/phy/miiphybb.c renamed from common/miiphybb.c +0 -0
similarity index 100%
rename from common/miiphybb.c
rename to drivers/net/phy/miiphybb.c
Signature · 1 line
1.5.6.3
#31 lore raw

PATCH v3 5/12 crc16: move to lib_generic

---
 common/Makefile                 |    1 -
 lib_generic/Makefile            |    1 +
 {common => lib_generic}/crc16.c |    0 
 3 files changed, 1 insertions(+), 1 deletions(-)
common/Makefile +0 -1
index ff2e6c6..0c8ef5b 100644
@@ -141,7 +141,6 @@ COBJS-y += usb.o
 COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
 endif
 COBJS-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
-COBJS-y += crc16.o
 COBJS-y += xyzModem.o
 COBJS-y += cmd_mac.o
 COBJS-$(CONFIG_CMD_MFSL) += cmd_mfsl.o
lib_generic/Makefile +1 -0
index a820f97..7df5a2c 100644
@@ -30,6 +30,7 @@ COBJS-y += bzlib_crctable.o
 COBJS-y += bzlib_decompress.o
 COBJS-y += bzlib_randtable.o
 COBJS-y += bzlib_huffman.o
+COBJS-y += crc16.o
 COBJS-y += crc32.o
 COBJS-y += ctype.o
 COBJS-y += display_options.o
lib_generic/crc16.c renamed from common/crc16.c +0 -0
similarity index 100%
rename from common/crc16.c
rename to lib_generic/crc16.c
Signature · 1 line
1.5.6.3
#32 lore raw

PATCH v3 6/12 autoscript: Move conditional compilation to Makefile

---
 common/Makefile         |    3 ++-
 common/cmd_autoscript.c |    4 ----
 2 files changed, 2 insertions(+), 5 deletions(-)
common/Makefile +2 -1
index 0c8ef5b..918b908 100644
@@ -31,7 +31,7 @@ COBJS-y += main.o
 COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o
 COBJS-y += circbuf.o
 COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o
-COBJS-y += cmd_autoscript.o
+COBJS-$(CONFIG_AUTOSCRIPT)$(CONFIG_CMD_AUTOSCRIPT) += cmd_autoscript.o
 COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
 COBJS-$(CONFIG_CMD_BEDBUG) += cmd_bedbug.o
 COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o
@@ -148,6 +148,7 @@ COBJS-$(CONFIG_MP) += cmd_mp.o
 COBJS-$(CONFIG_CMD_SF) += cmd_sf.o
 COBJS-$(CONFIG_DDR_SPD) += ddr_spd.o
 
+COBJS-y	+= $(COBJS-yy)
 COBJS	:= $(COBJS-y)
 SRCS	:= $(AOBJS:.o=.S) $(COBJS:.o=.c)
 OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS))
common/cmd_autoscript.c +0 -4
index 13af93e..c2e7e66 100644
@@ -47,8 +47,6 @@
 #include <hush.h>
 #endif
 
-#if defined(CONFIG_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT)
-
 int
 autoscript (ulong addr, const char *fit_uname)
 {
@@ -200,8 +198,6 @@ autoscript (ulong addr, const char *fit_uname)
 	return rcode;
 }
 
-#endif
-
 /**************************************************/
 #if defined(CONFIG_CMD_AUTOSCRIPT)
 int
Signature · 1 line
1.5.6.3
#33 lore raw

PATCH v3 7/12 miiphyutil: Move conditional compilation to Makefile

---
 common/Makefile          |    2 +-
 common/miiphyutil.c      |    2 --
 drivers/net/phy/Makefile |    2 +-
 3 files changed, 2 insertions(+), 4 deletions(-)
common/Makefile +1 -1
index 918b908..6ba20c0 100644
@@ -84,6 +84,7 @@ COBJS-$(CONFIG_CMD_LICENSE) += cmd_license.o
 COBJS-y += cmd_load.o
 COBJS-$(CONFIG_LOGBUFFER) += cmd_log.o
 COBJS-y += cmd_mem.o
+COBJS-$(CONFIG_MII)$(CONFIG_CMD_MII) += miiphyutil.o
 COBJS-$(CONFIG_CMD_MII) += cmd_mii.o
 COBJS-$(CONFIG_CMD_MISC) += cmd_misc.o
 COBJS-$(CONFIG_CMD_MMC) += cmd_mmc.o
@@ -133,7 +134,6 @@ COBJS-$(CONFIG_LCD) += lcd.o
 COBJS-y += lists.o
 COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
 COBJS-y += memsize.o
-COBJS-y += miiphyutil.o
 COBJS-y += s_record.o
 COBJS-y += serial.o
 ifdef CONFIG_CMD_USB
common/miiphyutil.c +0 -2
index eac8275..5ef4a33 100644
@@ -29,7 +29,6 @@
 #include <common.h>
 #include <miiphy.h>
 
-#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
 #include <asm/types.h>
 #include <linux/list.h>
 #include <malloc.h>
@@ -487,4 +486,3 @@ int miiphy_link (char *devname, unsigned char addr)
 	}
 }
 #endif
-#endif /* CONFIG_MII */
drivers/net/phy/Makefile +1 -1
index 10dc082..4fe3b05 100644
@@ -1,5 +1,5 @@
 #
-# (C) Copyright 2006
+# (C) Copyright 2008
 # Wolfgang Denk, DENX Software Engineering, wd at denx.de.
 #
 # See file CREDITS for list of people who contributed to this
Signature · 1 line
1.5.6.3
#34 lore raw

PATCH v3 8/12 common/Makefile: order by functionality

---
 common/Makefile |   70 +++++++++++++++++++++++++++++--------------------------
 1 files changed, 37 insertions(+), 33 deletions(-)
common/Makefile +37 -33
index 6ba20c0..6365fae 100644
@@ -27,15 +27,40 @@ LIB	= $(obj)libcommon.a
 
 AOBJS	=
 
+# core
 COBJS-y += main.o
-COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o
 COBJS-y += circbuf.o
+COBJS-y += console.o
+COBJS-y += command.o
+COBJS-y += devices.o
+COBJS-y += dlmalloc.o
+COBJS-y += exports.o
+COBJS-y += hush.o
+COBJS-y += image.o
+COBJS-y += lists.o
+COBJS-y += memsize.o
+COBJS-y += s_record.o
+COBJS-y += serial.o
+COBJS-y += xyzModem.o
+
+# environment
+COBJS-y += environment.o
+COBJS-y += env_common.o
+COBJS-y += env_dataflash.o
+COBJS-y += env_eeprom.o
+COBJS-y += env_flash.o
+COBJS-y += env_nand.o
+COBJS-y += env_nvram.o
+COBJS-y += env_onenand.o
+COBJS-y += env_sf.o
+COBJS-y += env_nowhere.o
+
+# command
 COBJS-$(CONFIG_CMD_AMBAPP) += cmd_ambapp.o
 COBJS-$(CONFIG_AUTOSCRIPT)$(CONFIG_CMD_AUTOSCRIPT) += cmd_autoscript.o
 COBJS-$(CONFIG_CMD_BDI) += cmd_bdinfo.o
-COBJS-$(CONFIG_CMD_BEDBUG) += cmd_bedbug.o
+COBJS-$(CONFIG_CMD_BEDBUG) += bedbug.o cmd_bedbug.o
 COBJS-$(CONFIG_CMD_BMP) += cmd_bmp.o
-COBJS-y += image.o
 COBJS-y += cmd_boot.o
 COBJS-$(CONFIG_CMD_BOOTLDR) += cmd_bootldr.o
 COBJS-y += cmd_bootm.o
@@ -83,11 +108,14 @@ COBJS-$(CONFIG_CMD_JFFS2) += cmd_jffs2.o
 COBJS-$(CONFIG_CMD_LICENSE) += cmd_license.o
 COBJS-y += cmd_load.o
 COBJS-$(CONFIG_LOGBUFFER) += cmd_log.o
+COBJS-y += cmd_mac.o
 COBJS-y += cmd_mem.o
+COBJS-$(CONFIG_CMD_MFSL) += cmd_mfsl.o
 COBJS-$(CONFIG_MII)$(CONFIG_CMD_MII) += miiphyutil.o
 COBJS-$(CONFIG_CMD_MII) += cmd_mii.o
 COBJS-$(CONFIG_CMD_MISC) += cmd_misc.o
 COBJS-$(CONFIG_CMD_MMC) += cmd_mmc.o
+COBJS-$(CONFIG_MP) += cmd_mp.o
 COBJS-y += cmd_nand.o
 COBJS-$(CONFIG_CMD_NET) += cmd_net.o
 COBJS-y += cmd_nvedit.o
@@ -101,51 +129,27 @@ COBJS-$(CONFIG_CMD_PORTIO) += cmd_portio.o
 COBJS-$(CONFIG_CMD_REGINFO) += cmd_reginfo.o
 COBJS-$(CONFIG_CMD_REISER) += cmd_reiser.o
 COBJS-$(CONFIG_CMD_SATA) += cmd_sata.o
+COBJS-$(CONFIG_CMD_SF) += cmd_sf.o
 COBJS-$(CONFIG_CMD_SCSI) += cmd_scsi.o
 COBJS-$(CONFIG_CMD_SETEXPR) += cmd_setexpr.o
 COBJS-$(CONFIG_CMD_SPI) += cmd_spi.o
 COBJS-$(CONFIG_CMD_STRINGS) += cmd_strings.o
 COBJS-$(CONFIG_CMD_TERMINAL) += cmd_terminal.o
 COBJS-$(CONFIG_CMD_UNIVERSE) += cmd_universe.o
-COBJS-$(CONFIG_CMD_USB) += cmd_usb.o
+ifdef CONFIG_CMD_USB
+COBJS-y += cmd_usb.o
+COBJS-y += usb.o
+COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
+endif
 COBJS-$(CONFIG_CMD_XIMG) += cmd_ximg.o
 COBJS-$(CONFIG_YAFFS2) += cmd_yaffs2.o
 COBJS-y += cmd_vfd.o
-COBJS-y += command.o
-COBJS-y += console.o
-COBJS-y += devices.o
-COBJS-y += dlmalloc.o
 COBJS-$(CONFIG_CMD_DOC) += docecc.o
-COBJS-y += environment.o
-COBJS-y += env_common.o
-COBJS-y += env_nand.o
-COBJS-y += env_dataflash.o
-COBJS-y += env_flash.o
-COBJS-y += env_eeprom.o
-COBJS-y += env_onenand.o
-COBJS-y += env_sf.o
-COBJS-y += env_nvram.o
-COBJS-y += env_nowhere.o
-COBJS-y += exports.o
 COBJS-y += flash.o
-COBJS-y += hush.o
 COBJS-y += kgdb.o
 COBJS-$(CONFIG_LCD) += lcd.o
-COBJS-y += lists.o
 COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
-COBJS-y += memsize.o
-COBJS-y += s_record.o
-COBJS-y += serial.o
-ifdef CONFIG_CMD_USB
-COBJS-y += usb.o
-COBJS-$(CONFIG_USB_STORAGE) += usb_storage.o
-endif
 COBJS-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
-COBJS-y += xyzModem.o
-COBJS-y += cmd_mac.o
-COBJS-$(CONFIG_CMD_MFSL) += cmd_mfsl.o
-COBJS-$(CONFIG_MP) += cmd_mp.o
-COBJS-$(CONFIG_CMD_SF) += cmd_sf.o
 COBJS-$(CONFIG_DDR_SPD) += ddr_spd.o
 
 COBJS-y	+= $(COBJS-yy)
Signature · 1 line
1.5.6.3
#35 lore raw

PATCH v3 9/12 cmd_terminal: remove no need ifdef

---
 common/cmd_terminal.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
common/cmd_terminal.c +0 -4
index 8871607..57943c1 100644
@@ -28,8 +28,6 @@
 #include <command.h>
 #include <devices.h>
 
-#if defined(CONFIG_CMD_TERMINAL)
-
 int do_terminal(cmd_tbl_t * cmd, int flag, int argc, char *argv[])
 {
 	int i, l;
@@ -98,5 +96,3 @@ U_BOOT_CMD(
 	"terminal - start terminal emulator\n",
 	""
 );
-
-#endif /* CONFIG_CMD_TERMINAL */
Signature · 1 line
1.5.6.3
#36 lore raw

PATCH v3 10/12 update linux/list

---
 include/linux/list.h   |  506 +++++++++++++++++++++++++++++++++++++++++++-----
 include/linux/poison.h |   13 ++
 2 files changed, 474 insertions(+), 45 deletions(-)
include/linux/list.h +461 -45
index e6492f7..aeeeb21 100644
@@ -1,6 +1,9 @@
 #ifndef _LINUX_LIST_H
 #define _LINUX_LIST_H
 
+#include <linux/stddef.h>
+#include <linux/poison.h>
+
 #ifndef ARCH_HAS_PREFETCH
 #define ARCH_HAS_PREFETCH
 static inline void prefetch(const void *x) {;}
@@ -25,9 +28,11 @@ struct list_head {
 #define LIST_HEAD(name) \
 	struct list_head name = LIST_HEAD_INIT(name)
 
-#define INIT_LIST_HEAD(ptr) do { \
-	(ptr)->next = (ptr); (ptr)->prev = (ptr); \
-} while (0)
+static inline void INIT_LIST_HEAD(struct list_head *list)
+{
+	list->next = list;
+	list->prev = list;
+}
 
 /*
  * Insert a new entry between two known consecutive entries.
@@ -87,13 +92,37 @@ static inline void __list_del(struct list_head *prev, struct list_head *next)
 /**
  * list_del - deletes entry from list.
  * @entry: the element to delete from the list.
- * Note: list_empty on entry does not return true after this, the entry is in an undefined state.
+ * Note: list_empty() on entry does not return true after this, the entry is
+ * in an undefined state.
  */
 static inline void list_del(struct list_head *entry)
 {
 	__list_del(entry->prev, entry->next);
-	entry->next = (void *) 0;
-	entry->prev = (void *) 0;
+	entry->next = LIST_POISON1;
+	entry->prev = LIST_POISON2;
+}
+
+/**
+ * list_replace - replace old entry by new one
+ * @old : the element to be replaced
+ * @new : the new element to insert
+ *
+ * If @old was empty, it will be overwritten.
+ */
+static inline void list_replace(struct list_head *old,
+				struct list_head *new)
+{
+	new->next = old->next;
+	new->next->prev = new;
+	new->prev = old->prev;
+	new->prev->next = new;
+}
+
+static inline void list_replace_init(struct list_head *old,
+					struct list_head *new)
+{
+	list_replace(old, new);
+	INIT_LIST_HEAD(old);
 }
 
 /**
@@ -130,37 +159,129 @@ static inline void list_move_tail(struct list_head *list,
 }
 
 /**
+ * list_is_last - tests whether @list is the last entry in list @head
+ * @list: the entry to test
+ * @head: the head of the list
+ */
+static inline int list_is_last(const struct list_head *list,
+				const struct list_head *head)
+{
+	return list->next == head;
+}
+
+/**
  * list_empty - tests whether a list is empty
  * @head: the list to test.
  */
-static inline int list_empty(struct list_head *head)
+static inline int list_empty(const struct list_head *head)
 {
 	return head->next == head;
 }
 
-static inline void __list_splice(struct list_head *list,
-				 struct list_head *head)
+/**
+ * list_empty_careful - tests whether a list is empty and not being modified
+ * @head: the list to test
+ *
+ * Description:
+ * tests whether a list is empty _and_ checks that no other CPU might be
+ * in the process of modifying either member (next or prev)
+ *
+ * NOTE: using list_empty_careful() without synchronization
+ * can only be safe if the only activity that can happen
+ * to the list entry is list_del_init(). Eg. it cannot be used
+ * if another CPU could re-list_add() it.
+ */
+static inline int list_empty_careful(const struct list_head *head)
+{
+	struct list_head *next = head->next;
+	return (next == head) && (next == head->prev);
+}
+
+/**
+ * list_is_singular - tests whether a list has just one entry.
+ * @head: the list to test.
+ */
+static inline int list_is_singular(const struct list_head *head)
+{
+	return !list_empty(head) && (head->next == head->prev);
+}
+
+static inline void __list_cut_position(struct list_head *list,
+		struct list_head *head, struct list_head *entry)
+{
+	struct list_head *new_first = entry->next;
+	list->next = head->next;
+	list->next->prev = list;
+	list->prev = entry;
+	entry->next = list;
+	head->next = new_first;
+	new_first->prev = head;
+}
+
+/**
+ * list_cut_position - cut a list into two
+ * @list: a new list to add all removed entries
+ * @head: a list with entries
+ * @entry: an entry within head, could be the head itself
+ *	and if so we won't cut the list
+ *
+ * This helper moves the initial part of @head, up to and
+ * including @entry, from @head to @list. You should
+ * pass on @entry an element you know is on @head. @list
+ * should be an empty list or a list you do not care about
+ * losing its data.
+ *
+ */
+static inline void list_cut_position(struct list_head *list,
+		struct list_head *head, struct list_head *entry)
+{
+	if (list_empty(head))
+		return;
+	if (list_is_singular(head) &&
+		(head->next != entry && head != entry))
+		return;
+	if (entry == head)
+		INIT_LIST_HEAD(list);
+	else
+		__list_cut_position(list, head, entry);
+}
+
+static inline void __list_splice(const struct list_head *list,
+				 struct list_head *prev,
+				 struct list_head *next)
 {
 	struct list_head *first = list->next;
 	struct list_head *last = list->prev;
-	struct list_head *at = head->next;
 
-	first->prev = head;
-	head->next = first;
+	first->prev = prev;
+	prev->next = first;
 
-	last->next = at;
-	at->prev = last;
+	last->next = next;
+	next->prev = last;
 }
 
 /**
- * list_splice - join two lists
+ * list_splice - join two lists, this is designed for stacks
  * @list: the new list to add.
  * @head: the place to add it in the first list.
  */
-static inline void list_splice(struct list_head *list, struct list_head *head)
+static inline void list_splice(const struct list_head *list,
+				struct list_head *head)
 {
 	if (!list_empty(list))
-		__list_splice(list, head);
+		__list_splice(list, head, head->next);
+}
+
+/**
+ * list_splice_tail - join two lists, each list being a queue
+ * @list: the new list to add.
+ * @head: the place to add it in the first list.
+ */
+static inline void list_splice_tail(struct list_head *list,
+				struct list_head *head)
+{
+	if (!list_empty(list))
+		__list_splice(list, head->prev, head);
 }
 
 /**
@@ -174,7 +295,24 @@ static inline void list_splice_init(struct list_head *list,
 				    struct list_head *head)
 {
 	if (!list_empty(list)) {
-		__list_splice(list, head);
+		__list_splice(list, head, head->next);
+		INIT_LIST_HEAD(list);
+	}
+}
+
+/**
+ * list_splice_tail_init - join two lists and reinitialise the emptied list
+ * @list: the new list to add.
+ * @head: the place to add it in the first list.
+ *
+ * Each of the lists is a queue.
+ * The list at @list is reinitialised
+ */
+static inline void list_splice_tail_init(struct list_head *list,
+					 struct list_head *head)
+{
+	if (!list_empty(list)) {
+		__list_splice(list, head->prev, head);
 		INIT_LIST_HEAD(list);
 	}
 }
@@ -186,28 +324,53 @@ static inline void list_splice_init(struct list_head *list,
  * @member:	the name of the list_struct within the struct.
  */
 #define list_entry(ptr, type, member) \
-	((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
+	container_of(ptr, type, member)
+
+/**
+ * list_first_entry - get the first element from a list
+ * @ptr:	the list head to take the element from.
+ * @type:	the type of the struct this is embedded in.
+ * @member:	the name of the list_struct within the struct.
+ *
+ * Note, that list is expected to be not empty.
+ */
+#define list_first_entry(ptr, type, member) \
+	list_entry((ptr)->next, type, member)
 
 /**
  * list_for_each	-	iterate over a list
- * @pos:	the &struct list_head to use as a loop counter.
+ * @pos:	the &struct list_head to use as a loop cursor.
  * @head:	the head for your list.
  */
 #define list_for_each(pos, head) \
-	for (pos = (head)->next, prefetch(pos->next); pos != (head); \
-		pos = pos->next, prefetch(pos->next))
+	for (pos = (head)->next; prefetch(pos->next), pos != (head); \
+        	pos = pos->next)
+
+/**
+ * __list_for_each	-	iterate over a list
+ * @pos:	the &struct list_head to use as a loop cursor.
+ * @head:	the head for your list.
+ *
+ * This variant differs from list_for_each() in that it's the
+ * simplest possible list iteration code, no prefetching is done.
+ * Use this for code that knows the list to be very short (empty
+ * or 1 entry) most of the time.
+ */
+#define __list_for_each(pos, head) \
+	for (pos = (head)->next; pos != (head); pos = pos->next)
+
 /**
  * list_for_each_prev	-	iterate over a list backwards
- * @pos:	the &struct list_head to use as a loop counter.
+ * @pos:	the &struct list_head to use as a loop cursor.
  * @head:	the head for your list.
  */
 #define list_for_each_prev(pos, head) \
-	for (pos = (head)->prev, prefetch(pos->prev); pos != (head); \
-		pos = pos->prev, prefetch(pos->prev))
+	for (pos = (head)->prev; prefetch(pos->prev), pos != (head); \
+        	pos = pos->prev)
 
 /**
- * list_for_each_safe	-	iterate over a list safe against removal of list entry
- * @pos:	the &struct list_head to use as a loop counter.
+ * list_for_each_safe - iterate over a list safe against removal of list entry
+ * @pos:	the &struct list_head to use as a loop cursor.
  * @n:		another &struct list_head to use as temporary storage
  * @head:	the head for your list.
  */
@@ -216,43 +379,296 @@ static inline void list_splice_init(struct list_head *list,
 		pos = n, n = pos->next)
 
 /**
+ * list_for_each_prev_safe - iterate over a list backwards safe against removal of list entry
+ * @pos:	the &struct list_head to use as a loop cursor.
+ * @n:		another &struct list_head to use as temporary storage
+ * @head:	the head for your list.
+ */
+#define list_for_each_prev_safe(pos, n, head) \
+	for (pos = (head)->prev, n = pos->prev; \
+	     prefetch(pos->prev), pos != (head); \
+	     pos = n, n = pos->prev)
+
+/**
  * list_for_each_entry	-	iterate over list of given type
- * @pos:	the type * to use as a loop counter.
+ * @pos:	the type * to use as a loop cursor.
  * @head:	the head for your list.
  * @member:	the name of the list_struct within the struct.
  */
 #define list_for_each_entry(pos, head, member)				\
-	for (pos = list_entry((head)->next, typeof(*pos), member),	\
-		     prefetch(pos->member.next);			\
-	     &pos->member != (head);					\
-	     pos = list_entry(pos->member.next, typeof(*pos), member),	\
-		     prefetch(pos->member.next))
+	for (pos = list_entry((head)->next, typeof(*pos), member);	\
+	     prefetch(pos->member.next), &pos->member != (head); 	\
+	     pos = list_entry(pos->member.next, typeof(*pos), member))
+
+/**
+ * list_for_each_entry_reverse - iterate backwards over list of given type.
+ * @pos:	the type * to use as a loop cursor.
+ * @head:	the head for your list.
+ * @member:	the name of the list_struct within the struct.
+ */
+#define list_for_each_entry_reverse(pos, head, member)			\
+	for (pos = list_entry((head)->prev, typeof(*pos), member);	\
+	     prefetch(pos->member.prev), &pos->member != (head); 	\
+	     pos = list_entry(pos->member.prev, typeof(*pos), member))
+
+/**
+ * list_prepare_entry - prepare a pos entry for use in list_for_each_entry_continue()
+ * @pos:	the type * to use as a start point
+ * @head:	the head of the list
+ * @member:	the name of the list_struct within the struct.
+ *
+ * Prepares a pos entry for use as a start point in list_for_each_entry_continue().
+ */
+#define list_prepare_entry(pos, head, member) \
+	((pos) ? : list_entry(head, typeof(*pos), member))
+
+/**
+ * list_for_each_entry_continue - continue iteration over list of given type
+ * @pos:	the type * to use as a loop cursor.
+ * @head:	the head for your list.
+ * @member:	the name of the list_struct within the struct.
+ *
+ * Continue to iterate over list of given type, continuing after
+ * the current position.
+ */
+#define list_for_each_entry_continue(pos, head, member) 		\
+	for (pos = list_entry(pos->member.next, typeof(*pos), member);	\
+	     prefetch(pos->member.next), &pos->member != (head);	\
+	     pos = list_entry(pos->member.next, typeof(*pos), member))
+
+/**
+ * list_for_each_entry_continue_reverse - iterate backwards from the given point
+ * @pos:	the type * to use as a loop cursor.
+ * @head:	the head for your list.
+ * @member:	the name of the list_struct within the struct.
+ *
+ * Start to iterate over list of given type backwards, continuing after
+ * the current position.
+ */
+#define list_for_each_entry_continue_reverse(pos, head, member)		\
+	for (pos = list_entry(pos->member.prev, typeof(*pos), member);	\
+	     prefetch(pos->member.prev), &pos->member != (head);	\
+	     pos = list_entry(pos->member.prev, typeof(*pos), member))
+
+/**
+ * list_for_each_entry_from - iterate over list of given type from the current point
+ * @pos:	the type * to use as a loop cursor.
+ * @head:	the head for your list.
+ * @member:	the name of the list_struct within the struct.
+ *
+ * Iterate over list of given type, continuing from current position.
+ */
+#define list_for_each_entry_from(pos, head, member) 			\
+	for (; prefetch(pos->member.next), &pos->member != (head);	\
+	     pos = list_entry(pos->member.next, typeof(*pos), member))
 
 /**
  * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
- * @pos:	the type * to use as a loop counter.
+ * @pos:	the type * to use as a loop cursor.
  * @n:		another type * to use as temporary storage
  * @head:	the head for your list.
  * @member:	the name of the list_struct within the struct.
  */
 #define list_for_each_entry_safe(pos, n, head, member)			\
 	for (pos = list_entry((head)->next, typeof(*pos), member),	\
-		n = list_entry(pos->member.next, typeof(*pos), member); \
-	     &pos->member != (head);					\
+		n = list_entry(pos->member.next, typeof(*pos), member);	\
+	     &pos->member != (head); 					\
 	     pos = n, n = list_entry(n->member.next, typeof(*n), member))
 
 /**
- * list_for_each_entry_continue -	iterate over list of given type
- *			continuing after existing point
- * @pos:	the type * to use as a loop counter.
+ * list_for_each_entry_safe_continue
+ * @pos:	the type * to use as a loop cursor.
+ * @n:		another type * to use as temporary storage
  * @head:	the head for your list.
  * @member:	the name of the list_struct within the struct.
+ *
+ * Iterate over list of given type, continuing after current point,
+ * safe against removal of list entry.
+ */
+#define list_for_each_entry_safe_continue(pos, n, head, member) 		\
+	for (pos = list_entry(pos->member.next, typeof(*pos), member), 		\
+		n = list_entry(pos->member.next, typeof(*pos), member);		\
+	     &pos->member != (head);						\
+	     pos = n, n = list_entry(n->member.next, typeof(*n), member))
+
+/**
+ * list_for_each_entry_safe_from
+ * @pos:	the type * to use as a loop cursor.
+ * @n:		another type * to use as temporary storage
+ * @head:	the head for your list.
+ * @member:	the name of the list_struct within the struct.
+ *
+ * Iterate over list of given type from current point, safe against
+ * removal of list entry.
+ */
+#define list_for_each_entry_safe_from(pos, n, head, member) 			\
+	for (n = list_entry(pos->member.next, typeof(*pos), member);		\
+	     &pos->member != (head);						\
+	     pos = n, n = list_entry(n->member.next, typeof(*n), member))
+
+/**
+ * list_for_each_entry_safe_reverse
+ * @pos:	the type * to use as a loop cursor.
+ * @n:		another type * to use as temporary storage
+ * @head:	the head for your list.
+ * @member:	the name of the list_struct within the struct.
+ *
+ * Iterate backwards over list of given type, safe against removal
+ * of list entry.
+ */
+#define list_for_each_entry_safe_reverse(pos, n, head, member)		\
+	for (pos = list_entry((head)->prev, typeof(*pos), member),	\
+		n = list_entry(pos->member.prev, typeof(*pos), member);	\
+	     &pos->member != (head); 					\
+	     pos = n, n = list_entry(n->member.prev, typeof(*n), member))
+
+/*
+ * Double linked lists with a single pointer list head.
+ * Mostly useful for hash tables where the two pointer list head is
+ * too wasteful.
+ * You lose the ability to access the tail in O(1).
+ */
+
+struct hlist_head {
+	struct hlist_node *first;
+};
+
+struct hlist_node {
+	struct hlist_node *next, **pprev;
+};
+
+#define HLIST_HEAD_INIT { .first = NULL }
+#define HLIST_HEAD(name) struct hlist_head name = {  .first = NULL }
+#define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL)
+static inline void INIT_HLIST_NODE(struct hlist_node *h)
+{
+	h->next = NULL;
+	h->pprev = NULL;
+}
+
+static inline int hlist_unhashed(const struct hlist_node *h)
+{
+	return !h->pprev;
+}
+
+static inline int hlist_empty(const struct hlist_head *h)
+{
+	return !h->first;
+}
+
+static inline void __hlist_del(struct hlist_node *n)
+{
+	struct hlist_node *next = n->next;
+	struct hlist_node **pprev = n->pprev;
+	*pprev = next;
+	if (next)
+		next->pprev = pprev;
+}
+
+static inline void hlist_del(struct hlist_node *n)
+{
+	__hlist_del(n);
+	n->next = LIST_POISON1;
+	n->pprev = LIST_POISON2;
+}
+
+static inline void hlist_del_init(struct hlist_node *n)
+{
+	if (!hlist_unhashed(n)) {
+		__hlist_del(n);
+		INIT_HLIST_NODE(n);
+	}
+}
+
+static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
+{
+	struct hlist_node *first = h->first;
+	n->next = first;
+	if (first)
+		first->pprev = &n->next;
+	h->first = n;
+	n->pprev = &h->first;
+}
+
+/* next must be != NULL */
+static inline void hlist_add_before(struct hlist_node *n,
+					struct hlist_node *next)
+{
+	n->pprev = next->pprev;
+	n->next = next;
+	next->pprev = &n->next;
+	*(n->pprev) = n;
+}
+
+static inline void hlist_add_after(struct hlist_node *n,
+					struct hlist_node *next)
+{
+	next->next = n->next;
+	n->next = next;
+	next->pprev = &n->next;
+
+	if(next->next)
+		next->next->pprev  = &next->next;
+}
+
+#define hlist_entry(ptr, type, member) container_of(ptr,type,member)
+
+#define hlist_for_each(pos, head) \
+	for (pos = (head)->first; pos && ({ prefetch(pos->next); 1; }); \
+	     pos = pos->next)
+
+#define hlist_for_each_safe(pos, n, head) \
+	for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
+	     pos = n)
+
+/**
+ * hlist_for_each_entry	- iterate over list of given type
+ * @tpos:	the type * to use as a loop cursor.
+ * @pos:	the &struct hlist_node to use as a loop cursor.
+ * @head:	the head for your list.
+ * @member:	the name of the hlist_node within the struct.
+ */
+#define hlist_for_each_entry(tpos, pos, head, member)			 \
+	for (pos = (head)->first;					 \
+	     pos && ({ prefetch(pos->next); 1;}) &&			 \
+		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
+	     pos = pos->next)
+
+/**
+ * hlist_for_each_entry_continue - iterate over a hlist continuing after current point
+ * @tpos:	the type * to use as a loop cursor.
+ * @pos:	the &struct hlist_node to use as a loop cursor.
+ * @member:	the name of the hlist_node within the struct.
+ */
+#define hlist_for_each_entry_continue(tpos, pos, member)		 \
+	for (pos = (pos)->next;						 \
+	     pos && ({ prefetch(pos->next); 1;}) &&			 \
+		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
+	     pos = pos->next)
+
+/**
+ * hlist_for_each_entry_from - iterate over a hlist continuing from current point
+ * @tpos:	the type * to use as a loop cursor.
+ * @pos:	the &struct hlist_node to use as a loop cursor.
+ * @member:	the name of the hlist_node within the struct.
+ */
+#define hlist_for_each_entry_from(tpos, pos, member)			 \
+	for (; pos && ({ prefetch(pos->next); 1;}) &&			 \
+		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
+	     pos = pos->next)
+
+/**
+ * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry
+ * @tpos:	the type * to use as a loop cursor.
+ * @pos:	the &struct hlist_node to use as a loop cursor.
+ * @n:		another &struct hlist_node to use as temporary storage
+ * @head:	the head for your list.
+ * @member:	the name of the hlist_node within the struct.
  */
-#define list_for_each_entry_continue(pos, head, member)			\
-	for (pos = list_entry(pos->member.next, typeof(*pos), member),	\
-		     prefetch(pos->member.next);			\
-	     &pos->member != (head);					\
-	     pos = list_entry(pos->member.next, typeof(*pos), member),	\
-		     prefetch(pos->member.next))
+#define hlist_for_each_entry_safe(tpos, pos, n, head, member) 		 \
+	for (pos = (head)->first;					 \
+	     pos && ({ n = pos->next; 1; }) && 				 \
+		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
+	     pos = n)
 
 #endif
include/linux/poison.h new file +13 -0
new file mode 100644
index 0000000..ba7ff84
@@ -0,0 +1,13 @@
+#ifndef _LINUX_POISON_H
+#define _LINUX_POISON_H
+
+/********** include/linux/list.h **********/
+/*
+ * These are non-NULL pointers that will result in page faults
+ * under normal circumstances, used to verify that nobody uses
+ * non-initialized list entries.
+ */
+#define LIST_POISON1  ((void *) 0x00100100)
+#define LIST_POISON2  ((void *) 0x00200200)
+
+#endif
Signature · 1 line
1.5.6.3
#37 lore raw

PATCH v3 11/12 devices: merge to list_head

---
 common/Makefile        |    1 -
 common/cmd_console.c   |    9 +-
 common/cmd_terminal.c  |   10 +-
 common/console.c       |   62 ++---
 common/devices.c       |   79 +++---
 common/lists.c         |  734 ------------------------------------------------
 common/usb_kbd.c       |   14 +-
 include/devices.h      |    8 +-
 include/linux/poison.h |    8 +-
 include/lists.h        |   77 -----
 10 files changed, 90 insertions(+), 912 deletions(-)
common/Makefile +0 -1
index 6365fae..0fe9c8b 100644
@@ -37,7 +37,6 @@ COBJS-y += dlmalloc.o
 COBJS-y += exports.o
 COBJS-y += hush.o
 COBJS-y += image.o
-COBJS-y += lists.o
 COBJS-y += memsize.o
 COBJS-y += s_record.o
 COBJS-y += serial.o
common/cmd_console.c +6 -3
index 50ddb01..e2bc2a3 100644
@@ -31,14 +31,17 @@
 extern void _do_coninfo (void);
 int do_coninfo (cmd_tbl_t * cmd, int flag, int argc, char *argv[])
 {
-	int i, l;
+	int l;
+	struct list_head *list = device_get_list();
+	struct list_head *pos;
+	device_t *dev;
 
 	/* Scan for valid output and input devices */
 
 	puts ("List of available devices:\n");
 
-	for (i = 1; i <= ListNumItems (devlist); i++) {
-		device_t *dev = ListGetPtrToItem (devlist, i);
+	list_for_each(pos, list) {
+		dev = list_entry(pos, device_t, list);
 
 		printf ("%-8s %08x %c%c%c ",
 			dev->name,
common/cmd_terminal.c +2 -8
index 57943c1..67a2546 100644
@@ -27,10 +27,10 @@
 #include <common.h>
 #include <command.h>
 #include <devices.h>
+#include <serial.h>
 
 int do_terminal(cmd_tbl_t * cmd, int flag, int argc, char *argv[])
 {
-	int i, l;
 	int last_tilde = 0;
 	device_t *dev = NULL;
 
@@ -38,13 +38,7 @@ int do_terminal(cmd_tbl_t * cmd, int flag, int argc, char *argv[])
 		return -1;
 
 	/* Scan for selected output/input device */
-	for (i = 1; i <= ListNumItems (devlist); i++) {
-		device_t *tmp = ListGetPtrToItem (devlist, i);
-		if (!strcmp(tmp->name, argv[1])) {
-			dev = tmp;
-			break;
-		}
-	}
+	dev = device_get_by_name(argv[1]);
 	if (!dev)
 		return -1;
 
common/console.c +25 -37

101 lines not on this page · raw message

common/devices.c +43 -36

141 lines not on this page · raw message

common/lists.c deleted +0 -734

734 lines not on this page · raw message

common/usb_kbd.c +6 -8
index 04d9730..108bd60 100644
@@ -152,7 +152,7 @@ static int usb_kbd_probe(struct usb_device *dev, unsigned int ifnum);
 /* search for keyboard and register it if found */
 int drv_usb_kbd_init(void)
 {
-	int error,i,index;
+	int error,i;
 	device_t usb_kbd_dev,*old_dev;
 	struct usb_device *dev;
 	char *stdinname  = getenv ("stdin");
@@ -166,13 +166,11 @@ int drv_usb_kbd_init(void)
 			if(usb_kbd_probe(dev,0)==1) { /* Ok, we found a keyboard */
 				/* check, if it is already registered */
 				USB_KBD_PRINTF("USB KBD found set up device.\n");
-				for (index=1; index<=ListNumItems(devlist); index++) {
-					old_dev = ListGetPtrToItem(devlist, index);
-					if(strcmp(old_dev->name,DEVNAME)==0) {
-						/* ok, already registered, just return ok */
-						USB_KBD_PRINTF("USB KBD is already registered.\n");
-						return 1;
-					}
+				old_dev = device_get_by_name(DEVNAME);
+				if(old_dev) {
+					/* ok, already registered, just return ok */
+					USB_KBD_PRINTF("USB KBD is already registered.\n");
+					return 1;
 				}
 				/* register the keyboard */
 				USB_KBD_PRINTF("USB KBD register.\n");
include/devices.h +5 -3
index 2d9e282..490016b 100644
@@ -21,7 +21,7 @@
  * MA 02111-1307 USA
  */
 
-#include <lists.h>
+#include <linux/list.h>
 
 #ifndef _DEVICES_H_
 #define _DEVICES_H_
@@ -59,6 +59,7 @@ typedef struct {
 /* Other functions */
 
 	void *priv;			/* Private extensions			*/
+	struct list_head list;
 } device_t;
 
 /*
@@ -82,7 +83,6 @@ typedef struct {
 /*
  * VARIABLES
  */
-extern list_t devlist;
 extern device_t *stdio_devices[];
 extern char *stdio_names[MAX_FILES];
 
@@ -91,8 +91,10 @@ extern char *stdio_names[MAX_FILES];
  */
 int	device_register (device_t * dev);
 int	devices_init (void);
-int	devices_done (void);
 int	device_deregister(char *devname);
+struct list_head* device_get_list(void);
+device_t* device_get_by_name(char* name);
+
 #ifdef CONFIG_LCD
 int	drv_lcd_init (void);
 #endif
include/linux/poison.h +3 -5
index ba7ff84..b3d873b 100644
@@ -3,11 +3,9 @@
 
 /********** include/linux/list.h **********/
 /*
- * These are non-NULL pointers that will result in page faults
- * under normal circumstances, used to verify that nobody uses
- * non-initialized list entries.
+ * used to verify that nobody uses non-initialized list entries.
  */
-#define LIST_POISON1  ((void *) 0x00100100)
-#define LIST_POISON2  ((void *) 0x00200200)
+#define LIST_POISON1  ((void *) 0x0)
+#define LIST_POISON2  ((void *) 0x0)
 
 #endif
include/lists.h deleted +0 -77

77 lines not on this page · raw message

Signature · 1 line
1.5.6.3
#38 lore raw

PATCH v3 12/12 fs: Move conditional compilation to Makefile

---
 fs/Makefile                 |   10 +++++++++-
 fs/cramfs/Makefile          |    7 ++++---
 fs/cramfs/cramfs.c          |    5 -----
 fs/cramfs/uncompress.c      |    4 ----
 fs/ext2/Makefile            |    6 +++---
 fs/ext2/dev.c               |    3 ---
 fs/ext2/ext2fs.c            |    4 ----
 fs/fat/Makefile             |    6 +++---
 fs/fat/fat.c                |    4 ----
 fs/fat/file.c               |    4 ----
 fs/fdos/Makefile            |    6 +++---
 fs/fdos/dev.c               |    5 -----
 fs/fdos/fat.c               |    4 ----
 fs/fdos/fdos.c              |    5 +----
 fs/fdos/fs.c                |    4 ----
 fs/fdos/subdir.c            |    3 ---
 fs/fdos/vfat.c              |    5 -----
 fs/jffs2/Makefile           |    8 +++++---
 fs/jffs2/compr_lzari.c      |    3 ---
 fs/jffs2/compr_lzo.c        |    4 ----
 fs/jffs2/compr_rtime.c      |    4 ----
 fs/jffs2/compr_rubin.c      |    4 ----
 fs/jffs2/compr_zlib.c       |    4 ----
 fs/jffs2/jffs2_1pass.c      |    5 -----
 fs/jffs2/jffs2_nand_1pass.c |    2 +-
 fs/jffs2/mini_inflate.c     |    5 -----
 fs/reiserfs/Makefile        |    6 +++---
 fs/reiserfs/dev.c           |    4 ----
 fs/reiserfs/mode_string.c   |    3 ---
 fs/reiserfs/reiserfs.c      |    4 ----
 30 files changed, 32 insertions(+), 109 deletions(-)
fs/Makefile +9 -1
index 95ac0e9..8bbd563 100644
@@ -22,7 +22,15 @@
 #
 #
 
-SUBDIRS	:= jffs2 cramfs fdos fat reiserfs ext2 yaffs2
+subdirs-$(CONFIG_CMD_CRAMFS) := cramfs
+subdirs-$(CONFIG_CMD_EXT2) += ext2
+subdirs-$(CONFIG_CMD_FAT) += fat
+subdirs-$(CONFIG_CMD_FDOS) += fdos
+subdirs-$(CONFIG_CMD_JFFS2) += jffs2
+subdirs-$(CONFIG_CMD_REISER) += reiserfs
+subdirs-$(CONFIG_YAFFS2) += yaffs2
+
+SUBDIRS	:= $(subdirs-y)
 
 $(obj).depend all:
 	@for dir in $(SUBDIRS) ; do \
fs/cramfs/Makefile +4 -3
index 13c043f..7b6cc0a 100644
@@ -26,10 +26,11 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)libcramfs.a
 
 AOBJS	=
-COBJS	= cramfs.o uncompress.o
+COBJS-$(CONFIG_CMD_CRAMFS) := cramfs.o
+COBJS-$(CONFIG_CMD_CRAMFS) += uncompress.o
 
-SRCS	:= $(AOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS))
+SRCS	:= $(AOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS-y))
 
 #CPPFLAGS +=
 
fs/cramfs/cramfs.c +0 -5
index e53c783..2956d39 100644
@@ -26,9 +26,6 @@
 
 #include <common.h>
 #include <malloc.h>
-
-#if defined(CONFIG_CMD_CRAMFS)
-
 #include <asm/byteorder.h>
 #include <linux/stat.h>
 #include <jffs2/jffs2.h>
@@ -343,5 +340,3 @@ int cramfs_check (struct part_info *info)
 	}
 	return 1;
 }
-
-#endif /* CFG_FS_CRAMFS */
fs/cramfs/uncompress.c +0 -4
index cf67967..39dd275 100644
@@ -25,8 +25,6 @@
 #include <watchdog.h>
 #include <zlib.h>
 
-#if defined(CONFIG_CMD_CRAMFS)
-
 static z_stream stream;
 
 void *zalloc(void *, unsigned, unsigned);
@@ -86,5 +84,3 @@ int cramfs_uncompress_exit (void)
 	inflateEnd (&stream);
 	return 0;
 }
-
-#endif /* CFG_FS_CRAMFS */
fs/ext2/Makefile +3 -3
index 8313cdc..712e348 100644
@@ -30,10 +30,10 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)libext2fs.a
 
 AOBJS	=
-COBJS	= ext2fs.o dev.o
+COBJS-$(CONFIG_CMD_EXT2) := ext2fs.o dev.o
 
-SRCS	:= $(AOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS))
+SRCS	:= $(AOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS-y))
 
 #CPPFLAGS +=
 
fs/ext2/dev.c +0 -3
index 1728b34..3b49650 100644
@@ -25,8 +25,6 @@
 
 
 #include <common.h>
-#if defined(CONFIG_CMD_EXT2)
-
 #include <config.h>
 #include <ext2fs.h>
 
@@ -139,4 +137,3 @@ int ext2fs_devread (int sector, int byte_offset, int byte_len, char *buf) {
 	}
 	return (1);
 }
-#endif
fs/ext2/ext2fs.c +0 -4
index 7833551..436f4a4 100644
@@ -24,8 +24,6 @@
  */
 
 #include <common.h>
-
-#if defined(CONFIG_CMD_EXT2)
 #include <ext2fs.h>
 #include <malloc.h>
 #include <asm/byteorder.h>
@@ -874,5 +872,3 @@ fail:
 	ext2fs_root = NULL;
 	return (0);
 }
-
-#endif
fs/fat/Makefile +3 -3
index 87af73b..b711460 100644
@@ -24,10 +24,10 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)libfat.a
 
 AOBJS	=
-COBJS	= fat.o file.o
+COBJS-$(CONFIG_CMD_FAT)	:= fat.o file.o
 
-SRCS	:= $(AOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS))
+SRCS	:= $(AOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS-y))
 
 all:	$(LIB) $(AOBJS)
 
fs/fat/fat.c +0 -4
index 49c78ed..2f0bd8c 100644
@@ -31,8 +31,6 @@
 #include <asm/byteorder.h>
 #include <part.h>
 
-#if defined(CONFIG_CMD_FAT)
-
 /*
  * Convert a string to lowercase.
  */
@@ -1024,5 +1022,3 @@ file_fat_read(const char *filename, void *buffer, unsigned long maxsize)
 	printf("reading %s\n",filename);
 	return do_fat_read(filename, buffer, maxsize, LS_NO);
 }
-
-#endif
fs/fat/file.c +0 -4
index 514dbae..e870734 100644
@@ -32,8 +32,6 @@
 #include <linux/stat.h>
 #include <linux/time.h>
 
-#if defined(CONFIG_CMD_FAT)
-
 /* Supported filesystems */
 static const struct filesystem filesystems[] = {
 	{ file_fat_detectfs,  file_fat_ls,  file_fat_read,  "FAT" },
@@ -204,5 +202,3 @@ file_read(const char *filename, void *buffer, unsigned long maxsize)
 
 	return filesystems[current_filesystem].read(arg, buffer, maxsize);
 }
-
-#endif
fs/fdos/Makefile +3 -3
index 2dba0fb..fce2032 100644
@@ -31,10 +31,10 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)libfdos.a
 
 AOBJS	=
-COBJS	= fat.o vfat.o dev.o fdos.o fs.o subdir.o
+COBJS-$(CONFIG_CMD_FDOS) := fat.o vfat.o dev.o fdos.o fs.o subdir.o
 
-SRCS	:= $(AOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS))
+SRCS	:= $(AOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS-y))
 
 #CPPFLAGS +=
 
fs/fdos/dev.c +0 -5
index 271d0e7..b55b6ed 100644
@@ -28,8 +28,6 @@
 #include "dos.h"
 #include "fdos.h"
 
-#if defined(CONFIG_CMD_FDOS)
-
 #define NB_HEADS        2
 #define NB_TRACKS       80
 #define NB_SECTORS      18
@@ -190,6 +188,3 @@ int check_dev (BootSector_t *boot, Fs_t *fs)
 
     return (0);
 }
-
-
-#endif
fs/fdos/fat.c +0 -4
index 2e2d2b8..5707c19 100644
@@ -26,8 +26,6 @@
 #include <config.h>
 #include <malloc.h>
 
-#if defined(CONFIG_CMD_FDOS)
-
 #include "dos.h"
 #include "fdos.h"
 
@@ -138,5 +136,3 @@ int read_fat (BootSector_t *boot, Fs_t *fs)
     }
     return (0);
 }
-
-#endif
fs/fdos/fdos.c +1 -4
index 5be6a96..db58562 100644
@@ -24,9 +24,8 @@
 
 #include <common.h>
 #include <config.h>
-
-#if defined(CONFIG_CMD_FDOS)
 #include <malloc.h>
+
 #include "dos.h"
 #include "fdos.h"
 
@@ -171,5 +170,3 @@ int dos_dir (void)
     free (name);
     return (0);
 }
-
-#endif
fs/fdos/fs.c +0 -4
index aded670..5acf123 100644
@@ -26,8 +26,6 @@
 #include <config.h>
 #include <malloc.h>
 
-#if defined(CONFIG_CMD_FDOS)
-
 #include "dos.h"
 #include "fdos.h"
 
@@ -114,5 +112,3 @@ int fs_init (Fs_t *fs)
     free (boot);
     return (0);
 }
-
-#endif
fs/fdos/subdir.c +0 -3
index 497f554..5e96b0a 100644
@@ -26,8 +26,6 @@
 #include <config.h>
 #include <malloc.h>
 
-#if defined(CONFIG_CMD_FDOS)
-
 #include "dos.h"
 #include "fdos.h"
 
@@ -345,4 +343,3 @@ int read_file (Fs_t *fs,
     }
     return (read);
 }
-#endif
fs/fdos/vfat.c +0 -5
index 0e7883b..9f357a6 100644
@@ -24,8 +24,6 @@
 
 #include <common.h>
 #include <config.h>
-
-#if defined(CONFIG_CMD_FDOS)
 #include <linux/ctype.h>
 
 #include "dos.h"
@@ -352,6 +350,3 @@ static char *conv_name (char *name, char *ext, char Case, char *ans)
     }
     return (ans);
 }
-
-
-#endif
fs/jffs2/Makefile +5 -3
index a071af1..fd6a105 100644
@@ -26,13 +26,15 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)libjffs2.a
 
 AOBJS	=
-COBJS-y += jffs2_1pass.o
+ifdef CONFIG_CMD_JFFS2
+COBJS-$(CONFIG_JFFS2_LZO_LZARI) += compr_lzari.o
+COBJS-$(CONFIG_JFFS2_LZO_LZARI) += compr_lzo.o
 COBJS-y += compr_rtime.o
 COBJS-y += compr_rubin.o
 COBJS-y += compr_zlib.o
+COBJS-y += jffs2_1pass.o
 COBJS-y += mini_inflate.o
-COBJS-y += compr_lzo.o
-COBJS-y += compr_lzari.o
+endif
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(AOBJS:.o=.S) $(COBJS:.o=.c)
fs/jffs2/compr_lzari.c +0 -3
index f64bc74..6a29608 100644
@@ -50,8 +50,6 @@ All rights reserved. Permission granted for non-commercial use.
 
 
 #include <config.h>
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_LZO_LZARI)
-
 #include <linux/stddef.h>
 #include <jffs2/jffs2.h>
 
@@ -259,4 +257,3 @@ int lzari_decompress(unsigned char *data_in, unsigned char *cpage_out,
 {
     return Decode(data_in, cpage_out, srclen, destlen);
 }
-#endif
fs/jffs2/compr_lzo.c +0 -4
index a32b993..e648ec4 100644
@@ -67,8 +67,6 @@
 
 
 #include <config.h>
-#if defined(CONFIG_CMD_JFFS2) && defined(CONFIG_JFFS2_LZO_LZARI)
-
 #include <linux/stddef.h>
 #include <jffs2/jffs2.h>
 #include <jffs2/compr_rubin.h>
@@ -401,5 +399,3 @@ int lzo_decompress(unsigned char *data_in, unsigned char *cpage_out,
 	lzo_uint outlen = destlen;
 	return lzo1x_decompress (data_in, srclen, cpage_out, &outlen, NULL);
 }
-
-#endif
fs/jffs2/compr_rtime.c +0 -4
index 144263c..89b9f2f 100644
@@ -46,8 +46,6 @@
  */
 
 #include <config.h>
-#if defined(CONFIG_CMD_JFFS2)
-
 #include <jffs2/jffs2.h>
 
 void rtime_decompress(unsigned char *data_in, unsigned char *cpage_out,
@@ -87,5 +85,3 @@ void rtime_decompress(unsigned char *data_in, unsigned char *cpage_out,
 		}
 	}
 }
-
-#endif
fs/jffs2/compr_rubin.c +0 -4
index f6f3fa1..9ff2217 100644
@@ -39,8 +39,6 @@
  */
 
 #include <config.h>
-#if defined(CONFIG_CMD_JFFS2)
-
 #include <jffs2/jffs2.h>
 #include <jffs2/compr_rubin.h>
 
@@ -122,5 +120,3 @@ void dynrubin_decompress(unsigned char *data_in, unsigned char *cpage_out,
 
 	rubin_do_decompress(bits, data_in+8, cpage_out, dstlen);
 }
-
-#endif
fs/jffs2/compr_zlib.c +0 -4
index 29dfe1b..d306b6d 100644
@@ -37,8 +37,6 @@
 
 #include <common.h>
 #include <config.h>
-#if defined(CONFIG_CMD_JFFS2)
-
 #include <jffs2/jffs2.h>
 #include <jffs2/mini_inflate.h>
 
@@ -48,5 +46,3 @@ long zlib_decompress(unsigned char *data_in, unsigned char *cpage_out,
     return (decompress_block(cpage_out, data_in + 2, (void *) ldr_memcpy));
 
 }
-
-#endif
fs/jffs2/jffs2_1pass.c +0 -5
index b5e7ab8..5d22dd7 100644
@@ -117,9 +117,6 @@
 #include <linux/stat.h>
 #include <linux/time.h>
 #include <watchdog.h>
-
-#if defined(CONFIG_CMD_JFFS2)
-
 #include <jffs2/jffs2.h>
 #include <jffs2/jffs2_1pass.h>
 
@@ -1394,5 +1391,3 @@ jffs2_1pass_info(struct part_info * part)
 	}
 	return 1;
 }
-
-#endif
fs/jffs2/jffs2_nand_1pass.c +1 -1
index 9f6de7d..e288d5a 100644
@@ -1,6 +1,6 @@
 #include <common.h>
 
-#if !defined(CONFIG_NAND_LEGACY) && defined(CONFIG_CMD_JFFS2)
+#if !defined(CONFIG_NAND_LEGACY)
 
 #include <malloc.h>
 #include <linux/stat.h>
fs/jffs2/mini_inflate.c +0 -5
index 4c50fc3..bd40a57 100644
@@ -24,9 +24,6 @@
  */
 
 #include <config.h>
-
-#if defined(CONFIG_CMD_JFFS2)
-
 #include <jffs2/mini_inflate.h>
 
 /* The order that the code lengths in section 3.2.7 are in */
@@ -392,5 +389,3 @@ long decompress_block(unsigned char *dest, unsigned char *source,
 #endif
 	return stream.error ? -stream.error : stream.decoded;
 }
-
-#endif
fs/reiserfs/Makefile +3 -3
index e8711a4..9cef8ee 100644
@@ -30,10 +30,10 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)libreiserfs.a
 
 AOBJS	=
-COBJS	= reiserfs.o dev.o mode_string.o
+COBJS-$(CONFIG_CMD_REISER) := reiserfs.o dev.o mode_string.o
 
-SRCS	:= $(AOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS))
+SRCS	:= $(AOBJS:.o=.S) $(COBJS-y:.o=.c)
+OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS-y))
 
 #CPPFLAGS +=
 
fs/reiserfs/dev.c +0 -4
index 46dc414..1facfaf 100644
@@ -19,8 +19,6 @@
 
 
 #include <common.h>
-#if defined(CONFIG_CMD_REISER)
-
 #include <config.h>
 #include <reiserfs.h>
 
@@ -119,5 +117,3 @@ int reiserfs_devread (int sector, int byte_offset, int byte_len, char *buf)
 
 	return 1;
 }
-
-#endif
fs/reiserfs/mode_string.c +0 -3
index 3e57ee4..801263d 100644
@@ -25,7 +25,6 @@
 
 
 #include <common.h>
-#if defined(CONFIG_CMD_REISER)
 #include <linux/stat.h>
 
 #if ( S_ISUID != 04000 ) || ( S_ISGID != 02000 ) || ( S_ISVTX != 01000 ) \
@@ -137,5 +136,3 @@ const char *bb_mode_string(int mode)
 }
 
 #endif
-
-#endif
fs/reiserfs/reiserfs.c +0 -4
index aa96361..d84fb20 100644
@@ -29,8 +29,6 @@
  */
 
 #include <common.h>
-#if defined(CONFIG_CMD_REISER)
-
 #include <malloc.h>
 #include <linux/ctype.h>
 #include <linux/time.h>
@@ -982,5 +980,3 @@ reiserfs_open (char *filename)
 	}
 	return filemax;
 }
-
-#endif
Signature · 1 line
1.5.6.3
#39 lore raw

PATCH 2/3 devices: merge to list_head

In reply to Jean-Christophe PLAGNIOL-VILLARD
---
 common/Makefile       |    1 -
 common/cmd_console.c  |    9 +-
 common/cmd_terminal.c |   10 +-
 common/console.c      |   62 ++---
 common/devices.c      |   79 +++---
 common/lists.c        |  734 -------------------------------------------------
 common/usb_kbd.c      |   14 +-
 include/devices.h     |    8 +-
 include/lists.h       |   77 -----
 9 files changed, 87 insertions(+), 907 deletions(-)
 delete mode 100644 common/lists.c
 delete mode 100644 include/lists.h
common/Makefile +0 -1
index 6365fae..0fe9c8b 100644
@@ -37,7 +37,6 @@ COBJS-y += dlmalloc.o
 COBJS-y += exports.o
 COBJS-y += hush.o
 COBJS-y += image.o
-COBJS-y += lists.o
 COBJS-y += memsize.o
 COBJS-y += s_record.o
 COBJS-y += serial.o
common/cmd_console.c +6 -3
index 50ddb01..e2bc2a3 100644
@@ -31,14 +31,17 @@
 extern void _do_coninfo (void);
 int do_coninfo (cmd_tbl_t * cmd, int flag, int argc, char *argv[])
 {
-	int i, l;
+	int l;
+	struct list_head *list = device_get_list();
+	struct list_head *pos;
+	device_t *dev;
 
 	/* Scan for valid output and input devices */
 
 	puts ("List of available devices:\n");
 
-	for (i = 1; i <= ListNumItems (devlist); i++) {
-		device_t *dev = ListGetPtrToItem (devlist, i);
+	list_for_each(pos, list) {
+		dev = list_entry(pos, device_t, list);
 
 		printf ("%-8s %08x %c%c%c ",
 			dev->name,
common/cmd_terminal.c +2 -8
index 57943c1..67a2546 100644
@@ -27,10 +27,10 @@
 #include <common.h>
 #include <command.h>
 #include <devices.h>
+#include <serial.h>
 
 int do_terminal(cmd_tbl_t * cmd, int flag, int argc, char *argv[])
 {
-	int i, l;
 	int last_tilde = 0;
 	device_t *dev = NULL;
 
@@ -38,13 +38,7 @@ int do_terminal(cmd_tbl_t * cmd, int flag, int argc, char *argv[])
 		return -1;
 
 	/* Scan for selected output/input device */
-	for (i = 1; i <= ListNumItems (devlist); i++) {
-		device_t *tmp = ListGetPtrToItem (devlist, i);
-		if (!strcmp(tmp->name, argv[1])) {
-			dev = tmp;
-			break;
-		}
-	}
+	dev = device_get_by_name(argv[1]);
 	if (!dev)
 		return -1;
 
common/console.c +25 -37

101 lines not on this page · raw message

common/devices.c +43 -36

141 lines not on this page · raw message

common/lists.c deleted +0 -734

734 lines not on this page · raw message

common/usb_kbd.c +6 -8
index 04d9730..108bd60 100644
@@ -152,7 +152,7 @@ static int usb_kbd_probe(struct usb_device *dev, unsigned int ifnum);
 /* search for keyboard and register it if found */
 int drv_usb_kbd_init(void)
 {
-	int error,i,index;
+	int error,i;
 	device_t usb_kbd_dev,*old_dev;
 	struct usb_device *dev;
 	char *stdinname  = getenv ("stdin");
@@ -166,13 +166,11 @@ int drv_usb_kbd_init(void)
 			if(usb_kbd_probe(dev,0)==1) { /* Ok, we found a keyboard */
 				/* check, if it is already registered */
 				USB_KBD_PRINTF("USB KBD found set up device.\n");
-				for (index=1; index<=ListNumItems(devlist); index++) {
-					old_dev = ListGetPtrToItem(devlist, index);
-					if(strcmp(old_dev->name,DEVNAME)==0) {
-						/* ok, already registered, just return ok */
-						USB_KBD_PRINTF("USB KBD is already registered.\n");
-						return 1;
-					}
+				old_dev = device_get_by_name(DEVNAME);
+				if(old_dev) {
+					/* ok, already registered, just return ok */
+					USB_KBD_PRINTF("USB KBD is already registered.\n");
+					return 1;
 				}
 				/* register the keyboard */
 				USB_KBD_PRINTF("USB KBD register.\n");
include/devices.h +5 -3
index 2d9e282..490016b 100644
@@ -21,7 +21,7 @@
  * MA 02111-1307 USA
  */
 
-#include <lists.h>
+#include <linux/list.h>
 
 #ifndef _DEVICES_H_
 #define _DEVICES_H_
@@ -59,6 +59,7 @@ typedef struct {
 /* Other functions */
 
 	void *priv;			/* Private extensions			*/
+	struct list_head list;
 } device_t;
 
 /*
@@ -82,7 +83,6 @@ typedef struct {
 /*
  * VARIABLES
  */
-extern list_t devlist;
 extern device_t *stdio_devices[];
 extern char *stdio_names[MAX_FILES];
 
@@ -91,8 +91,10 @@ extern char *stdio_names[MAX_FILES];
  */
 int	device_register (device_t * dev);
 int	devices_init (void);
-int	devices_done (void);
 int	device_deregister(char *devname);
+struct list_head* device_get_list(void);
+device_t* device_get_by_name(char* name);
+
 #ifdef CONFIG_LCD
 int	drv_lcd_init (void);
 #endif
include/lists.h deleted +0 -77

77 lines not on this page · raw message

Signature · 1 line
1.5.6.3
#40 lore raw

PATCH 1/3 update linux/list

In reply to Jean-Christophe PLAGNIOL-VILLARD
---
 include/linux/list.h   |  506 +++++++++++++++++++++++++++++++++++++++++++-----
 include/linux/poison.h |   11 +
 2 files changed, 472 insertions(+), 45 deletions(-)
 create mode 100644 include/linux/poison.h
include/linux/list.h +461 -45
index e6492f7..aeeeb21 100644
@@ -1,6 +1,9 @@
 #ifndef _LINUX_LIST_H
 #define _LINUX_LIST_H
 
+#include <linux/stddef.h>
+#include <linux/poison.h>
+
 #ifndef ARCH_HAS_PREFETCH
 #define ARCH_HAS_PREFETCH
 static inline void prefetch(const void *x) {;}
@@ -25,9 +28,11 @@ struct list_head {
 #define LIST_HEAD(name) \
 	struct list_head name = LIST_HEAD_INIT(name)
 
-#define INIT_LIST_HEAD(ptr) do { \
-	(ptr)->next = (ptr); (ptr)->prev = (ptr); \
-} while (0)
+static inline void INIT_LIST_HEAD(struct list_head *list)
+{
+	list->next = list;
+	list->prev = list;
+}
 
 /*
  * Insert a new entry between two known consecutive entries.
@@ -87,13 +92,37 @@ static inline void __list_del(struct list_head *prev, struct list_head *next)
 /**
  * list_del - deletes entry from list.
  * @entry: the element to delete from the list.
- * Note: list_empty on entry does not return true after this, the entry is in an undefined state.
+ * Note: list_empty() on entry does not return true after this, the entry is
+ * in an undefined state.
  */
 static inline void list_del(struct list_head *entry)
 {
 	__list_del(entry->prev, entry->next);
-	entry->next = (void *) 0;
-	entry->prev = (void *) 0;
+	entry->next = LIST_POISON1;
+	entry->prev = LIST_POISON2;
+}
+
+/**
+ * list_replace - replace old entry by new one
+ * @old : the element to be replaced
+ * @new : the new element to insert
+ *
+ * If @old was empty, it will be overwritten.
+ */
+static inline void list_replace(struct list_head *old,
+				struct list_head *new)
+{
+	new->next = old->next;
+	new->next->prev = new;
+	new->prev = old->prev;
+	new->prev->next = new;
+}
+
+static inline void list_replace_init(struct list_head *old,
+					struct list_head *new)
+{
+	list_replace(old, new);
+	INIT_LIST_HEAD(old);
 }
 
 /**
@@ -130,37 +159,129 @@ static inline void list_move_tail(struct list_head *list,
 }
 
 /**
+ * list_is_last - tests whether @list is the last entry in list @head
+ * @list: the entry to test
+ * @head: the head of the list
+ */
+static inline int list_is_last(const struct list_head *list,
+				const struct list_head *head)
+{
+	return list->next == head;
+}
+
+/**
  * list_empty - tests whether a list is empty
  * @head: the list to test.
  */
-static inline int list_empty(struct list_head *head)
+static inline int list_empty(const struct list_head *head)
 {
 	return head->next == head;
 }
 
-static inline void __list_splice(struct list_head *list,
-				 struct list_head *head)
+/**
+ * list_empty_careful - tests whether a list is empty and not being modified
+ * @head: the list to test
+ *
+ * Description:
+ * tests whether a list is empty _and_ checks that no other CPU might be
+ * in the process of modifying either member (next or prev)
+ *
+ * NOTE: using list_empty_careful() without synchronization
+ * can only be safe if the only activity that can happen
+ * to the list entry is list_del_init(). Eg. it cannot be used
+ * if another CPU could re-list_add() it.
+ */
+static inline int list_empty_careful(const struct list_head *head)
+{
+	struct list_head *next = head->next;
+	return (next == head) && (next == head->prev);
+}
+
+/**
+ * list_is_singular - tests whether a list has just one entry.
+ * @head: the list to test.
+ */
+static inline int list_is_singular(const struct list_head *head)
+{
+	return !list_empty(head) && (head->next == head->prev);
+}
+
+static inline void __list_cut_position(struct list_head *list,
+		struct list_head *head, struct list_head *entry)
+{
+	struct list_head *new_first = entry->next;
+	list->next = head->next;
+	list->next->prev = list;
+	list->prev = entry;
+	entry->next = list;
+	head->next = new_first;
+	new_first->prev = head;
+}
+
+/**
+ * list_cut_position - cut a list into two
+ * @list: a new list to add all removed entries
+ * @head: a list with entries
+ * @entry: an entry within head, could be the head itself
+ *	and if so we won't cut the list
+ *
+ * This helper moves the initial part of @head, up to and
+ * including @entry, from @head to @list. You should
+ * pass on @entry an element you know is on @head. @list
+ * should be an empty list or a list you do not care about
+ * losing its data.
+ *
+ */
+static inline void list_cut_position(struct list_head *list,
+		struct list_head *head, struct list_head *entry)
+{
+	if (list_empty(head))
+		return;
+	if (list_is_singular(head) &&
+		(head->next != entry && head != entry))
+		return;
+	if (entry == head)
+		INIT_LIST_HEAD(list);
+	else
+		__list_cut_position(list, head, entry);
+}
+
+static inline void __list_splice(const struct list_head *list,
+				 struct list_head *prev,
+				 struct list_head *next)
 {
 	struct list_head *first = list->next;
 	struct list_head *last = list->prev;
-	struct list_head *at = head->next;
 
-	first->prev = head;
-	head->next = first;
+	first->prev = prev;
+	prev->next = first;
 
-	last->next = at;
-	at->prev = last;
+	last->next = next;
+	next->prev = last;
 }
 
 /**
- * list_splice - join two lists
+ * list_splice - join two lists, this is designed for stacks
  * @list: the new list to add.
  * @head: the place to add it in the first list.
  */
-static inline void list_splice(struct list_head *list, struct list_head *head)
+static inline void list_splice(const struct list_head *list,
+				struct list_head *head)
 {
 	if (!list_empty(list))
-		__list_splice(list, head);
+		__list_splice(list, head, head->next);
+}
+
+/**
+ * list_splice_tail - join two lists, each list being a queue
+ * @list: the new list to add.
+ * @head: the place to add it in the first list.
+ */
+static inline void list_splice_tail(struct list_head *list,
+				struct list_head *head)
+{
+	if (!list_empty(list))
+		__list_splice(list, head->prev, head);
 }
 
 /**
@@ -174,7 +295,24 @@ static inline void list_splice_init(struct list_head *list,
 				    struct list_head *head)
 {
 	if (!list_empty(list)) {
-		__list_splice(list, head);
+		__list_splice(list, head, head->next);
+		INIT_LIST_HEAD(list);
+	}
+}
+
+/**
+ * list_splice_tail_init - join two lists and reinitialise the emptied list
+ * @list: the new list to add.
+ * @head: the place to add it in the first list.
+ *
+ * Each of the lists is a queue.
+ * The list at @list is reinitialised
+ */
+static inline void list_splice_tail_init(struct list_head *list,
+					 struct list_head *head)
+{
+	if (!list_empty(list)) {
+		__list_splice(list, head->prev, head);
 		INIT_LIST_HEAD(list);
 	}
 }
@@ -186,28 +324,53 @@ static inline void list_splice_init(struct list_head *list,
  * @member:	the name of the list_struct within the struct.
  */
 #define list_entry(ptr, type, member) \
-	((type *)((char *)(ptr)-(unsigned long)(&((type *)0)->member)))
+	container_of(ptr, type, member)
+
+/**
+ * list_first_entry - get the first element from a list
+ * @ptr:	the list head to take the element from.
+ * @type:	the type of the struct this is embedded in.
+ * @member:	the name of the list_struct within the struct.
+ *
+ * Note, that list is expected to be not empty.
+ */
+#define list_first_entry(ptr, type, member) \
+	list_entry((ptr)->next, type, member)
 
 /**
  * list_for_each	-	iterate over a list
- * @pos:	the &struct list_head to use as a loop counter.
+ * @pos:	the &struct list_head to use as a loop cursor.
  * @head:	the head for your list.
  */
 #define list_for_each(pos, head) \
-	for (pos = (head)->next, prefetch(pos->next); pos != (head); \
-		pos = pos->next, prefetch(pos->next))
+	for (pos = (head)->next; prefetch(pos->next), pos != (head); \
+        	pos = pos->next)
+
+/**
+ * __list_for_each	-	iterate over a list
+ * @pos:	the &struct list_head to use as a loop cursor.
+ * @head:	the head for your list.
+ *
+ * This variant differs from list_for_each() in that it's the
+ * simplest possible list iteration code, no prefetching is done.
+ * Use this for code that knows the list to be very short (empty
+ * or 1 entry) most of the time.
+ */
+#define __list_for_each(pos, head) \
+	for (pos = (head)->next; pos != (head); pos = pos->next)
+
 /**
  * list_for_each_prev	-	iterate over a list backwards
- * @pos:	the &struct list_head to use as a loop counter.
+ * @pos:	the &struct list_head to use as a loop cursor.
  * @head:	the head for your list.
  */
 #define list_for_each_prev(pos, head) \
-	for (pos = (head)->prev, prefetch(pos->prev); pos != (head); \
-		pos = pos->prev, prefetch(pos->prev))
+	for (pos = (head)->prev; prefetch(pos->prev), pos != (head); \
+        	pos = pos->prev)
 
 /**
- * list_for_each_safe	-	iterate over a list safe against removal of list entry
- * @pos:	the &struct list_head to use as a loop counter.
+ * list_for_each_safe - iterate over a list safe against removal of list entry
+ * @pos:	the &struct list_head to use as a loop cursor.
  * @n:		another &struct list_head to use as temporary storage
  * @head:	the head for your list.
  */
@@ -216,43 +379,296 @@ static inline void list_splice_init(struct list_head *list,
 		pos = n, n = pos->next)
 
 /**
+ * list_for_each_prev_safe - iterate over a list backwards safe against removal of list entry
+ * @pos:	the &struct list_head to use as a loop cursor.
+ * @n:		another &struct list_head to use as temporary storage
+ * @head:	the head for your list.
+ */
+#define list_for_each_prev_safe(pos, n, head) \
+	for (pos = (head)->prev, n = pos->prev; \
+	     prefetch(pos->prev), pos != (head); \
+	     pos = n, n = pos->prev)
+
+/**
  * list_for_each_entry	-	iterate over list of given type
- * @pos:	the type * to use as a loop counter.
+ * @pos:	the type * to use as a loop cursor.
  * @head:	the head for your list.
  * @member:	the name of the list_struct within the struct.
  */
 #define list_for_each_entry(pos, head, member)				\
-	for (pos = list_entry((head)->next, typeof(*pos), member),	\
-		     prefetch(pos->member.next);			\
-	     &pos->member != (head);					\
-	     pos = list_entry(pos->member.next, typeof(*pos), member),	\
-		     prefetch(pos->member.next))
+	for (pos = list_entry((head)->next, typeof(*pos), member);	\
+	     prefetch(pos->member.next), &pos->member != (head); 	\
+	     pos = list_entry(pos->member.next, typeof(*pos), member))
+
+/**
+ * list_for_each_entry_reverse - iterate backwards over list of given type.
+ * @pos:	the type * to use as a loop cursor.
+ * @head:	the head for your list.
+ * @member:	the name of the list_struct within the struct.
+ */
+#define list_for_each_entry_reverse(pos, head, member)			\
+	for (pos = list_entry((head)->prev, typeof(*pos), member);	\
+	     prefetch(pos->member.prev), &pos->member != (head); 	\
+	     pos = list_entry(pos->member.prev, typeof(*pos), member))
+
+/**
+ * list_prepare_entry - prepare a pos entry for use in list_for_each_entry_continue()
+ * @pos:	the type * to use as a start point
+ * @head:	the head of the list
+ * @member:	the name of the list_struct within the struct.
+ *
+ * Prepares a pos entry for use as a start point in list_for_each_entry_continue().
+ */
+#define list_prepare_entry(pos, head, member) \
+	((pos) ? : list_entry(head, typeof(*pos), member))
+
+/**
+ * list_for_each_entry_continue - continue iteration over list of given type
+ * @pos:	the type * to use as a loop cursor.
+ * @head:	the head for your list.
+ * @member:	the name of the list_struct within the struct.
+ *
+ * Continue to iterate over list of given type, continuing after
+ * the current position.
+ */
+#define list_for_each_entry_continue(pos, head, member) 		\
+	for (pos = list_entry(pos->member.next, typeof(*pos), member);	\
+	     prefetch(pos->member.next), &pos->member != (head);	\
+	     pos = list_entry(pos->member.next, typeof(*pos), member))
+
+/**
+ * list_for_each_entry_continue_reverse - iterate backwards from the given point
+ * @pos:	the type * to use as a loop cursor.
+ * @head:	the head for your list.
+ * @member:	the name of the list_struct within the struct.
+ *
+ * Start to iterate over list of given type backwards, continuing after
+ * the current position.
+ */
+#define list_for_each_entry_continue_reverse(pos, head, member)		\
+	for (pos = list_entry(pos->member.prev, typeof(*pos), member);	\
+	     prefetch(pos->member.prev), &pos->member != (head);	\
+	     pos = list_entry(pos->member.prev, typeof(*pos), member))
+
+/**
+ * list_for_each_entry_from - iterate over list of given type from the current point
+ * @pos:	the type * to use as a loop cursor.
+ * @head:	the head for your list.
+ * @member:	the name of the list_struct within the struct.
+ *
+ * Iterate over list of given type, continuing from current position.
+ */
+#define list_for_each_entry_from(pos, head, member) 			\
+	for (; prefetch(pos->member.next), &pos->member != (head);	\
+	     pos = list_entry(pos->member.next, typeof(*pos), member))
 
 /**
  * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry
- * @pos:	the type * to use as a loop counter.
+ * @pos:	the type * to use as a loop cursor.
  * @n:		another type * to use as temporary storage
  * @head:	the head for your list.
  * @member:	the name of the list_struct within the struct.
  */
 #define list_for_each_entry_safe(pos, n, head, member)			\
 	for (pos = list_entry((head)->next, typeof(*pos), member),	\
-		n = list_entry(pos->member.next, typeof(*pos), member); \
-	     &pos->member != (head);					\
+		n = list_entry(pos->member.next, typeof(*pos), member);	\
+	     &pos->member != (head); 					\
 	     pos = n, n = list_entry(n->member.next, typeof(*n), member))
 
 /**
- * list_for_each_entry_continue -	iterate over list of given type
- *			continuing after existing point
- * @pos:	the type * to use as a loop counter.
+ * list_for_each_entry_safe_continue
+ * @pos:	the type * to use as a loop cursor.
+ * @n:		another type * to use as temporary storage
  * @head:	the head for your list.
  * @member:	the name of the list_struct within the struct.
+ *
+ * Iterate over list of given type, continuing after current point,
+ * safe against removal of list entry.
+ */
+#define list_for_each_entry_safe_continue(pos, n, head, member) 		\
+	for (pos = list_entry(pos->member.next, typeof(*pos), member), 		\
+		n = list_entry(pos->member.next, typeof(*pos), member);		\
+	     &pos->member != (head);						\
+	     pos = n, n = list_entry(n->member.next, typeof(*n), member))
+
+/**
+ * list_for_each_entry_safe_from
+ * @pos:	the type * to use as a loop cursor.
+ * @n:		another type * to use as temporary storage
+ * @head:	the head for your list.
+ * @member:	the name of the list_struct within the struct.
+ *
+ * Iterate over list of given type from current point, safe against
+ * removal of list entry.
+ */
+#define list_for_each_entry_safe_from(pos, n, head, member) 			\
+	for (n = list_entry(pos->member.next, typeof(*pos), member);		\
+	     &pos->member != (head);						\
+	     pos = n, n = list_entry(n->member.next, typeof(*n), member))
+
+/**
+ * list_for_each_entry_safe_reverse
+ * @pos:	the type * to use as a loop cursor.
+ * @n:		another type * to use as temporary storage
+ * @head:	the head for your list.
+ * @member:	the name of the list_struct within the struct.
+ *
+ * Iterate backwards over list of given type, safe against removal
+ * of list entry.
+ */
+#define list_for_each_entry_safe_reverse(pos, n, head, member)		\
+	for (pos = list_entry((head)->prev, typeof(*pos), member),	\
+		n = list_entry(pos->member.prev, typeof(*pos), member);	\
+	     &pos->member != (head); 					\
+	     pos = n, n = list_entry(n->member.prev, typeof(*n), member))
+
+/*
+ * Double linked lists with a single pointer list head.
+ * Mostly useful for hash tables where the two pointer list head is
+ * too wasteful.
+ * You lose the ability to access the tail in O(1).
+ */
+
+struct hlist_head {
+	struct hlist_node *first;
+};
+
+struct hlist_node {
+	struct hlist_node *next, **pprev;
+};
+
+#define HLIST_HEAD_INIT { .first = NULL }
+#define HLIST_HEAD(name) struct hlist_head name = {  .first = NULL }
+#define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL)
+static inline void INIT_HLIST_NODE(struct hlist_node *h)
+{
+	h->next = NULL;
+	h->pprev = NULL;
+}
+
+static inline int hlist_unhashed(const struct hlist_node *h)
+{
+	return !h->pprev;
+}
+
+static inline int hlist_empty(const struct hlist_head *h)
+{
+	return !h->first;
+}
+
+static inline void __hlist_del(struct hlist_node *n)
+{
+	struct hlist_node *next = n->next;
+	struct hlist_node **pprev = n->pprev;
+	*pprev = next;
+	if (next)
+		next->pprev = pprev;
+}
+
+static inline void hlist_del(struct hlist_node *n)
+{
+	__hlist_del(n);
+	n->next = LIST_POISON1;
+	n->pprev = LIST_POISON2;
+}
+
+static inline void hlist_del_init(struct hlist_node *n)
+{
+	if (!hlist_unhashed(n)) {
+		__hlist_del(n);
+		INIT_HLIST_NODE(n);
+	}
+}
+
+static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h)
+{
+	struct hlist_node *first = h->first;
+	n->next = first;
+	if (first)
+		first->pprev = &n->next;
+	h->first = n;
+	n->pprev = &h->first;
+}
+
+/* next must be != NULL */
+static inline void hlist_add_before(struct hlist_node *n,
+					struct hlist_node *next)
+{
+	n->pprev = next->pprev;
+	n->next = next;
+	next->pprev = &n->next;
+	*(n->pprev) = n;
+}
+
+static inline void hlist_add_after(struct hlist_node *n,
+					struct hlist_node *next)
+{
+	next->next = n->next;
+	n->next = next;
+	next->pprev = &n->next;
+
+	if(next->next)
+		next->next->pprev  = &next->next;
+}
+
+#define hlist_entry(ptr, type, member) container_of(ptr,type,member)
+
+#define hlist_for_each(pos, head) \
+	for (pos = (head)->first; pos && ({ prefetch(pos->next); 1; }); \
+	     pos = pos->next)
+
+#define hlist_for_each_safe(pos, n, head) \
+	for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \
+	     pos = n)
+
+/**
+ * hlist_for_each_entry	- iterate over list of given type
+ * @tpos:	the type * to use as a loop cursor.
+ * @pos:	the &struct hlist_node to use as a loop cursor.
+ * @head:	the head for your list.
+ * @member:	the name of the hlist_node within the struct.
+ */
+#define hlist_for_each_entry(tpos, pos, head, member)			 \
+	for (pos = (head)->first;					 \
+	     pos && ({ prefetch(pos->next); 1;}) &&			 \
+		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
+	     pos = pos->next)
+
+/**
+ * hlist_for_each_entry_continue - iterate over a hlist continuing after current point
+ * @tpos:	the type * to use as a loop cursor.
+ * @pos:	the &struct hlist_node to use as a loop cursor.
+ * @member:	the name of the hlist_node within the struct.
+ */
+#define hlist_for_each_entry_continue(tpos, pos, member)		 \
+	for (pos = (pos)->next;						 \
+	     pos && ({ prefetch(pos->next); 1;}) &&			 \
+		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
+	     pos = pos->next)
+
+/**
+ * hlist_for_each_entry_from - iterate over a hlist continuing from current point
+ * @tpos:	the type * to use as a loop cursor.
+ * @pos:	the &struct hlist_node to use as a loop cursor.
+ * @member:	the name of the hlist_node within the struct.
+ */
+#define hlist_for_each_entry_from(tpos, pos, member)			 \
+	for (; pos && ({ prefetch(pos->next); 1;}) &&			 \
+		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
+	     pos = pos->next)
+
+/**
+ * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry
+ * @tpos:	the type * to use as a loop cursor.
+ * @pos:	the &struct hlist_node to use as a loop cursor.
+ * @n:		another &struct hlist_node to use as temporary storage
+ * @head:	the head for your list.
+ * @member:	the name of the hlist_node within the struct.
  */
-#define list_for_each_entry_continue(pos, head, member)			\
-	for (pos = list_entry(pos->member.next, typeof(*pos), member),	\
-		     prefetch(pos->member.next);			\
-	     &pos->member != (head);					\
-	     pos = list_entry(pos->member.next, typeof(*pos), member),	\
-		     prefetch(pos->member.next))
+#define hlist_for_each_entry_safe(tpos, pos, n, head, member) 		 \
+	for (pos = (head)->first;					 \
+	     pos && ({ n = pos->next; 1; }) && 				 \
+		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \
+	     pos = n)
 
 #endif
include/linux/poison.h new file +11 -0
new file mode 100644
index 0000000..b3d873b
@@ -0,0 +1,11 @@
+#ifndef _LINUX_POISON_H
+#define _LINUX_POISON_H
+
+/********** include/linux/list.h **********/
+/*
+ * used to verify that nobody uses non-initialized list entries.
+ */
+#define LIST_POISON1  ((void *) 0x0)
+#define LIST_POISON2  ((void *) 0x0)
+
+#endif
Signature · 1 line
1.5.6.3
#41 lore raw

[U-Boot] Makefile Pull Request

In reply to Jean-Christophe PLAGNIOL-VILLARD

Dear Jean-Christophe PLAGNIOL-VILLARD,

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

The following changes since commit 33aa4eac66b71c797bbc13b3afe432a2132947d4:
Wolfgang Denk (1):
Merge branch 'master' of /home/wd/git/u-boot/custodians

are available in the git repository at:

git://git.denx.de/u-boot-arm.git Makefile

Jean-Christophe PLAGNIOL-VILLARD (12):
gunzip: move to lib_generic
soft_i2c: move to drivers/i2c
soft_spi: move to drivers/spi
miiphybb: move to drivers/net/phy
crc16: move to lib_generic
autoscript: Move conditional compilation to Makefile
miiphyutil: Move conditional compilation to Makefile common/Makefile: order by functionality
cmd_terminal: remove no need ifdef
update linux/list
devices: merge to list_head
fs: Move conditional compilation to Makefile

 Makefile                               |    1 +
 common/Makefile                        |   79 ++--
 common/cmd_autoscript.c                |    4 -
 common/cmd_console.c                   |    9 +-
 common/cmd_terminal.c                  |   14 +-
 common/console.c                       |   62 ++--
 common/devices.c                       |   79 ++--
 common/lists.c                         |  734 --------------------------------
 common/miiphyutil.c                    |    2 -
 common/usb_kbd.c                       |   14 +-
 drivers/i2c/Makefile                   |    1 +
 {common => drivers/i2c}/soft_i2c.c     |    0 
 drivers/net/phy/Makefile               |   46 ++
 {common => drivers/net/phy}/miiphybb.c |    0 
 drivers/spi/Makefile                   |    3 +-
 {common => drivers/spi}/soft_spi.c     |    0 
 fs/Makefile                            |   10 +-
 fs/cramfs/Makefile                     |    7 +-
 fs/cramfs/cramfs.c                     |    5 -
 fs/cramfs/uncompress.c                 |    4 -
 fs/ext2/Makefile                       |    6 +-
 fs/ext2/dev.c                          |    3 -
 fs/ext2/ext2fs.c                       |    4 -
 fs/fat/Makefile                        |    6 +-
 fs/fat/fat.c                           |    4 -
 fs/fat/file.c                          |    4 -
 fs/fdos/Makefile                       |    6 +-
 fs/fdos/dev.c                          |    5 -
 fs/fdos/fat.c                          |    4 -
 fs/fdos/fdos.c                         |    5 +-
 fs/fdos/fs.c                           |    4 -
 fs/fdos/subdir.c                       |    3 -
 fs/fdos/vfat.c                         |    5 -
 fs/jffs2/Makefile                      |    8 +-
 fs/jffs2/compr_lzari.c                 |    3 -
 fs/jffs2/compr_lzo.c                   |    4 -
 fs/jffs2/compr_rtime.c                 |    4 -
 fs/jffs2/compr_rubin.c                 |    4 -
 fs/jffs2/compr_zlib.c                  |    4 -
 fs/jffs2/jffs2_1pass.c                 |    5 -
 fs/jffs2/jffs2_nand_1pass.c            |    2 +-
 fs/jffs2/mini_inflate.c                |    5 -
 fs/reiserfs/Makefile                   |    6 +-
 fs/reiserfs/dev.c                      |    4 -
 fs/reiserfs/mode_string.c              |    3 -
 fs/reiserfs/reiserfs.c                 |    4 -
 include/devices.h                      |    8 +-
 include/linux/list.h                   |  506 ++++++++++++++++++++--
 include/linux/poison.h                 |   11 +
 include/lists.h                        |   77 ----
 lib_generic/Makefile                   |    2 +
 {common => lib_generic}/crc16.c        |    0 
 {common => lib_generic}/gunzip.c       |    0 
 53 files changed, 682 insertions(+), 1111 deletions(-)
 delete mode 100644 common/lists.c
Quoted 8 lines
 rename {common => drivers/i2c}/soft_i2c.c (100%)
 create mode 100644 drivers/net/phy/Makefile
 rename {common => drivers/net/phy}/miiphybb.c (100%)
 rename {common => drivers/spi}/soft_spi.c (100%)
 create mode 100644 include/linux/poison.h
 delete mode 100644 include/lists.h
 rename {common => lib_generic}/crc16.c (100%)
 rename {common => lib_generic}/gunzip.c (100%)

Done, 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
Your own mileage may vary.