Merge tag 'dm-pull-29oct19' of git://git.denx.de/u-boot-dm
authorTom Rini <trini@konsulko.com>
Fri, 1 Nov 2019 13:34:35 +0000 (09:34 -0400)
committerTom Rini <trini@konsulko.com>
Fri, 1 Nov 2019 13:34:35 +0000 (09:34 -0400)
- Fix for patman with email addresses containing commas
- Bootstage improvements for TPL, SPL
- Various sandbox and dm improvements and fixes

21 files changed:
arch/sandbox/cpu/cpu.c
arch/sandbox/include/asm/io.h
arch/sandbox/include/asm/test.h
common/board_f.c
common/board_r.c
common/bootstage.c
common/fdt_support.c
common/spl/spl.c
drivers/core/ofnode.c
drivers/core/regmap.c
drivers/core/uclass.c
include/bootstage.h
include/linux/libfdt_env.h
include/regmap.h
include/test/ut.h
lib/fdtdec.c
lib/tiny-printf.c
test/dm/regmap.c
tools/patman/func_test.py
tools/patman/patman.py
tools/patman/series.py

index 2046cb53c4ae6cc4008d29e5e23371996d2a0e40..f3af88d79e9d8fca34cb64a9926e8363b3603059 100644 (file)
@@ -246,8 +246,7 @@ unsigned int sandbox_read(const void *addr, enum sandboxio_size_t size)
        return 0;
 }
 
-void sandbox_write(const void *addr, unsigned int val,
-                  enum sandboxio_size_t size)
+void sandbox_write(void *addr, unsigned int val, enum sandboxio_size_t size)
 {
        struct sandbox_state *state = state_get_current();
 
index 4a35c419723edbeb9aff2e4a926c2fe636960a8a..ad6c29a4e26c982f3ca234beb891a3bef5a858da 100644 (file)
@@ -46,8 +46,7 @@ static inline void unmap_sysmem(const void *vaddr)
 phys_addr_t map_to_sysmem(const void *ptr);
 
 unsigned int sandbox_read(const void *addr, enum sandboxio_size_t size);
-void sandbox_write(const void *addr, unsigned int val,
-                  enum sandboxio_size_t size);
+void sandbox_write(void *addr, unsigned int val, enum sandboxio_size_t size);
 
 #define readb(addr) sandbox_read((const void *)addr, SB_SIZE_8)
 #define readw(addr) sandbox_read((const void *)addr, SB_SIZE_16)
@@ -55,11 +54,11 @@ void sandbox_write(const void *addr, unsigned int val,
 #ifdef CONFIG_SANDBOX64
 #define readq(addr) sandbox_read((const void *)addr, SB_SIZE_64)
 #endif
-#define writeb(v, addr) sandbox_write((const void *)addr, v, SB_SIZE_8)
-#define writew(v, addr) sandbox_write((const void *)addr, v, SB_SIZE_16)
-#define writel(v, addr) sandbox_write((const void *)addr, v, SB_SIZE_32)
+#define writeb(v, addr) sandbox_write((void *)addr, v, SB_SIZE_8)
+#define writew(v, addr) sandbox_write((void *)addr, v, SB_SIZE_16)
+#define writel(v, addr) sandbox_write((void *)addr, v, SB_SIZE_32)
 #ifdef CONFIG_SANDBOX64
-#define writeq(v, addr) sandbox_write((const void *)addr, v, SB_SIZE_64)
+#define writeq(v, addr) sandbox_write((void *)addr, v, SB_SIZE_64)
 #endif
 
 /*
index cd2b9e3155d73adb1a38c3191cb00477f22c2f7c..b885e1a14f19f803e18b6344a025d25d0609001f 100644 (file)
@@ -213,4 +213,15 @@ int sandbox_get_pci_ep_irq_count(struct udevice *dev);
  */
 uint sandbox_pci_read_bar(u32 barval, int type, uint size);
 
+/**
+ * sandbox_set_enable_memio() - Enable readl/writel() for sandbox
+ *
+ * Normally these I/O functions do nothing with sandbox. Certain tests need them
+ * to work as for other architectures, so this function can be used to enable
+ * them.
+ *
+ * @enable: true to enable, false to disable
+ */
+void sandbox_set_enable_memio(bool enable);
+
 #endif
index 591f18f391e22e7ae515c265de050e63f5d7e156..e3591cbaebdbf48aa9fd65ddafdd26c1a167b530 100644 (file)
@@ -588,6 +588,7 @@ static int reserve_stacks(void)
 static int reserve_bloblist(void)
 {
 #ifdef CONFIG_BLOBLIST
+       gd->start_addr_sp &= ~0xf;
        gd->start_addr_sp -= CONFIG_BLOBLIST_SIZE;
        gd->new_bloblist = map_sysmem(gd->start_addr_sp, CONFIG_BLOBLIST_SIZE);
 #endif
@@ -695,6 +696,7 @@ static int reloc_bootstage(void)
                      gd->bootstage, gd->new_bootstage, size);
                memcpy(gd->new_bootstage, gd->bootstage, size);
                gd->bootstage = gd->new_bootstage;
+               bootstage_relocate();
        }
 #endif
 
index d6fb5047a26511cc0cf997664e9f9a387dee1ee3..c1ecb06b743d26403a02923f70431133839dac95 100644 (file)
@@ -670,7 +670,6 @@ static init_fnc_t init_sequence_r[] = {
 #ifdef CONFIG_SYS_NONCACHED_MEMORY
        initr_noncached,
 #endif
-       bootstage_relocate,
 #ifdef CONFIG_OF_LIVE
        initr_of_live,
 #endif
index 56ef91ad85995dde2addef0be43694e4ed3813f6..e8b7bbf81a6d1b30feaf6d7986f9603f82932671 100644 (file)
  */
 
 #include <common.h>
-#include <linux/libfdt.h>
 #include <malloc.h>
+#include <spl.h>
 #include <linux/compiler.h>
+#include <linux/libfdt.h>
 
 DECLARE_GLOBAL_DATA_PTR;
 
@@ -41,24 +42,34 @@ enum {
 };
 
 struct bootstage_hdr {
-       uint32_t version;       /* BOOTSTAGE_VERSION */
-       uint32_t count;         /* Number of records */
-       uint32_t size;          /* Total data size (non-zero if valid) */
-       uint32_t magic;         /* Unused */
+       u32 version;            /* BOOTSTAGE_VERSION */
+       u32 count;              /* Number of records */
+       u32 size;               /* Total data size (non-zero if valid) */
+       u32 magic;              /* Magic number */
+       u32 next_id;            /* Next ID to use for bootstage */
 };
 
 int bootstage_relocate(void)
 {
        struct bootstage_data *data = gd->bootstage;
        int i;
+       char *ptr;
+
+       /* Figure out where to relocate the strings to */
+       ptr = (char *)(data + 1);
 
        /*
         * Duplicate all strings.  They may point to an old location in the
         * program .text section that can eventually get trashed.
         */
        debug("Relocating %d records\n", data->rec_count);
-       for (i = 0; i < data->rec_count; i++)
-               data->record[i].name = strdup(data->record[i].name);
+       for (i = 0; i < data->rec_count; i++) {
+               const char *from = data->record[i].name;
+
+               strcpy(ptr, from);
+               data->record[i].name = ptr;
+               ptr += strlen(ptr) + 1;
+       }
 
        return 0;
 }
@@ -372,7 +383,6 @@ int bootstage_stash(void *base, int size)
        const struct bootstage_record *rec;
        char buf[20];
        char *ptr = base, *end = ptr + size;
-       uint32_t count;
        int i;
 
        if (hdr + 1 > (struct bootstage_hdr *)end) {
@@ -383,21 +393,15 @@ int bootstage_stash(void *base, int size)
        /* Write an arbitrary version number */
        hdr->version = BOOTSTAGE_VERSION;
 
-       /* Count the number of records, and write that value first */
-       for (rec = data->record, i = count = 0; i < data->rec_count;
-            i++, rec++) {
-               if (rec->id != 0)
-                       count++;
-       }
-       hdr->count = count;
+       hdr->count = data->rec_count;
        hdr->size = 0;
        hdr->magic = BOOTSTAGE_MAGIC;
+       hdr->next_id = data->next_id;
        ptr += sizeof(*hdr);
 
        /* Write the records, silently stopping when we run out of space */
-       for (rec = data->record, i = 0; i < data->rec_count; i++, rec++) {
+       for (rec = data->record, i = 0; i < data->rec_count; i++, rec++)
                append_data(&ptr, end, rec, sizeof(*rec));
-       }
 
        /* Write the name strings */
        for (rec = data->record, i = 0; i < data->rec_count; i++, rec++) {
@@ -478,6 +482,8 @@ int bootstage_unstash(const void *base, int size)
        for (rec = data->record + data->next_id, i = 0; i < hdr->count;
             i++, rec++) {
                rec->name = ptr;
+               if (spl_phase() == PHASE_SPL)
+                       rec->name = strdup(ptr);
 
                /* Assume no data corruption here */
                ptr += strlen(ptr) + 1;
@@ -485,6 +491,7 @@ int bootstage_unstash(const void *base, int size)
 
        /* Mark the records as read */
        data->rec_count += hdr->count;
+       data->next_id = hdr->next_id;
        debug("Unstashed %d records\n", hdr->count);
 
        return 0;
@@ -492,7 +499,17 @@ int bootstage_unstash(const void *base, int size)
 
 int bootstage_get_size(void)
 {
-       return sizeof(struct bootstage_data);
+       struct bootstage_data *data = gd->bootstage;
+       struct bootstage_record *rec;
+       int size;
+       int i;
+
+       size = sizeof(struct bootstage_data);
+       for (rec = data->record, i = 0; i < data->rec_count;
+            i++, rec++)
+               size += strlen(rec->name) + 1;
+
+       return size;
 }
 
 int bootstage_init(bool first)
index baf7924ff6126ede18548c746e28defc65eca635..68343990395084f5fadea890a8d093682c49479f 100644 (file)
@@ -1566,7 +1566,7 @@ static int fdt_read_prop(const fdt32_t *prop, int prop_len, int cell_off,
                         uint64_t *val, int cells)
 {
        const fdt32_t *prop32 = &prop[cell_off];
-       const fdt64_t *prop64 = (const fdt64_t *)&prop[cell_off];
+       const unaligned_fdt64_t *prop64 = (const fdt64_t *)&prop[cell_off];
 
        if ((cell_off + cells) > prop_len)
                return -FDT_ERR_NOSPACE;
index a9d3e847af557c6205896e9ed6c0efa96ae4dadc..f1ad8dc9dabf668d750ed2f3e725ab71d26976a9 100644 (file)
@@ -18,6 +18,7 @@
 #include <version.h>
 #include <image.h>
 #include <malloc.h>
+#include <mapmem.h>
 #include <dm/root.h>
 #include <linux/compiler.h>
 #include <fdt_support.h>
@@ -396,13 +397,25 @@ static int spl_common_init(bool setup_malloc)
                gd->malloc_ptr = 0;
        }
 #endif
-       ret = bootstage_init(true);
+       ret = bootstage_init(u_boot_first_phase());
        if (ret) {
                debug("%s: Failed to set up bootstage: ret=%d\n", __func__,
                      ret);
                return ret;
        }
-       bootstage_mark_name(BOOTSTAGE_ID_START_SPL, "spl");
+#ifdef CONFIG_BOOTSTAGE_STASH
+       if (!u_boot_first_phase()) {
+               const void *stash = map_sysmem(CONFIG_BOOTSTAGE_STASH_ADDR,
+                                              CONFIG_BOOTSTAGE_STASH_SIZE);
+
+               ret = bootstage_unstash(stash, CONFIG_BOOTSTAGE_STASH_SIZE);
+               if (ret)
+                       debug("%s: Failed to unstash bootstage: ret=%d\n",
+                             __func__, ret);
+       }
+#endif /* CONFIG_BOOTSTAGE_STASH */
+       bootstage_mark_name(spl_phase() == PHASE_TPL ? BOOTSTAGE_ID_START_TPL :
+                           BOOTSTAGE_ID_START_SPL, SPL_TPL_NAME);
 #if CONFIG_IS_ENABLED(LOG)
        ret = log_init();
        if (ret) {
@@ -418,7 +431,8 @@ static int spl_common_init(bool setup_malloc)
                }
        }
        if (CONFIG_IS_ENABLED(DM)) {
-               bootstage_start(BOOTSTATE_ID_ACCUM_DM_SPL, "dm_spl");
+               bootstage_start(BOOTSTATE_ID_ACCUM_DM_SPL,
+                               spl_phase() == PHASE_TPL ? "dm tpl" : "dm_spl");
                /* With CONFIG_SPL_OF_PLATDATA, bring in all devices */
                ret = dm_init_and_scan(!CONFIG_IS_ENABLED(OF_PLATDATA));
                bootstage_accum(BOOTSTATE_ID_ACCUM_DM_SPL);
@@ -704,8 +718,9 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
        debug("SPL malloc() used 0x%lx bytes (%ld KB)\n", gd->malloc_ptr,
              gd->malloc_ptr / 1024);
 #endif
+       bootstage_mark_name(spl_phase() == PHASE_TPL ? BOOTSTAGE_ID_END_TPL :
+                           BOOTSTAGE_ID_END_SPL, "end " SPL_TPL_NAME);
 #ifdef CONFIG_BOOTSTAGE_STASH
-       bootstage_mark_name(BOOTSTAGE_ID_END_SPL, "end_spl");
        ret = bootstage_stash((void *)CONFIG_BOOTSTAGE_STASH_ADDR,
                              CONFIG_BOOTSTAGE_STASH_SIZE);
        if (ret)
index 297f0a0c7cc142880b41539e979b081972e16f16..8f0eab2ca6241856c0c958fe546c73b9043add29 100644 (file)
@@ -57,7 +57,7 @@ int ofnode_read_s32_default(ofnode node, const char *propname, s32 def)
 
 int ofnode_read_u64(ofnode node, const char *propname, u64 *outp)
 {
-       const fdt64_t *cell;
+       const unaligned_fdt64_t *cell;
        int len;
 
        assert(ofnode_valid(node));
index d1d12eef385f5757bd327cb01d2027bbe3bfb662..e9e55c9d165cb8ed2f5999b8928060d8f49c72b2 100644 (file)
@@ -462,5 +462,5 @@ int regmap_update_bits(struct regmap *map, uint offset, uint mask, uint val)
 
        reg &= ~mask;
 
-       return regmap_write(map, offset, reg | val);
+       return regmap_write(map, offset, reg | (val & mask));
 }
index 36f4d1c289d0e9f3e37453b725ad05537f10b920..c520ef113a2a3fbc8f155e19a763d579e601dbd5 100644 (file)
@@ -6,6 +6,8 @@
  * Pavel Herrmann <morpheus.ibis@gmail.com>
  */
 
+#define LOG_CATEGORY LOGC_DM
+
 #include <common.h>
 #include <dm.h>
 #include <errno.h>
@@ -303,7 +305,7 @@ int uclass_find_device_by_seq(enum uclass_id id, int seq_or_req_seq,
        int ret;
 
        *devp = NULL;
-       debug("%s: %d %d\n", __func__, find_req_seq, seq_or_req_seq);
+       log_debug("%d %d\n", find_req_seq, seq_or_req_seq);
        if (seq_or_req_seq == -1)
                return -ENODEV;
        ret = uclass_get(id, &uc);
@@ -311,15 +313,16 @@ int uclass_find_device_by_seq(enum uclass_id id, int seq_or_req_seq,
                return ret;
 
        uclass_foreach_dev(dev, uc) {
-               debug("   - %d %d '%s'\n", dev->req_seq, dev->seq, dev->name);
+               log_debug("   - %d %d '%s'\n",
+                         dev->req_seq, dev->seq, dev->name);
                if ((find_req_seq ? dev->req_seq : dev->seq) ==
                                seq_or_req_seq) {
                        *devp = dev;
-                       debug("   - found\n");
+                       log_debug("   - found\n");
                        return 0;
                }
        }
-       debug("   - not found\n");
+       log_debug("   - not found\n");
 
        return -ENODEV;
 }
index 5e7e242b83475bafd964c9bf7545f23bcff546de..d105ae0181395da05bfe2d0f85bb8958a428f981 100644 (file)
@@ -170,6 +170,8 @@ enum bootstage_id {
         * rough boot timing information.
         */
        BOOTSTAGE_ID_AWAKE,
+       BOOTSTAGE_ID_START_TPL,
+       BOOTSTAGE_ID_END_TPL,
        BOOTSTAGE_ID_START_SPL,
        BOOTSTAGE_ID_END_SPL,
        BOOTSTAGE_ID_START_UBOOT_F,
index e2bf79c7ee8d63bf6bc29d6239b85a0487f5353a..e49fcd72bd60d3d54ab1314257c2e94ce2fbcc13 100644 (file)
@@ -16,6 +16,7 @@
 typedef __be16 fdt16_t;
 typedef __be32 fdt32_t;
 typedef __be64 fdt64_t;
+typedef __be64 unaligned_fdt64_t __aligned(4);
 
 #define fdt32_to_cpu(x) be32_to_cpu(x)
 #define cpu_to_fdt32(x) cpu_to_be32(x)
index 0854200a9c162811a96b47e3d14f6e0779b3121c..9ada1af5ef047acc5be4abf383aae8596ac6093a 100644 (file)
@@ -295,7 +295,8 @@ int regmap_raw_read_range(struct regmap *map, uint range_num, uint offset,
  * @map:       The map returned by regmap_init_mem*()
  * @offset:    Offset of the memory
  * @mask:      Mask to apply to the read value
- * @val:       Value to apply to the value to write
+ * @val:       Value to OR with the read value after masking. Note that any
+ *     bits set in @val which are not set in @mask are ignored
  * Return: 0 if OK, -ve on error
  */
 int regmap_update_bits(struct regmap *map, uint offset, uint mask, uint val);
index 19bcb8c3748d7002abf10adecfb966c350bebdc4..fbfde10719f90f14dd7d714d5bfaa51c7204c251 100644 (file)
@@ -61,7 +61,8 @@ void ut_failf(struct unit_test_state *uts, const char *fname, int line,
        if (val1 != val2) {                                             \
                ut_failf(uts, __FILE__, __LINE__, __func__,             \
                         #expr1 " == " #expr2,                          \
-                        "Expected %d, got %d", val1, val2);            \
+                        "Expected %#x (%d), got %#x (%d)", val1, val1, \
+                        val2, val2);                                   \
                return CMD_RET_FAILURE;                                 \
        }                                                               \
 }
index 17736ce66554e0ce56e317480e7b12b64e73b399..125d9dbf26395c2262b338c6bb7d77d0e7a08bcb 100644 (file)
@@ -242,7 +242,7 @@ int fdtdec_get_pci_bar32(struct udevice *dev, struct fdt_pci_addr *addr,
 uint64_t fdtdec_get_uint64(const void *blob, int node, const char *prop_name,
                           uint64_t default_val)
 {
-       const uint64_t *cell64;
+       const unaligned_fdt64_t *cell64;
        int length;
 
        cell64 = fdt_getprop(blob, node, prop_name, &length);
index 62e638196172023af19b8391cd4c686ebd2b2353..1138c7012aee50c4928f953c4d1d24852b659115 100644 (file)
@@ -157,7 +157,8 @@ static void ip4_addr_string(struct printf_info *info, u8 *addr)
  *       decimal).
  */
 
-static void pointer(struct printf_info *info, const char *fmt, void *ptr)
+static void __maybe_unused pointer(struct printf_info *info, const char *fmt,
+                                  void *ptr)
 {
 #ifdef DEBUG
        unsigned long num = (uintptr_t)ptr;
@@ -266,6 +267,21 @@ static int _vprintf(struct printf_info *info, const char *fmt, va_list va)
                                                div_out(info, &num, div);
                                }
                                break;
+                       case 'p':
+#ifdef DEBUG
+                               pointer(info, fmt, va_arg(va, void *));
+                               /*
+                                * Skip this because it pulls in _ctype which is
+                                * 256 bytes, and we don't generally implement
+                                * pointer anyway
+                                */
+                               while (isalnum(fmt[0]))
+                                       fmt++;
+                               break;
+#else
+                               islong = true;
+                               /* no break */
+#endif
                        case 'x':
                                if (islong) {
                                        num = va_arg(va, unsigned long);
@@ -287,11 +303,6 @@ static int _vprintf(struct printf_info *info, const char *fmt, va_list va)
                        case 's':
                                p = va_arg(va, char*);
                                break;
-                       case 'p':
-                               pointer(info, fmt, va_arg(va, void *));
-                               while (isalnum(fmt[0]))
-                                       fmt++;
-                               break;
                        case '%':
                                out(info, '%');
                        default:
@@ -398,3 +409,9 @@ int snprintf(char *buf, size_t size, const char *fmt, ...)
 
        return ret;
 }
+
+void print_grouped_ull(unsigned long long int_val, int digits)
+{
+       /* Don't try to print the upper 32-bits */
+       printf("%ld ", (ulong)int_val);
+}
index 82de295cb8f651940876d58867f1423b4fd436fc..6fd1f20656bc4df3b6136aaeffbf5cb7b251e09a 100644 (file)
@@ -99,18 +99,27 @@ static int dm_test_regmap_rw(struct unit_test_state *uts)
        struct regmap *map;
        uint reg;
 
+       sandbox_set_enable_memio(true);
        ut_assertok(uclass_get_device(UCLASS_SYSCON, 0, &dev));
        map = syscon_get_regmap(dev);
        ut_assertok_ptr(map);
 
        ut_assertok(regmap_write(map, 0, 0xcacafafa));
-       ut_assertok(regmap_write(map, 3, 0x55aa2211));
+       ut_assertok(regmap_write(map, 5, 0x55aa2211));
 
        ut_assertok(regmap_read(map, 0, &reg));
-       ut_assertok(regmap_read(map, 3, &reg));
+       ut_asserteq(0xcacafafa, reg);
+       ut_assertok(regmap_read(map, 5, &reg));
+       ut_asserteq(0x55aa2211, reg);
 
+       ut_assertok(regmap_read(map, 0, &reg));
+       ut_asserteq(0xcacafafa, reg);
        ut_assertok(regmap_update_bits(map, 0, 0xff00ff00, 0x55aa2211));
-       ut_assertok(regmap_update_bits(map, 3, 0x00ff00ff, 0xcacafada));
+       ut_assertok(regmap_read(map, 0, &reg));
+       ut_asserteq(0x55ca22fa, reg);
+       ut_assertok(regmap_update_bits(map, 5, 0x00ff00ff, 0xcacafada));
+       ut_assertok(regmap_read(map, 5, &reg));
+       ut_asserteq(0x55ca22da, reg);
 
        return 0;
 }
@@ -130,6 +139,7 @@ static int dm_test_regmap_getset(struct unit_test_state *uts)
                u32 val3;
        };
 
+       sandbox_set_enable_memio(true);
        ut_assertok(uclass_get_device(UCLASS_SYSCON, 0, &dev));
        map = syscon_get_regmap(dev);
        ut_assertok_ptr(map);
@@ -138,7 +148,9 @@ static int dm_test_regmap_getset(struct unit_test_state *uts)
        regmap_set(map, struct layout, val3, 0x55aa2211);
 
        ut_assertok(regmap_get(map, struct layout, val0, &reg));
+       ut_asserteq(0xcacafafa, reg);
        ut_assertok(regmap_get(map, struct layout, val3, &reg));
+       ut_asserteq(0x55aa2211, reg);
 
        return 0;
 }
@@ -159,6 +171,7 @@ static int dm_test_regmap_poll(struct unit_test_state *uts)
 
        start = get_timer(0);
 
+       ut_assertok(regmap_write(map, 0, 0x0));
        ut_asserteq(-ETIMEDOUT,
                    regmap_read_poll_timeout_test(map, 0, reg,
                                                  (reg == 0xcacafafa),
index 50a2741439eafa819678845efbbb1adb5aa367c0..2321f9e028be7623469fc179035c873d27e21f34 100644 (file)
@@ -198,9 +198,9 @@ class TestFunctional(unittest.TestCase):
         line += 4
         self.assertEqual(expected, tools.ToUnicode(lines[line]))
 
-        self.assertEqual(('%s %s%s' % (args[0], rick, stefan)),
+        self.assertEqual(('%s %s\0%s' % (args[0], rick, stefan)),
                          tools.ToUnicode(cc_lines[0]))
-        self.assertEqual(('%s %s, %s, %s, %s' % (args[1], fred, ed, rick,
+        self.assertEqual(('%s %s\0%s\0%s\0%s' % (args[1], fred, ed, rick,
                                      stefan)), tools.ToUnicode(cc_lines[1]))
 
         expected = '''
index 9605a36eff2e398ac7a80297838fd6a13969c8e1..0187ebe1d4bf79d3f37b414adf3ac2389df9fb98 100755 (executable)
@@ -112,7 +112,7 @@ elif options.cc_cmd:
     for line in fd.readlines():
         match = re_line.match(line)
         if match and match.group(1) == args[0]:
-            for cc in match.group(2).split(''):
+            for cc in match.group(2).split('\0'):
                 cc = cc.strip()
                 if cc:
                     print(cc)
index 67103f03e6959d32ebef5ebb5fc497cba4743957..d667d9b6d61c257ad33759e25b619fd6ee259d85 100644 (file)
@@ -243,13 +243,13 @@ class Series(dict):
             if limit is not None:
                 cc = cc[:limit]
             all_ccs += cc
-            print(commit.patch, ''.join(sorted(set(cc))), file=fd)
+            print(commit.patch, '\0'.join(sorted(set(cc))), file=fd)
             self._generated_cc[commit.patch] = cc
 
         if cover_fname:
             cover_cc = gitutil.BuildEmailList(self.get('cover_cc', ''))
             cover_cc = [tools.FromUnicode(m) for m in cover_cc]
-            cc_list = ''.join([tools.ToUnicode(x)
+            cc_list = '\0'.join([tools.ToUnicode(x)
                                  for x in sorted(set(cover_cc + all_ccs))])
             print(cover_fname, cc_list.encode('utf-8'), file=fd)