mirror of
https://github.com/torvalds/linux.git
synced 2024-11-27 06:31:52 +00:00
mm/slab: minor coding style tweaks
Fix some coding style issues, improve code reading. Adds whitespace to clearly separate the parameters. Link: https://lkml.kernel.org/r/1612841499-32166-1-git-send-email-daizhiyuan@phytium.com.cn Signed-off-by: Zhiyuan Dai <daizhiyuan@phytium.com.cn> Acked-by: David Rientjes <rientjes@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
3754000872
commit
0b41163407
12
mm/slab.c
12
mm/slab.c
@ -272,7 +272,7 @@ static void kmem_cache_node_init(struct kmem_cache_node *parent)
|
|||||||
#define STATS_DEC_ACTIVE(x) ((x)->num_active--)
|
#define STATS_DEC_ACTIVE(x) ((x)->num_active--)
|
||||||
#define STATS_INC_ALLOCED(x) ((x)->num_allocations++)
|
#define STATS_INC_ALLOCED(x) ((x)->num_allocations++)
|
||||||
#define STATS_INC_GROWN(x) ((x)->grown++)
|
#define STATS_INC_GROWN(x) ((x)->grown++)
|
||||||
#define STATS_ADD_REAPED(x,y) ((x)->reaped += (y))
|
#define STATS_ADD_REAPED(x, y) ((x)->reaped += (y))
|
||||||
#define STATS_SET_HIGH(x) \
|
#define STATS_SET_HIGH(x) \
|
||||||
do { \
|
do { \
|
||||||
if ((x)->num_active > (x)->high_mark) \
|
if ((x)->num_active > (x)->high_mark) \
|
||||||
@ -296,7 +296,7 @@ static void kmem_cache_node_init(struct kmem_cache_node *parent)
|
|||||||
#define STATS_DEC_ACTIVE(x) do { } while (0)
|
#define STATS_DEC_ACTIVE(x) do { } while (0)
|
||||||
#define STATS_INC_ALLOCED(x) do { } while (0)
|
#define STATS_INC_ALLOCED(x) do { } while (0)
|
||||||
#define STATS_INC_GROWN(x) do { } while (0)
|
#define STATS_INC_GROWN(x) do { } while (0)
|
||||||
#define STATS_ADD_REAPED(x,y) do { (void)(y); } while (0)
|
#define STATS_ADD_REAPED(x, y) do { (void)(y); } while (0)
|
||||||
#define STATS_SET_HIGH(x) do { } while (0)
|
#define STATS_SET_HIGH(x) do { } while (0)
|
||||||
#define STATS_INC_ERR(x) do { } while (0)
|
#define STATS_INC_ERR(x) do { } while (0)
|
||||||
#define STATS_INC_NODEALLOCS(x) do { } while (0)
|
#define STATS_INC_NODEALLOCS(x) do { } while (0)
|
||||||
@ -332,7 +332,7 @@ static int obj_offset(struct kmem_cache *cachep)
|
|||||||
static unsigned long long *dbg_redzone1(struct kmem_cache *cachep, void *objp)
|
static unsigned long long *dbg_redzone1(struct kmem_cache *cachep, void *objp)
|
||||||
{
|
{
|
||||||
BUG_ON(!(cachep->flags & SLAB_RED_ZONE));
|
BUG_ON(!(cachep->flags & SLAB_RED_ZONE));
|
||||||
return (unsigned long long*) (objp + obj_offset(cachep) -
|
return (unsigned long long *) (objp + obj_offset(cachep) -
|
||||||
sizeof(unsigned long long));
|
sizeof(unsigned long long));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -580,7 +580,7 @@ static int transfer_objects(struct array_cache *to,
|
|||||||
if (!nr)
|
if (!nr)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
memcpy(to->entry + to->avail, from->entry + from->avail -nr,
|
memcpy(to->entry + to->avail, from->entry + from->avail - nr,
|
||||||
sizeof(void *) *nr);
|
sizeof(void *) *nr);
|
||||||
|
|
||||||
from->avail -= nr;
|
from->avail -= nr;
|
||||||
@ -2737,7 +2737,7 @@ static void *cache_free_debugcheck(struct kmem_cache *cachep, void *objp,
|
|||||||
|
|
||||||
#else
|
#else
|
||||||
#define kfree_debugcheck(x) do { } while(0)
|
#define kfree_debugcheck(x) do { } while(0)
|
||||||
#define cache_free_debugcheck(x,objp,z) (objp)
|
#define cache_free_debugcheck(x, objp, z) (objp)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static inline void fixup_objfreelist_debug(struct kmem_cache *cachep,
|
static inline void fixup_objfreelist_debug(struct kmem_cache *cachep,
|
||||||
@ -3024,7 +3024,7 @@ static void *cache_alloc_debugcheck_after(struct kmem_cache *cachep,
|
|||||||
return objp;
|
return objp;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
#define cache_alloc_debugcheck_after(a,b,objp,d) (objp)
|
#define cache_alloc_debugcheck_after(a, b, objp, d) (objp)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static inline void *____cache_alloc(struct kmem_cache *cachep, gfp_t flags)
|
static inline void *____cache_alloc(struct kmem_cache *cachep, gfp_t flags)
|
||||||
|
Loading…
Reference in New Issue
Block a user