Commit 359745d7 authored by Muchun Song's avatar Muchun Song Committed by Linus Torvalds
Browse files

proc: remove PDE_DATA() completely

Remove PDE_DATA() completely and replace it with pde_data().

[akpm@linux-foundation.org: fix naming clash in drivers/nubus/proc.c]
[akpm@linux-foundation.org: now fix it properly]

Link: https://lkml.kernel.org/r/20211124081956.87711-2-songmuchun@bytedance.com


Signed-off-by: default avatarMuchun Song <songmuchun@bytedance.com>
Acked-by: default avatarChristian Brauner <christian.brauner@ubuntu.com>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Alexey Gladkov <gladkov.alexey@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 6dfbbae1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -83,14 +83,14 @@ static int srm_env_proc_show(struct seq_file *m, void *v)

static int srm_env_proc_open(struct inode *inode, struct file *file)
{
	return single_open(file, srm_env_proc_show, PDE_DATA(inode));
	return single_open(file, srm_env_proc_show, pde_data(inode));
}

static ssize_t srm_env_proc_write(struct file *file, const char __user *buffer,
				  size_t count, loff_t *pos)
{
	int res;
	unsigned long	id = (unsigned long)PDE_DATA(file_inode(file));
	unsigned long	id = (unsigned long)pde_data(file_inode(file));
	char		*buf = (char *) __get_free_page(GFP_USER);
	unsigned long	ret1, ret2;

+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ struct buffer {
static ssize_t atags_read(struct file *file, char __user *buf,
			  size_t count, loff_t *ppos)
{
	struct buffer *b = PDE_DATA(file_inode(file));
	struct buffer *b = pde_data(file_inode(file));
	return simple_read_from_buffer(buf, count, ppos, b->data, b->size);
}

+5 −5
Original line number Diff line number Diff line
@@ -282,7 +282,7 @@ salinfo_event_open(struct inode *inode, struct file *file)
static ssize_t
salinfo_event_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
{
	struct salinfo_data *data = PDE_DATA(file_inode(file));
	struct salinfo_data *data = pde_data(file_inode(file));
	char cmd[32];
	size_t size;
	int i, n, cpu = -1;
@@ -340,7 +340,7 @@ static const struct proc_ops salinfo_event_proc_ops = {
static int
salinfo_log_open(struct inode *inode, struct file *file)
{
	struct salinfo_data *data = PDE_DATA(inode);
	struct salinfo_data *data = pde_data(inode);

	if (!capable(CAP_SYS_ADMIN))
		return -EPERM;
@@ -365,7 +365,7 @@ salinfo_log_open(struct inode *inode, struct file *file)
static int
salinfo_log_release(struct inode *inode, struct file *file)
{
	struct salinfo_data *data = PDE_DATA(inode);
	struct salinfo_data *data = pde_data(inode);

	if (data->state == STATE_NO_DATA) {
		vfree(data->log_buffer);
@@ -433,7 +433,7 @@ salinfo_log_new_read(int cpu, struct salinfo_data *data)
static ssize_t
salinfo_log_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
{
	struct salinfo_data *data = PDE_DATA(file_inode(file));
	struct salinfo_data *data = pde_data(file_inode(file));
	u8 *buf;
	u64 bufsize;

@@ -494,7 +494,7 @@ salinfo_log_clear(struct salinfo_data *data, int cpu)
static ssize_t
salinfo_log_write(struct file *file, const char __user *buffer, size_t count, loff_t *ppos)
{
	struct salinfo_data *data = PDE_DATA(file_inode(file));
	struct salinfo_data *data = pde_data(file_inode(file));
	char cmd[32];
	size_t size;
	u32 offset;
+2 −2
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ static ssize_t page_map_read( struct file *file, char __user *buf, size_t nbytes
			      loff_t *ppos)
{
	return simple_read_from_buffer(buf, nbytes, ppos,
			PDE_DATA(file_inode(file)), PAGE_SIZE);
			pde_data(file_inode(file)), PAGE_SIZE);
}

static int page_map_mmap( struct file *file, struct vm_area_struct *vma )
@@ -34,7 +34,7 @@ static int page_map_mmap( struct file *file, struct vm_area_struct *vma )
		return -EINVAL;

	remap_pfn_range(vma, vma->vm_start,
			__pa(PDE_DATA(file_inode(file))) >> PAGE_SHIFT,
			__pa(pde_data(file_inode(file))) >> PAGE_SHIFT,
			PAGE_SIZE, vma->vm_page_prot);
	return 0;
}
+1 −1
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ static int alignment_proc_open(struct inode *inode, struct file *file)
static ssize_t alignment_proc_write(struct file *file,
		const char __user *buffer, size_t count, loff_t *pos)
{
	int *data = PDE_DATA(file_inode(file));
	int *data = pde_data(file_inode(file));
	char mode;

	if (count > 0) {
Loading