mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-24 13:44:26 -04:00
Pull sn2-reduce-kmalloc-wrap into release branch
This commit is contained in:
commit
133a58c1fd
4 changed files with 85 additions and 68 deletions
|
|
@ -1227,28 +1227,6 @@ xpc_map_bte_errors(bte_result_t error)
|
|||
|
||||
|
||||
|
||||
static inline void *
|
||||
xpc_kmalloc_cacheline_aligned(size_t size, gfp_t flags, void **base)
|
||||
{
|
||||
/* see if kmalloc will give us cachline aligned memory by default */
|
||||
*base = kmalloc(size, flags);
|
||||
if (*base == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
if ((u64) *base == L1_CACHE_ALIGN((u64) *base)) {
|
||||
return *base;
|
||||
}
|
||||
kfree(*base);
|
||||
|
||||
/* nope, we'll have to do it ourselves */
|
||||
*base = kmalloc(size + L1_CACHE_BYTES, flags);
|
||||
if (*base == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
return (void *) L1_CACHE_ALIGN((u64) *base);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Check to see if there is any channel activity to/from the specified
|
||||
* partition.
|
||||
|
|
|
|||
Loading…
Reference in a new issue