Skip to content
/ linux Public
forked from torvalds/linux

Commit

Permalink
proc: remove PDE_DATA() completely
Browse files Browse the repository at this point in the history
Remove PDE_DATA() completely and replace it with pde_data().

[[email protected]: fix naming clash in drivers/nubus/proc.c]
[[email protected]: now fix it properly]

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Muchun Song <[email protected]>
Acked-by: Christian Brauner <[email protected]>
Cc: Alexey Dobriyan <[email protected]>
Cc: Alexey Gladkov <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Muchun Song authored and torvalds committed Jan 22, 2022
1 parent 6dfbbae commit 359745d
Show file tree
Hide file tree
Showing 50 changed files with 178 additions and 180 deletions.
4 changes: 2 additions & 2 deletions arch/alpha/kernel/srm_env.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion arch/arm/kernel/atags_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
10 changes: 5 additions & 5 deletions arch/ia64/kernel/salinfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions arch/powerpc/kernel/proc_powerpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand All @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion arch/sh/mm/alignment.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions arch/xtensa/platforms/iss/simdisk.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ static int simdisk_detach(struct simdisk *dev)
static ssize_t proc_read_simdisk(struct file *file, char __user *buf,
size_t size, loff_t *ppos)
{
struct simdisk *dev = PDE_DATA(file_inode(file));
struct simdisk *dev = pde_data(file_inode(file));
const char *s = dev->filename;
if (s) {
ssize_t n = simple_read_from_buffer(buf, size, ppos,
Expand All @@ -225,7 +225,7 @@ static ssize_t proc_write_simdisk(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)
{
char *tmp = memdup_user_nul(buf, count);
struct simdisk *dev = PDE_DATA(file_inode(file));
struct simdisk *dev = pde_data(file_inode(file));
int err;

if (IS_ERR(tmp))
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ static int
acpi_system_wakeup_device_open_fs(struct inode *inode, struct file *file)
{
return single_open(file, acpi_system_wakeup_device_seq_show,
PDE_DATA(inode));
pde_data(inode));
}

static const struct proc_ops acpi_system_wakeup_device_proc_ops = {
Expand Down
4 changes: 2 additions & 2 deletions drivers/hwmon/dell-smm-hwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ static int i8k_get_power_status(void)

static long i8k_ioctl(struct file *fp, unsigned int cmd, unsigned long arg)
{
struct dell_smm_data *data = PDE_DATA(file_inode(fp));
struct dell_smm_data *data = pde_data(file_inode(fp));
int __user *argp = (int __user *)arg;
int speed, err;
int val = 0;
Expand Down Expand Up @@ -585,7 +585,7 @@ static int i8k_proc_show(struct seq_file *seq, void *offset)

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

static const struct proc_ops i8k_proc_ops = {
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/bonding/bond_procfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
static void *bond_info_seq_start(struct seq_file *seq, loff_t *pos)
__acquires(RCU)
{
struct bonding *bond = PDE_DATA(file_inode(seq->file));
struct bonding *bond = pde_data(file_inode(seq->file));
struct list_head *iter;
struct slave *slave;
loff_t off = 0;
Expand All @@ -30,7 +30,7 @@ static void *bond_info_seq_start(struct seq_file *seq, loff_t *pos)

static void *bond_info_seq_next(struct seq_file *seq, void *v, loff_t *pos)
{
struct bonding *bond = PDE_DATA(file_inode(seq->file));
struct bonding *bond = pde_data(file_inode(seq->file));
struct list_head *iter;
struct slave *slave;
bool found = false;
Expand All @@ -57,7 +57,7 @@ static void bond_info_seq_stop(struct seq_file *seq, void *v)

static void bond_info_show_master(struct seq_file *seq)
{
struct bonding *bond = PDE_DATA(file_inode(seq->file));
struct bonding *bond = pde_data(file_inode(seq->file));
const struct bond_opt_value *optval;
struct slave *curr, *primary;
int i;
Expand Down Expand Up @@ -175,7 +175,7 @@ static void bond_info_show_master(struct seq_file *seq)
static void bond_info_show_slave(struct seq_file *seq,
const struct slave *slave)
{
struct bonding *bond = PDE_DATA(file_inode(seq->file));
struct bonding *bond = pde_data(file_inode(seq->file));

seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name);
seq_printf(seq, "MII Status: %s\n", bond_slave_link_status(slave->link));
Expand Down
22 changes: 11 additions & 11 deletions drivers/net/wireless/cisco/airo.c
Original file line number Diff line number Diff line change
Expand Up @@ -4672,7 +4672,7 @@ static ssize_t proc_write(struct file *file,
static int proc_status_open(struct inode *inode, struct file *file)
{
struct proc_data *data;
struct net_device *dev = PDE_DATA(inode);
struct net_device *dev = pde_data(inode);
struct airo_info *apriv = dev->ml_priv;
CapabilityRid cap_rid;
StatusRid status_rid;
Expand Down Expand Up @@ -4756,7 +4756,7 @@ static int proc_stats_rid_open(struct inode *inode,
u16 rid)
{
struct proc_data *data;
struct net_device *dev = PDE_DATA(inode);
struct net_device *dev = pde_data(inode);
struct airo_info *apriv = dev->ml_priv;
StatsRid stats;
int i, j;
Expand Down Expand Up @@ -4819,7 +4819,7 @@ static inline int sniffing_mode(struct airo_info *ai)
static void proc_config_on_close(struct inode *inode, struct file *file)
{
struct proc_data *data = file->private_data;
struct net_device *dev = PDE_DATA(inode);
struct net_device *dev = pde_data(inode);
struct airo_info *ai = dev->ml_priv;
char *line;

Expand Down Expand Up @@ -5030,7 +5030,7 @@ static const char *get_rmode(__le16 mode)
static int proc_config_open(struct inode *inode, struct file *file)
{
struct proc_data *data;
struct net_device *dev = PDE_DATA(inode);
struct net_device *dev = pde_data(inode);
struct airo_info *ai = dev->ml_priv;
int i;
__le16 mode;
Expand Down Expand Up @@ -5120,7 +5120,7 @@ static int proc_config_open(struct inode *inode, struct file *file)
static void proc_SSID_on_close(struct inode *inode, struct file *file)
{
struct proc_data *data = file->private_data;
struct net_device *dev = PDE_DATA(inode);
struct net_device *dev = pde_data(inode);
struct airo_info *ai = dev->ml_priv;
SsidRid SSID_rid;
int i;
Expand Down Expand Up @@ -5156,7 +5156,7 @@ static void proc_SSID_on_close(struct inode *inode, struct file *file)
static void proc_APList_on_close(struct inode *inode, struct file *file)
{
struct proc_data *data = file->private_data;
struct net_device *dev = PDE_DATA(inode);
struct net_device *dev = pde_data(inode);
struct airo_info *ai = dev->ml_priv;
APListRid *APList_rid = &ai->APList;
int i;
Expand Down Expand Up @@ -5280,7 +5280,7 @@ static int set_wep_tx_idx(struct airo_info *ai, u16 index, int perm, int lock)
static void proc_wepkey_on_close(struct inode *inode, struct file *file)
{
struct proc_data *data;
struct net_device *dev = PDE_DATA(inode);
struct net_device *dev = pde_data(inode);
struct airo_info *ai = dev->ml_priv;
int i, rc;
char key[16];
Expand Down Expand Up @@ -5331,7 +5331,7 @@ static void proc_wepkey_on_close(struct inode *inode, struct file *file)
static int proc_wepkey_open(struct inode *inode, struct file *file)
{
struct proc_data *data;
struct net_device *dev = PDE_DATA(inode);
struct net_device *dev = pde_data(inode);
struct airo_info *ai = dev->ml_priv;
char *ptr;
WepKeyRid wkr;
Expand Down Expand Up @@ -5379,7 +5379,7 @@ static int proc_wepkey_open(struct inode *inode, struct file *file)
static int proc_SSID_open(struct inode *inode, struct file *file)
{
struct proc_data *data;
struct net_device *dev = PDE_DATA(inode);
struct net_device *dev = pde_data(inode);
struct airo_info *ai = dev->ml_priv;
int i;
char *ptr;
Expand Down Expand Up @@ -5423,7 +5423,7 @@ static int proc_SSID_open(struct inode *inode, struct file *file)
static int proc_APList_open(struct inode *inode, struct file *file)
{
struct proc_data *data;
struct net_device *dev = PDE_DATA(inode);
struct net_device *dev = pde_data(inode);
struct airo_info *ai = dev->ml_priv;
int i;
char *ptr;
Expand Down Expand Up @@ -5462,7 +5462,7 @@ static int proc_APList_open(struct inode *inode, struct file *file)
static int proc_BSSList_open(struct inode *inode, struct file *file)
{
struct proc_data *data;
struct net_device *dev = PDE_DATA(inode);
struct net_device *dev = pde_data(inode);
struct airo_info *ai = dev->ml_priv;
char *ptr;
BSSListRid BSSList_rid;
Expand Down
16 changes: 8 additions & 8 deletions drivers/net/wireless/intersil/hostap/hostap_ap.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ static void prism2_send_mgmt(struct net_device *dev,
#if !defined(PRISM2_NO_PROCFS_DEBUG) && defined(CONFIG_PROC_FS)
static int ap_debug_proc_show(struct seq_file *m, void *v)
{
struct ap_data *ap = PDE_DATA(file_inode(m->file));
struct ap_data *ap = pde_data(file_inode(m->file));

seq_printf(m, "BridgedUnicastFrames=%u\n", ap->bridged_unicast);
seq_printf(m, "BridgedMulticastFrames=%u\n", ap->bridged_multicast);
Expand Down Expand Up @@ -320,7 +320,7 @@ void hostap_deauth_all_stas(struct net_device *dev, struct ap_data *ap,

static int ap_control_proc_show(struct seq_file *m, void *v)
{
struct ap_data *ap = PDE_DATA(file_inode(m->file));
struct ap_data *ap = pde_data(file_inode(m->file));
char *policy_txt;
struct mac_entry *entry;

Expand Down Expand Up @@ -352,20 +352,20 @@ static int ap_control_proc_show(struct seq_file *m, void *v)

static void *ap_control_proc_start(struct seq_file *m, loff_t *_pos)
{
struct ap_data *ap = PDE_DATA(file_inode(m->file));
struct ap_data *ap = pde_data(file_inode(m->file));
spin_lock_bh(&ap->mac_restrictions.lock);
return seq_list_start_head(&ap->mac_restrictions.mac_list, *_pos);
}

static void *ap_control_proc_next(struct seq_file *m, void *v, loff_t *_pos)
{
struct ap_data *ap = PDE_DATA(file_inode(m->file));
struct ap_data *ap = pde_data(file_inode(m->file));
return seq_list_next(v, &ap->mac_restrictions.mac_list, _pos);
}

static void ap_control_proc_stop(struct seq_file *m, void *v)
{
struct ap_data *ap = PDE_DATA(file_inode(m->file));
struct ap_data *ap = pde_data(file_inode(m->file));
spin_unlock_bh(&ap->mac_restrictions.lock);
}

Expand Down Expand Up @@ -554,20 +554,20 @@ static int prism2_ap_proc_show(struct seq_file *m, void *v)

static void *prism2_ap_proc_start(struct seq_file *m, loff_t *_pos)
{
struct ap_data *ap = PDE_DATA(file_inode(m->file));
struct ap_data *ap = pde_data(file_inode(m->file));
spin_lock_bh(&ap->sta_table_lock);
return seq_list_start_head(&ap->sta_list, *_pos);
}

static void *prism2_ap_proc_next(struct seq_file *m, void *v, loff_t *_pos)
{
struct ap_data *ap = PDE_DATA(file_inode(m->file));
struct ap_data *ap = pde_data(file_inode(m->file));
return seq_list_next(v, &ap->sta_list, _pos);
}

static void prism2_ap_proc_stop(struct seq_file *m, void *v)
{
struct ap_data *ap = PDE_DATA(file_inode(m->file));
struct ap_data *ap = pde_data(file_inode(m->file));
spin_unlock_bh(&ap->sta_table_lock);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/intersil/hostap/hostap_download.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ static int prism2_download_aux_dump_proc_open(struct inode *inode, struct file *
sizeof(struct prism2_download_aux_dump));
if (ret == 0) {
struct seq_file *m = file->private_data;
m->private = PDE_DATA(inode);
m->private = pde_data(inode);
}
return ret;
}
Expand Down
Loading

0 comments on commit 359745d

Please sign in to comment.