Skip to content

Commit b5a8211

Browse files
committed
fixup build errors
Signed-off-by: Nick Xie <[email protected]>
1 parent 683fbb2 commit b5a8211

File tree

5 files changed

+24
-13
lines changed

5 files changed

+24
-13
lines changed

drivers/cpufreq/cpufreq_interactive.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ static ssize_t store_io_is_busy(struct cpufreq_interactive_tunables *tunables,
10181018
*/
10191019
#define show_gov_pol_sys(file_name) \
10201020
static ssize_t show_##file_name##_gov_sys \
1021-
(struct kobject *kobj, struct attribute *attr, char *buf) \
1021+
(struct kobject *kobj, struct kobj_attribute *attr, char *buf) \
10221022
{ \
10231023
return show_##file_name(common_tunables, buf); \
10241024
} \
@@ -1031,7 +1031,7 @@ static ssize_t show_##file_name##_gov_pol \
10311031

10321032
#define store_gov_pol_sys(file_name) \
10331033
static ssize_t store_##file_name##_gov_sys \
1034-
(struct kobject *kobj, struct attribute *attr, const char *buf, \
1034+
(struct kobject *kobj, struct kobj_attribute *attr, const char *buf, \
10351035
size_t count) \
10361036
{ \
10371037
return store_##file_name(common_tunables, buf, count); \
@@ -1060,7 +1060,7 @@ show_store_gov_pol_sys(boostpulse_duration);
10601060
show_store_gov_pol_sys(io_is_busy);
10611061

10621062
#define gov_sys_attr_rw(_name) \
1063-
static struct global_attr _name##_gov_sys = \
1063+
static struct kobj_attribute _name##_gov_sys = \
10641064
__ATTR(_name, 0644, show_##_name##_gov_sys, store_##_name##_gov_sys)
10651065

10661066
#define gov_pol_attr_rw(_name) \
@@ -1082,7 +1082,7 @@ gov_sys_pol_attr_rw(boost);
10821082
gov_sys_pol_attr_rw(boostpulse_duration);
10831083
gov_sys_pol_attr_rw(io_is_busy);
10841084

1085-
static struct global_attr boostpulse_gov_sys =
1085+
static struct kobj_attribute boostpulse_gov_sys =
10861086
__ATTR(boostpulse, 0200, NULL, store_boostpulse_gov_sys);
10871087

10881088
static struct freq_attr boostpulse_gov_pol =

drivers/gpu/arm/midgard_for_linux/mali_kbase_mem.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2037,7 +2037,13 @@ static int kbase_jd_user_buf_map(struct kbase_context *kctx,
20372037

20382038
pages = alloc->imported.user_buf.pages;
20392039

2040-
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)
2040+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 168) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)
2041+
pinned_pages = get_user_pages(NULL, mm,
2042+
address,
2043+
alloc->imported.user_buf.nr_pages,
2044+
reg->flags & KBASE_REG_GPU_WR ? FOLL_WRITE : 0,
2045+
pages, NULL);
2046+
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)
20412047
pinned_pages = get_user_pages(NULL, mm,
20422048
address,
20432049
alloc->imported.user_buf.nr_pages,

drivers/gpu/arm/midgard_for_linux/mali_kbase_mem_linux.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1189,7 +1189,11 @@ static struct kbase_va_region *kbase_mem_from_user_buffer(
11891189
/* We can't really store the page list because that would involve */
11901190
/* keeping the pages pinned - instead we pin/unpin around the job */
11911191
/* (as part of the external resources handling code) */
1192-
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)
1192+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 168) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)
1193+
faulted_pages = get_user_pages(current, current->mm, address, *va_pages,
1194+
reg->flags & KBASE_REG_GPU_WR ? FOLL_WRITE : 0,
1195+
NULL, NULL);
1196+
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)
11931197
faulted_pages = get_user_pages(current, current->mm, address, *va_pages,
11941198
reg->flags & KBASE_REG_GPU_WR, 0, NULL, NULL);
11951199
#else

drivers/video/rockchip/rga2/rga2_mmu_info.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,11 @@ static int rga2_MapUserMemory(struct page **pages, uint32_t *pageTable,
426426
status = 0;
427427
Address = 0;
428428
down_read(&current->mm->mmap_sem);
429-
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)
429+
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 4, 168) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 5, 0)
430+
result = get_user_pages(current, current->mm, Memory << PAGE_SHIFT,
431+
pageCount, writeFlag ? FOLL_WRITE : 0,
432+
pages, NULL);
433+
#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)
430434
result = get_user_pages(current, current->mm, Memory << PAGE_SHIFT,
431435
pageCount, writeFlag, 0, pages, NULL);
432436
#else

fs/proc/task_mmu.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ static void seq_print_vma_name(struct seq_file *m, struct vm_area_struct *vma)
141141
struct page *page;
142142

143143
pages_pinned = get_user_pages(current, mm, page_start_vaddr,
144-
1, 0, 0, &page, NULL);
144+
1, 0, &page, NULL);
145145
if (pages_pinned < 1) {
146146
seq_puts(m, "<fault>]");
147147
return;
@@ -328,10 +328,7 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid)
328328
const char *name = NULL;
329329

330330
if (file) {
331-
struct inode *inode;
332-
333-
file = vma_pr_or_file(vma);
334-
inode = file_inode(file);
331+
struct inode *inode = file_inode(vma->vm_file);
335332
dev = inode->i_sb->s_dev;
336333
ino = inode->i_ino;
337334
pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT;
@@ -1593,7 +1590,7 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid)
15931590
struct proc_maps_private *proc_priv = &numa_priv->proc_maps;
15941591
struct vm_area_struct *vma = v;
15951592
struct numa_maps *md = &numa_priv->md;
1596-
struct file *file = vma_pr_or_file(vma);
1593+
struct file *file = vma->vm_file;
15971594
struct mm_struct *mm = vma->vm_mm;
15981595
struct mm_walk walk = {
15991596
.hugetlb_entry = gather_hugetlb_stats,

0 commit comments

Comments
 (0)