Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset a000878c in mainline for kernel/generic/src/mm/slab.c


Ignore:
Timestamp:
2010-02-25T19:11:25Z (12 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master
Children:
958de16
Parents:
a634485
Message:

make sure that all statically allocated strings are declared as "const char *"
and are treated as read-only

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/mm/slab.c

    ra634485 ra000878c  
    130130/** Caches for malloc */
    131131static slab_cache_t *malloc_caches[SLAB_MAX_MALLOC_W - SLAB_MIN_MALLOC_W + 1];
    132 static char *malloc_names[] =  {
     132static const char *malloc_names[] =  {
    133133        "malloc-16",
    134134        "malloc-32",
     
    571571
    572572/** Initialize allocated memory as a slab cache */
    573 static void
    574 _slab_cache_create(slab_cache_t *cache, char *name, size_t size, size_t align,
    575     int (*constructor)(void *obj, int kmflag), int (*destructor)(void *obj),
    576     int flags)
     573static void _slab_cache_create(slab_cache_t *cache, const char *name,
     574    size_t size, size_t align, int (*constructor)(void *obj, int kmflag),
     575    int (*destructor)(void *obj), int flags)
    577576{
    578577        int pages;
     
    631630
    632631/** Create slab cache  */
    633 slab_cache_t *
    634 slab_cache_create(char *name, size_t size, size_t align,
     632slab_cache_t *slab_cache_create(const char *name, size_t size, size_t align,
    635633    int (*constructor)(void *obj, int kmflag), int (*destructor)(void *obj),
    636634    int flags)
     
    853851                cache = list_get_instance(cur, slab_cache_t, link);
    854852
    855                 char *name = cache->name;
     853                const char *name = cache->name;
    856854                uint8_t order = cache->order;
    857855                size_t size = cache->size;
     
    896894                    NULL, NULL, SLAB_CACHE_MAGDEFERRED);
    897895        }
    898 #ifdef CONFIG_DEBUG       
     896#ifdef CONFIG_DEBUG
    899897        _slab_initialized = 1;
    900898#endif
Note: See TracChangeset for help on using the changeset viewer.