Skip to content

Commit

Permalink
Staging: Remove unnecessary casts of private_data
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Joe Perches authored and Greg Kroah-Hartman committed Jul 22, 2010
1 parent f69b0d6 commit ba952d8
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 16 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/batman-adv/bat_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ static int log_release(struct inode *inode, struct file *file)
static ssize_t log_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
struct bat_priv *bat_priv = (struct bat_priv *)file->private_data;
struct bat_priv *bat_priv = file->private_data;
struct debug_log *debug_log = bat_priv->debug_log;
int error, i = 0;
char c;
Expand Down Expand Up @@ -158,7 +158,7 @@ static ssize_t log_read(struct file *file, char __user *buf,

static unsigned int log_poll(struct file *file, poll_table *wait)
{
struct bat_priv *bat_priv = (struct bat_priv *)file->private_data;
struct bat_priv *bat_priv = file->private_data;
struct debug_log *debug_log = bat_priv->debug_log;

poll_wait(file, &debug_log->queue_wait, wait);
Expand Down
12 changes: 4 additions & 8 deletions drivers/staging/batman-adv/icmp_socket.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ static int bat_socket_open(struct inode *inode, struct file *file)

static int bat_socket_release(struct inode *inode, struct file *file)
{
struct socket_client *socket_client =
(struct socket_client *)file->private_data;
struct socket_client *socket_client = file->private_data;
struct socket_packet *socket_packet;
struct list_head *list_pos, *list_pos_tmp;
unsigned long flags;
Expand Down Expand Up @@ -107,8 +106,7 @@ static int bat_socket_release(struct inode *inode, struct file *file)
static ssize_t bat_socket_read(struct file *file, char __user *buf,
size_t count, loff_t *ppos)
{
struct socket_client *socket_client =
(struct socket_client *)file->private_data;
struct socket_client *socket_client = file->private_data;
struct socket_packet *socket_packet;
size_t packet_len;
int error;
Expand Down Expand Up @@ -155,8 +153,7 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
{
/* FIXME: each orig_node->batman_if will be attached to a softif */
struct bat_priv *bat_priv = netdev_priv(soft_device);
struct socket_client *socket_client =
(struct socket_client *)file->private_data;
struct socket_client *socket_client = file->private_data;
struct icmp_packet_rr icmp_packet;
struct orig_node *orig_node;
struct batman_if *batman_if;
Expand Down Expand Up @@ -247,8 +244,7 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,

static unsigned int bat_socket_poll(struct file *file, poll_table *wait)
{
struct socket_client *socket_client =
(struct socket_client *)file->private_data;
struct socket_client *socket_client = file->private_data;

poll_wait(file, &socket_client->queue_wait, wait);

Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/cx25821/cx25821-alsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ static int cx25821_audio_initdev(struct cx25821_dev *dev)

/* Card "creation" */
card->private_free = snd_cx25821_dev_free;
chip = (struct cx25821_audio_dev *) card->private_data;
chip = card->private_data;
spin_lock_init(&chip->reg_lock);

chip->dev = dev;
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/easycap/easycap_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -791,7 +791,7 @@ static struct easycap *peasycap;
static struct usb_device *p;
static __u32 isequence;

peasycap = (struct easycap *)file->private_data;
peasycap = file->private_data;
if (NULL == peasycap) {
SAY("ERROR: peasycap is NULL\n");
return -1;
Expand Down Expand Up @@ -1973,7 +1973,7 @@ int easysnd_ioctl(struct inode *inode, struct file *file, \
struct easycap *peasycap;
struct usb_device *p;

peasycap = (struct easycap *)file->private_data;
peasycap = file->private_data;
if (NULL == peasycap) {
SAY("ERROR: peasycap is NULL.\n");
return -1;
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/easycap/easycap_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ struct easycap *peasycap;

JOT(4, "\n");

peasycap = (struct easycap *)file->private_data;
peasycap = file->private_data;
if (NULL == peasycap) {
SAY("ERROR: peasycap is NULL.\n");
SAY("ending unsuccessfully\n");
Expand Down Expand Up @@ -819,7 +819,7 @@ if (NULL == ((struct file *)file)) {
SAY("ERROR: file pointer is NULL\n");
return -EFAULT;
}
peasycap = (struct easycap *)file->private_data;
peasycap = file->private_data;
if (NULL == peasycap) {
SAY("ERROR: peasycap is NULL\n");
return -EFAULT;
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/easycap/easycap_sound.c
Original file line number Diff line number Diff line change
Expand Up @@ -630,7 +630,7 @@ struct easycap *peasycap;

JOT(4, "begins\n");

peasycap = (struct easycap *)file->private_data;
peasycap = file->private_data;
if (NULL == peasycap) {
SAY("ERROR: peasycap is NULL.\n");
return -EFAULT;
Expand Down

0 comments on commit ba952d8

Please sign in to comment.