Commit 57674308 authored by Joe Perches's avatar Joe Perches Committed by John W. Linville

drivers/net/wireless: Remove unnecessary casts of private_data

Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 447a42c2
...@@ -4657,7 +4657,7 @@ static ssize_t proc_write( struct file *file, ...@@ -4657,7 +4657,7 @@ static ssize_t proc_write( struct file *file,
loff_t *offset ) loff_t *offset )
{ {
loff_t pos = *offset; loff_t pos = *offset;
struct proc_data *priv = (struct proc_data*)file->private_data; struct proc_data *priv = file->private_data;
if (!priv->wbuffer) if (!priv->wbuffer)
return -EINVAL; return -EINVAL;
...@@ -4689,7 +4689,7 @@ static int proc_status_open(struct inode *inode, struct file *file) ...@@ -4689,7 +4689,7 @@ static int proc_status_open(struct inode *inode, struct file *file)
if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL) if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
return -ENOMEM; return -ENOMEM;
data = (struct proc_data *)file->private_data; data = file->private_data;
if ((data->rbuffer = kmalloc( 2048, GFP_KERNEL )) == NULL) { if ((data->rbuffer = kmalloc( 2048, GFP_KERNEL )) == NULL) {
kfree (file->private_data); kfree (file->private_data);
return -ENOMEM; return -ENOMEM;
...@@ -4772,7 +4772,7 @@ static int proc_stats_rid_open( struct inode *inode, ...@@ -4772,7 +4772,7 @@ static int proc_stats_rid_open( struct inode *inode,
if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL) if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
return -ENOMEM; return -ENOMEM;
data = (struct proc_data *)file->private_data; data = file->private_data;
if ((data->rbuffer = kmalloc( 4096, GFP_KERNEL )) == NULL) { if ((data->rbuffer = kmalloc( 4096, GFP_KERNEL )) == NULL) {
kfree (file->private_data); kfree (file->private_data);
return -ENOMEM; return -ENOMEM;
...@@ -5045,7 +5045,7 @@ static int proc_config_open(struct inode *inode, struct file *file) ...@@ -5045,7 +5045,7 @@ static int proc_config_open(struct inode *inode, struct file *file)
if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL) if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
return -ENOMEM; return -ENOMEM;
data = (struct proc_data *)file->private_data; data = file->private_data;
if ((data->rbuffer = kmalloc( 2048, GFP_KERNEL )) == NULL) { if ((data->rbuffer = kmalloc( 2048, GFP_KERNEL )) == NULL) {
kfree (file->private_data); kfree (file->private_data);
return -ENOMEM; return -ENOMEM;
...@@ -5127,7 +5127,7 @@ static int proc_config_open(struct inode *inode, struct file *file) ...@@ -5127,7 +5127,7 @@ static int proc_config_open(struct inode *inode, struct file *file)
static void proc_SSID_on_close(struct inode *inode, struct file *file) static void proc_SSID_on_close(struct inode *inode, struct file *file)
{ {
struct proc_data *data = (struct proc_data *)file->private_data; struct proc_data *data = file->private_data;
struct proc_dir_entry *dp = PDE(inode); struct proc_dir_entry *dp = PDE(inode);
struct net_device *dev = dp->data; struct net_device *dev = dp->data;
struct airo_info *ai = dev->ml_priv; struct airo_info *ai = dev->ml_priv;
...@@ -5170,7 +5170,7 @@ static inline u8 hexVal(char c) { ...@@ -5170,7 +5170,7 @@ static inline u8 hexVal(char c) {
} }
static void proc_APList_on_close( struct inode *inode, struct file *file ) { static void proc_APList_on_close( struct inode *inode, struct file *file ) {
struct proc_data *data = (struct proc_data *)file->private_data; struct proc_data *data = file->private_data;
struct proc_dir_entry *dp = PDE(inode); struct proc_dir_entry *dp = PDE(inode);
struct net_device *dev = dp->data; struct net_device *dev = dp->data;
struct airo_info *ai = dev->ml_priv; struct airo_info *ai = dev->ml_priv;
...@@ -5316,7 +5316,7 @@ static void proc_wepkey_on_close( struct inode *inode, struct file *file ) { ...@@ -5316,7 +5316,7 @@ static void proc_wepkey_on_close( struct inode *inode, struct file *file ) {
memset(key, 0, sizeof(key)); memset(key, 0, sizeof(key));
data = (struct proc_data *)file->private_data; data = file->private_data;
if ( !data->writelen ) return; if ( !data->writelen ) return;
if (data->wbuffer[0] >= '0' && data->wbuffer[0] <= '3' && if (data->wbuffer[0] >= '0' && data->wbuffer[0] <= '3' &&
...@@ -5370,7 +5370,7 @@ static int proc_wepkey_open( struct inode *inode, struct file *file ) ...@@ -5370,7 +5370,7 @@ static int proc_wepkey_open( struct inode *inode, struct file *file )
if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL) if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
return -ENOMEM; return -ENOMEM;
memset(&wkr, 0, sizeof(wkr)); memset(&wkr, 0, sizeof(wkr));
data = (struct proc_data *)file->private_data; data = file->private_data;
if ((data->rbuffer = kzalloc( 180, GFP_KERNEL )) == NULL) { if ((data->rbuffer = kzalloc( 180, GFP_KERNEL )) == NULL) {
kfree (file->private_data); kfree (file->private_data);
return -ENOMEM; return -ENOMEM;
...@@ -5416,7 +5416,7 @@ static int proc_SSID_open(struct inode *inode, struct file *file) ...@@ -5416,7 +5416,7 @@ static int proc_SSID_open(struct inode *inode, struct file *file)
if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL) if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
return -ENOMEM; return -ENOMEM;
data = (struct proc_data *)file->private_data; data = file->private_data;
if ((data->rbuffer = kmalloc( 104, GFP_KERNEL )) == NULL) { if ((data->rbuffer = kmalloc( 104, GFP_KERNEL )) == NULL) {
kfree (file->private_data); kfree (file->private_data);
return -ENOMEM; return -ENOMEM;
...@@ -5460,7 +5460,7 @@ static int proc_APList_open( struct inode *inode, struct file *file ) { ...@@ -5460,7 +5460,7 @@ static int proc_APList_open( struct inode *inode, struct file *file ) {
if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL) if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
return -ENOMEM; return -ENOMEM;
data = (struct proc_data *)file->private_data; data = file->private_data;
if ((data->rbuffer = kmalloc( 104, GFP_KERNEL )) == NULL) { if ((data->rbuffer = kmalloc( 104, GFP_KERNEL )) == NULL) {
kfree (file->private_data); kfree (file->private_data);
return -ENOMEM; return -ENOMEM;
...@@ -5502,7 +5502,7 @@ static int proc_BSSList_open( struct inode *inode, struct file *file ) { ...@@ -5502,7 +5502,7 @@ static int proc_BSSList_open( struct inode *inode, struct file *file ) {
if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL) if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
return -ENOMEM; return -ENOMEM;
data = (struct proc_data *)file->private_data; data = file->private_data;
if ((data->rbuffer = kmalloc( 1024, GFP_KERNEL )) == NULL) { if ((data->rbuffer = kmalloc( 1024, GFP_KERNEL )) == NULL) {
kfree (file->private_data); kfree (file->private_data);
return -ENOMEM; return -ENOMEM;
......
...@@ -492,8 +492,7 @@ static int ath9k_debugfs_open(struct inode *inode, struct file *file) ...@@ -492,8 +492,7 @@ static int ath9k_debugfs_open(struct inode *inode, struct file *file)
static ssize_t read_file_tgt_stats(struct file *file, char __user *user_buf, static ssize_t read_file_tgt_stats(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct ath9k_htc_priv *priv = struct ath9k_htc_priv *priv = file->private_data;
(struct ath9k_htc_priv *) file->private_data;
struct ath9k_htc_target_stats cmd_rsp; struct ath9k_htc_target_stats cmd_rsp;
char buf[512]; char buf[512];
unsigned int len = 0; unsigned int len = 0;
...@@ -536,8 +535,7 @@ static const struct file_operations fops_tgt_stats = { ...@@ -536,8 +535,7 @@ static const struct file_operations fops_tgt_stats = {
static ssize_t read_file_xmit(struct file *file, char __user *user_buf, static ssize_t read_file_xmit(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct ath9k_htc_priv *priv = struct ath9k_htc_priv *priv = file->private_data;
(struct ath9k_htc_priv *) file->private_data;
char buf[512]; char buf[512];
unsigned int len = 0; unsigned int len = 0;
...@@ -582,8 +580,7 @@ static const struct file_operations fops_xmit = { ...@@ -582,8 +580,7 @@ static const struct file_operations fops_xmit = {
static ssize_t read_file_recv(struct file *file, char __user *user_buf, static ssize_t read_file_recv(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct ath9k_htc_priv *priv = struct ath9k_htc_priv *priv = file->private_data;
(struct ath9k_htc_priv *) file->private_data;
char buf[512]; char buf[512];
unsigned int len = 0; unsigned int len = 0;
......
...@@ -1267,7 +1267,7 @@ static ssize_t iwl_dbgfs_ucode_tracing_read(struct file *file, ...@@ -1267,7 +1267,7 @@ static ssize_t iwl_dbgfs_ucode_tracing_read(struct file *file,
char __user *user_buf, char __user *user_buf,
size_t count, loff_t *ppos) { size_t count, loff_t *ppos) {
struct iwl_priv *priv = (struct iwl_priv *)file->private_data; struct iwl_priv *priv = file->private_data;
int pos = 0; int pos = 0;
char buf[128]; char buf[128];
const size_t bufsz = sizeof(buf); const size_t bufsz = sizeof(buf);
...@@ -1317,7 +1317,7 @@ static ssize_t iwl_dbgfs_rxon_flags_read(struct file *file, ...@@ -1317,7 +1317,7 @@ static ssize_t iwl_dbgfs_rxon_flags_read(struct file *file,
char __user *user_buf, char __user *user_buf,
size_t count, loff_t *ppos) { size_t count, loff_t *ppos) {
struct iwl_priv *priv = (struct iwl_priv *)file->private_data; struct iwl_priv *priv = file->private_data;
int len = 0; int len = 0;
char buf[20]; char buf[20];
...@@ -1329,7 +1329,7 @@ static ssize_t iwl_dbgfs_rxon_filter_flags_read(struct file *file, ...@@ -1329,7 +1329,7 @@ static ssize_t iwl_dbgfs_rxon_filter_flags_read(struct file *file,
char __user *user_buf, char __user *user_buf,
size_t count, loff_t *ppos) { size_t count, loff_t *ppos) {
struct iwl_priv *priv = (struct iwl_priv *)file->private_data; struct iwl_priv *priv = file->private_data;
int len = 0; int len = 0;
char buf[20]; char buf[20];
...@@ -1342,7 +1342,7 @@ static ssize_t iwl_dbgfs_fh_reg_read(struct file *file, ...@@ -1342,7 +1342,7 @@ static ssize_t iwl_dbgfs_fh_reg_read(struct file *file,
char __user *user_buf, char __user *user_buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
struct iwl_priv *priv = (struct iwl_priv *)file->private_data; struct iwl_priv *priv = file->private_data;
char *buf; char *buf;
int pos = 0; int pos = 0;
ssize_t ret = -EFAULT; ssize_t ret = -EFAULT;
...@@ -1404,7 +1404,7 @@ static ssize_t iwl_dbgfs_plcp_delta_read(struct file *file, ...@@ -1404,7 +1404,7 @@ static ssize_t iwl_dbgfs_plcp_delta_read(struct file *file,
char __user *user_buf, char __user *user_buf,
size_t count, loff_t *ppos) { size_t count, loff_t *ppos) {
struct iwl_priv *priv = (struct iwl_priv *)file->private_data; struct iwl_priv *priv = file->private_data;
int pos = 0; int pos = 0;
char buf[12]; char buf[12];
const size_t bufsz = sizeof(buf); const size_t bufsz = sizeof(buf);
......
...@@ -905,7 +905,7 @@ static ssize_t lbs_debugfs_read(struct file *file, char __user *userbuf, ...@@ -905,7 +905,7 @@ static ssize_t lbs_debugfs_read(struct file *file, char __user *userbuf,
p = buf; p = buf;
d = (struct debug_data *)file->private_data; d = file->private_data;
for (i = 0; i < num_of_items; i++) { for (i = 0; i < num_of_items; i++) {
if (d[i].size == 1) if (d[i].size == 1)
...@@ -944,7 +944,7 @@ static ssize_t lbs_debugfs_write(struct file *f, const char __user *buf, ...@@ -944,7 +944,7 @@ static ssize_t lbs_debugfs_write(struct file *f, const char __user *buf,
char *p0; char *p0;
char *p1; char *p1;
char *p2; char *p2;
struct debug_data *d = (struct debug_data *)f->private_data; struct debug_data *d = f->private_data;
pdata = kmalloc(cnt, GFP_KERNEL); pdata = kmalloc(cnt, GFP_KERNEL);
if (pdata == NULL) if (pdata == NULL)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment