#ifdef CONFIG_BTRFS_FS_RUN_SANITY_TESTS
 int btrfs_run_sanity_tests(void);
 
-#define test_msg(fmt, ...) pr_info("BTRFS: selftest: " fmt, ##__VA_ARGS__)
+#define test_msg(fmt, ...) pr_info("BTRFS: selftest: " fmt "\n", ##__VA_ARGS__)
 #define test_err(fmt, ...) pr_err("BTRFS: selftest: " fmt "\n", ##__VA_ARGS__)
 
 struct btrfs_root;
 
        u32 value_len = strlen(value);
        int ret = 0;
 
-       test_msg("running btrfs_split_item tests\n");
+       test_msg("running btrfs_split_item tests");
 
        fs_info = btrfs_alloc_dummy_fs_info(nodesize, sectorsize);
        if (!fs_info) {
 
 int btrfs_test_extent_buffer_operations(u32 sectorsize, u32 nodesize)
 {
-       test_msg("running extent buffer operation tests\n");
+       test_msg("running extent buffer operation tests");
        return test_btrfs_split_item(sectorsize, nodesize);
 }
 
        u64 found;
        int ret = -EINVAL;
 
-       test_msg("running find delalloc tests\n");
+       test_msg("running find delalloc tests");
 
        inode = btrfs_new_test_inode();
        if (!inode) {
        struct extent_buffer *eb;
        int ret;
 
-       test_msg("running extent buffer bitmap tests\n");
+       test_msg("running extent buffer bitmap tests");
 
        /*
         * In ppc64, sectorsize can be 64K, thus 4 * 64K will be larger than
 {
        int ret;
 
-       test_msg("running extent I/O tests\n");
+       test_msg("running extent I/O tests");
 
        ret = test_find_delalloc(sectorsize);
        if (ret)
 
        ret = test_eb_bitmaps(sectorsize, nodesize);
 out:
-       test_msg("extent I/O tests finished\n");
+       test_msg("extent I/O tests finished");
        return ret;
 }
 
        struct btrfs_fs_info *fs_info = NULL;
        struct extent_map_tree *em_tree;
 
-       test_msg("running extent_map tests\n");
+       test_msg("running extent_map tests");
 
        /*
         * Note: the fs_info is not set up completely, we only need
         */
        fs_info = btrfs_alloc_dummy_fs_info(PAGE_SIZE, PAGE_SIZE);
        if (!fs_info) {
-               test_msg("Couldn't allocate dummy fs info\n");
+               test_msg("Couldn't allocate dummy fs info");
                return -ENOMEM;
        }
 
 
 {
        int ret = 0;
 
-       test_msg("running extent only tests\n");
+       test_msg("running extent only tests");
 
        /* First just make sure we can remove an entire entry */
        ret = btrfs_add_free_space(cache, 0, SZ_4M);
        u64 next_bitmap_offset;
        int ret;
 
-       test_msg("running bitmap only tests\n");
+       test_msg("running bitmap only tests");
 
        ret = test_add_free_space_entry(cache, 0, SZ_4M, 1);
        if (ret) {
        u64 bitmap_offset = (u64)(BITS_PER_BITMAP * sectorsize);
        int ret;
 
-       test_msg("running bitmap and extent tests\n");
+       test_msg("running bitmap and extent tests");
 
        /*
         * First let's do something simple, an extent at the same offset as the
        };
        const struct btrfs_free_space_op *orig_free_space_ops;
 
-       test_msg("running space stealing from bitmap to extent\n");
+       test_msg("running space stealing from bitmap to extent");
 
        /*
         * For this test, we want to ensure we end up with an extent entry
        struct btrfs_root *root = NULL;
        int ret = -ENOMEM;
 
-       test_msg("running btrfs free space cache tests\n");
+       test_msg("running btrfs free space cache tests");
        fs_info = btrfs_alloc_dummy_fs_info(nodesize, sectorsize);
        if (!fs_info)
                return -ENOMEM;
        btrfs_free_dummy_block_group(cache);
        btrfs_free_dummy_root(root);
        btrfs_free_dummy_fs_info(fs_info);
-       test_msg("free space cache tests finished\n");
+       test_msg("free space cache tests finished");
        return ret;
 }
 
         */
        bitmap_alignment = BTRFS_FREE_SPACE_BITMAP_BITS * PAGE_SIZE;
 
-       test_msg("running free space tree tests\n");
+       test_msg("running free space tree tests");
        for (i = 0; i < ARRAY_SIZE(tests); i++) {
                int ret;
 
 
        set_bit(EXTENT_FLAG_COMPRESSED, &compressed_only);
        set_bit(EXTENT_FLAG_PREALLOC, &prealloc_only);
 
-       test_msg("running btrfs_get_extent tests\n");
+       test_msg("running btrfs_get_extent tests");
        ret = test_btrfs_get_extent(sectorsize, nodesize);
        if (ret)
                return ret;
-       test_msg("running hole first btrfs_get_extent test\n");
+       test_msg("running hole first btrfs_get_extent test");
        ret = test_hole_first(sectorsize, nodesize);
        if (ret)
                return ret;
-       test_msg("running outstanding_extents tests\n");
+       test_msg("running outstanding_extents tests");
        return test_extent_accounting(sectorsize, nodesize);
 }
 
 
        btrfs_init_dummy_trans(&trans, fs_info);
 
-       test_msg("qgroup basic add\n");
+       test_msg("qgroup basic add");
        ret = btrfs_create_qgroup(NULL, fs_info, BTRFS_FS_TREE_OBJECTID);
        if (ret) {
                test_err("couldn't create a qgroup %d", ret);
 
        btrfs_init_dummy_trans(&trans, fs_info);
 
-       test_msg("qgroup multiple refs test\n");
+       test_msg("qgroup multiple refs test");
 
        /*
         * We have BTRFS_FS_TREE_OBJECTID created already from the
                goto out;
        }
 
-       test_msg("running qgroup tests\n");
+       test_msg("running qgroup tests");
        ret = test_no_shared_qgroup(root, sectorsize, nodesize);
        if (ret)
                goto out;