pstore/ram_core: Remove now unused code
authorAnton Vorontsov <anton.vorontsov@linaro.org>
Sat, 26 May 2012 13:20:27 +0000 (06:20 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Jun 2012 23:59:37 +0000 (16:59 -0700)
The code tried to maintain the global list of persistent ram zones,
which isn't a great idea overall, plus since Android's ram_console
is no longer there, we can remove some unused functions.

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
Acked-by: Kees Cook <keescook@chromium.org>
Acked-by: Colin Cross <ccross@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/pstore/ram_core.c
include/linux/pstore_ram.h

index 78f6d4b2addb610a860da83c3b8d015127c9db21..0fd81611525ca4de442515dd5202b0372af65947 100644 (file)
@@ -35,8 +35,6 @@ struct persistent_ram_buffer {
 
 #define PERSISTENT_RAM_SIG (0x43474244) /* DBGC */
 
-static __initdata LIST_HEAD(persistent_ram_list);
-
 static inline size_t buffer_size(struct persistent_ram_zone *prz)
 {
        return atomic_read(&prz->buffer->size);
@@ -462,78 +460,3 @@ err:
        kfree(prz);
        return ERR_PTR(ret);
 }
-
-#ifndef MODULE
-static int __init persistent_ram_buffer_init(const char *name,
-               struct persistent_ram_zone *prz)
-{
-       int i;
-       struct persistent_ram *ram;
-       struct persistent_ram_descriptor *desc;
-       phys_addr_t start;
-
-       list_for_each_entry(ram, &persistent_ram_list, node) {
-               start = ram->start;
-               for (i = 0; i < ram->num_descs; i++) {
-                       desc = &ram->descs[i];
-                       if (!strcmp(desc->name, name))
-                               return persistent_ram_buffer_map(start,
-                                               desc->size, prz);
-                       start += desc->size;
-               }
-       }
-
-       return -EINVAL;
-}
-
-static  __init
-struct persistent_ram_zone *__persistent_ram_init(struct device *dev, bool ecc)
-{
-       struct persistent_ram_zone *prz;
-       int ret = -ENOMEM;
-
-       prz = kzalloc(sizeof(struct persistent_ram_zone), GFP_KERNEL);
-       if (!prz) {
-               pr_err("persistent_ram: failed to allocate persistent ram zone\n");
-               goto err;
-       }
-
-       ret = persistent_ram_buffer_init(dev_name(dev), prz);
-       if (ret) {
-               pr_err("persistent_ram: failed to initialize buffer\n");
-               goto err;
-       }
-
-       persistent_ram_post_init(prz, ecc);
-
-       return prz;
-err:
-       kfree(prz);
-       return ERR_PTR(ret);
-}
-
-struct persistent_ram_zone * __init
-persistent_ram_init_ringbuffer(struct device *dev, bool ecc)
-{
-       return __persistent_ram_init(dev, ecc);
-}
-
-int __init persistent_ram_early_init(struct persistent_ram *ram)
-{
-       int ret;
-
-       ret = memblock_reserve(ram->start, ram->size);
-       if (ret) {
-               pr_err("Failed to reserve persistent memory from %08lx-%08lx\n",
-                       (long)ram->start, (long)(ram->start + ram->size - 1));
-               return ret;
-       }
-
-       list_add_tail(&ram->node, &persistent_ram_list);
-
-       pr_info("Initialized persistent memory from %08lx-%08lx\n",
-               (long)ram->start, (long)(ram->start + ram->size - 1));
-
-       return 0;
-}
-#endif
index 9385d41cb1c3d2328496e84d615f965b3f57d445..2470bb591434bc28663e01a56730994b443fdbfb 100644 (file)
 
 struct persistent_ram_buffer;
 
-struct persistent_ram_descriptor {
-       const char      *name;
-       phys_addr_t     size;
-};
-
-struct persistent_ram {
-       phys_addr_t     start;
-       phys_addr_t     size;
-
-       int                                     num_descs;
-       struct persistent_ram_descriptor        *descs;
-
-       struct list_head node;
-};
-
 struct persistent_ram_zone {
        phys_addr_t paddr;
        size_t size;
@@ -63,15 +48,11 @@ struct persistent_ram_zone {
        size_t old_log_size;
 };
 
-int persistent_ram_early_init(struct persistent_ram *ram);
-
 struct persistent_ram_zone * __init persistent_ram_new(phys_addr_t start,
                                                       size_t size,
                                                       bool ecc);
 void persistent_ram_free(struct persistent_ram_zone *prz);
 void persistent_ram_zap(struct persistent_ram_zone *prz);
-struct persistent_ram_zone *persistent_ram_init_ringbuffer(struct device *dev,
-               bool ecc);
 
 int persistent_ram_write(struct persistent_ram_zone *prz, const void *s,
        unsigned int count);