diff options
author | James Morris <jmorris@namei.org> | 2018-02-21 08:21:41 -0800 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2018-02-21 08:21:41 -0800 |
commit | a02633e9b13dcb9b1a656b08f81bc8ba2d4d2294 (patch) | |
tree | 3d5ef56eee3117cd61812759a255fa293d8044b8 /lib/stackdepot.c | |
parent | d21bd6898336a7892914d308d5e0868f0b863571 (diff) | |
parent | 91ab883eb21325ad80f3473633f794c78ac87f51 (diff) |
Merge tag 'v4.16-rc2' into next-general
Sync to Linux 4.16-rc2 for developers to work against.
Diffstat (limited to 'lib/stackdepot.c')
-rw-r--r-- | lib/stackdepot.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/lib/stackdepot.c b/lib/stackdepot.c index f87d138e9672..e513459a5601 100644 --- a/lib/stackdepot.c +++ b/lib/stackdepot.c @@ -163,6 +163,21 @@ static inline u32 hash_stack(unsigned long *entries, unsigned int size) STACK_HASH_SEED); } +/* Use our own, non-instrumented version of memcmp(). + * + * We actually don't care about the order, just the equality. + */ +static inline +int stackdepot_memcmp(const unsigned long *u1, const unsigned long *u2, + unsigned int n) +{ + for ( ; n-- ; u1++, u2++) { + if (*u1 != *u2) + return 1; + } + return 0; +} + /* Find a stack that is equal to the one stored in entries in the hash */ static inline struct stack_record *find_stack(struct stack_record *bucket, unsigned long *entries, int size, @@ -173,10 +188,8 @@ static inline struct stack_record *find_stack(struct stack_record *bucket, for (found = bucket; found; found = found->next) { if (found->hash == hash && found->size == size && - !memcmp(entries, found->entries, - size * sizeof(unsigned long))) { + !stackdepot_memcmp(entries, found->entries, size)) return found; - } } return NULL; } |