2010-07-12 20:50:32

by Joe Perches

[permalink] [raw]
Subject: [PATCH 00/36] Remove unnecessary casts of private_data

private_data is a void *, so remove the unnecessary casts

Joe Perches (36):
arch/cris: Remove unnecessary casts of private_data
arch/ia64: Remove unnecessary casts of private_data
arch/powerpc: Remove unnecessary casts of private_data
arch/s390: Remove unnecessary casts of private_data
drivers/bluetooth: Remove unnecessary casts of private_data
drivers/char: Remove unnecessary casts of private_data
drivers/gpu: Remove unnecessary casts of private_data
drivers/ieee1394: Remove unnecessary casts of private_data
drivers/infiniband: Remove unnecessary casts of private_data
drivers/isdn: Remove unnecessary casts of private_data
drivers/media: Remove unnecessary casts of private_data
drivers/misc: Remove unnecessary casts of private_data
drivers/net/caif: Remove unnecessary casts of private_data
drivers/net/wireless: Remove unnecessary casts of private_data
drivers/s390: Remove unnecessary casts of private_data
drivers/sbus: Remove unnecessary casts of private_data
drivers/scsi: Remove unnecessary casts of private_data
drivers/staging: Remove unnecessary casts of private_data
drivers/usb/gadget: Remove unnecessary casts of private_data
drivers/usb/misc: Remove unnecessary casts of private_data
drivers/usb: Remove unnecessary casts of private_data
fs/cifs: Remove unnecessary casts of private_data
fs/coda: Remove unnecessary casts of private_data
fs/ecryptfs: Remove unnecessary casts of private_data
fs/ext3: Remove unnecessary casts of private_data
fs/ext4: Remove unnecessary casts of private_data
fs/ocfs2: Remove unnecessary casts of private_data
fs: Remove unnecessary casts of private_data
kernel/trace: Remove unnecessary casts of private_data
kernel: Remove unnecessary casts of private_data
net/core: Remove unnecessary casts of private_data
net/irda: Remove unnecessary casts of private_data
net/sunrpc: Remove unnecessary casts of private_data
sound/soc/blackfin: Remove unnecessary casts of private_data
sound/soc/davinci: Remove unnecessary casts of private_data
sound/core: Remove unnecessary casts of private_data

arch/cris/arch-v32/drivers/mach-fs/gpio.c | 10 +++++-----
arch/ia64/kernel/perfmon.c | 12 ++++++------
arch/powerpc/kvm/timing.c | 2 +-
arch/s390/kernel/debug.c | 6 +++---
drivers/bluetooth/btmrvl_debugfs.c | 2 +-
drivers/char/snsc.c | 8 ++++----
drivers/gpu/drm/radeon/radeon_ttm.c | 2 +-
drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c | 2 +-
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c | 2 +-
drivers/ieee1394/dv1394.c | 4 ++--
drivers/ieee1394/raw1394.c | 4 ++--
drivers/ieee1394/video1394.c | 6 +++---
drivers/infiniband/hw/ipath/ipath_file_ops.c | 2 +-
drivers/isdn/capi/capi.c | 6 +++---
drivers/isdn/hysdn/hysdn_proclog.c | 2 +-
drivers/isdn/i4l/isdn_ppp.c | 2 +-
drivers/media/IR/imon.c | 6 +++---
drivers/media/common/saa7146_vbi.c | 4 ++--
drivers/media/common/saa7146_video.c | 4 ++--
drivers/media/dvb/bt8xx/dst_ca.c | 2 +-
drivers/media/video/cx18/cx18-ioctl.c | 2 +-
drivers/media/video/cx88/cx88-alsa.c | 2 +-
drivers/media/video/hdpvr/hdpvr-video.c | 4 ++--
drivers/media/video/mem2mem_testdev.c | 4 ++--
drivers/media/video/saa7134/saa7134-alsa.c | 2 +-
drivers/media/video/uvc/uvc_v4l2.c | 8 ++++----
drivers/misc/ibmasm/ibmasmfs.c | 4 ++--
drivers/net/caif/caif_spi.c | 4 ++--
drivers/net/wireless/airo.c | 22 +++++++++++-----------
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 9 +++------
drivers/net/wireless/iwlwifi/iwl-debugfs.c | 10 +++++-----
drivers/net/wireless/libertas/debugfs.c | 4 ++--
drivers/s390/block/dasd_eer.c | 6 +++---
drivers/s390/char/tape_block.c | 4 ++--
drivers/s390/char/tape_char.c | 8 ++++----
drivers/s390/char/vmcp.c | 6 +++---
drivers/sbus/char/openprom.c | 4 ++--
drivers/scsi/aacraid/linit.c | 2 +-
drivers/scsi/pmcraid.c | 7 +++----
drivers/scsi/sg.c | 18 +++++++++---------
drivers/staging/batman-adv/bat_debugfs.c | 4 ++--
drivers/staging/batman-adv/icmp_socket.c | 12 ++++--------
drivers/staging/cx25821/cx25821-alsa.c | 2 +-
drivers/staging/easycap/easycap_ioctl.c | 4 ++--
drivers/staging/easycap/easycap_main.c | 4 ++--
drivers/staging/easycap/easycap_sound.c | 2 +-
drivers/usb/gadget/f_hid.c | 6 +++---
drivers/usb/misc/ftdi-elan.c | 4 ++--
drivers/usb/misc/iowarrior.c | 8 ++++----
drivers/usb/misc/legousbtower.c | 6 +++---
drivers/usb/misc/sisusbvga/sisusb.c | 10 +++++-----
drivers/usb/misc/usblcd.c | 8 ++++----
drivers/usb/usb-skeleton.c | 8 ++++----
fs/cifs/file.c | 24 ++++++++++--------------
fs/cifs/inode.c | 4 ++--
fs/cifs/ioctl.c | 3 +--
fs/coda/psdev.c | 8 ++++----
fs/ecryptfs/ecryptfs_kernel.h | 2 +-
fs/ext3/dir.c | 2 +-
fs/ext4/dir.c | 2 +-
fs/ext4/mballoc.c | 2 +-
fs/ocfs2/dlm/dlmdebug.c | 6 +++---
fs/ocfs2/dlmfs/dlmfs.c | 3 +--
fs/ocfs2/dlmglue.c | 4 ++--
fs/seq_file.c | 6 +++---
kernel/pm_qos_params.c | 2 +-
kernel/trace/ftrace.c | 4 ++--
kernel/trace/trace.c | 2 +-
net/core/pktgen.c | 4 ++--
net/irda/irnet/irnet_ppp.c | 10 +++++-----
net/sunrpc/rpc_pipe.c | 4 ++--
sound/core/oss/mixer_oss.c | 22 +++++++++++-----------
sound/core/pcm.c | 3 +--
sound/core/timer.c | 4 ++--
sound/soc/blackfin/bf5xx-ac97.c | 6 ++----
sound/soc/blackfin/bf5xx-tdm.c | 6 ++----
sound/soc/davinci/davinci-pcm.c | 2 +-
77 files changed, 206 insertions(+), 225 deletions(-)


2010-07-12 20:50:52

by Joe Perches

[permalink] [raw]
Subject: [PATCH 16/36] drivers/sbus: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
drivers/sbus/char/openprom.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/sbus/char/openprom.c b/drivers/sbus/char/openprom.c
index d53e62a..aacbe14 100644
--- a/drivers/sbus/char/openprom.c
+++ b/drivers/sbus/char/openprom.c
@@ -554,7 +554,7 @@ static int opiocgetnext(unsigned int cmd, void __user *argp)
static int openprom_bsd_ioctl(struct file * file,
unsigned int cmd, unsigned long arg)
{
- DATA *data = (DATA *) file->private_data;
+ DATA *data = file->private_data;
void __user *argp = (void __user *)arg;
int err;

@@ -601,7 +601,7 @@ static int openprom_bsd_ioctl(struct file * file,
static long openprom_ioctl(struct file * file,
unsigned int cmd, unsigned long arg)
{
- DATA *data = (DATA *) file->private_data;
+ DATA *data = file->private_data;

switch (cmd) {
case OPROMGETOPT:
--
1.7.1.337.g6068.dirty

2010-07-12 20:51:05

by Joe Perches

[permalink] [raw]
Subject: [PATCH 26/36] fs/ext4: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
fs/ext4/dir.c | 2 +-
fs/ext4/mballoc.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c
index ea5e6cb..737bf12 100644
--- a/fs/ext4/dir.c
+++ b/fs/ext4/dir.c
@@ -343,7 +343,7 @@ int ext4_htree_store_dirent(struct file *dir_file, __u32 hash,
struct dir_private_info *info;
int len;

- info = (struct dir_private_info *) dir_file->private_data;
+ info = dir_file->private_data;
p = &info->root.rb_node;

/* Create and allocate the fname structure */
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 12b3bc0..204588d 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2221,7 +2221,7 @@ static int ext4_mb_seq_groups_open(struct inode *inode, struct file *file)

rc = seq_open(file, &ext4_mb_seq_groups_ops);
if (rc == 0) {
- struct seq_file *m = (struct seq_file *)file->private_data;
+ struct seq_file *m = file->private_data;
m->private = sb;
}
return rc;
--
1.7.1.337.g6068.dirty

2010-07-12 20:51:12

by Joe Perches

[permalink] [raw]
Subject: [PATCH 33/36] net/sunrpc: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
net/sunrpc/rpc_pipe.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c
index 95ccbcf..1f7fc50 100644
--- a/net/sunrpc/rpc_pipe.c
+++ b/net/sunrpc/rpc_pipe.c
@@ -204,7 +204,7 @@ rpc_pipe_release(struct inode *inode, struct file *filp)
mutex_lock(&inode->i_mutex);
if (rpci->ops == NULL)
goto out;
- msg = (struct rpc_pipe_msg *)filp->private_data;
+ msg = filp->private_data;
if (msg != NULL) {
spin_lock(&inode->i_lock);
msg->errno = -EAGAIN;
@@ -322,7 +322,7 @@ rpc_pipe_ioctl_unlocked(struct file *filp, unsigned int cmd, unsigned long arg)
len = rpci->pipelen;
if (filp->private_data) {
struct rpc_pipe_msg *msg;
- msg = (struct rpc_pipe_msg *)filp->private_data;
+ msg = filp->private_data;
len += msg->len - msg->copied;
}
return put_user(len, (int __user *)arg);
--
1.7.1.337.g6068.dirty

2010-07-12 20:51:18

by Joe Perches

[permalink] [raw]
Subject: [PATCH 29/36] kernel/trace: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
kernel/trace/ftrace.c | 4 ++--
kernel/trace/trace.c | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 0d88ce9..0691e87 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -1592,7 +1592,7 @@ ftrace_failures_open(struct inode *inode, struct file *file)

ret = ftrace_avail_open(inode, file);
if (!ret) {
- m = (struct seq_file *)file->private_data;
+ m = file->private_data;
iter = (struct ftrace_iterator *)m->private;
iter->flags = FTRACE_ITER_FAILURES;
}
@@ -2349,7 +2349,7 @@ static void __init set_ftrace_early_filters(void)
static int
ftrace_regex_release(struct inode *inode, struct file *file, int enable)
{
- struct seq_file *m = (struct seq_file *)file->private_data;
+ struct seq_file *m = file->private_data;
struct ftrace_iterator *iter;
struct trace_parser *parser;

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 8683dec..10b82a1 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -2257,7 +2257,7 @@ int tracing_open_generic(struct inode *inode, struct file *filp)

static int tracing_release(struct inode *inode, struct file *file)
{
- struct seq_file *m = (struct seq_file *)file->private_data;
+ struct seq_file *m = file->private_data;
struct trace_iterator *iter;
int cpu;

--
1.7.1.337.g6068.dirty

2010-07-12 20:51:23

by Joe Perches

[permalink] [raw]
Subject: [PATCH 35/36] sound/soc/davinci: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
sound/soc/davinci/davinci-pcm.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/sound/soc/davinci/davinci-pcm.c b/sound/soc/davinci/davinci-pcm.c
index 2dc406f..def454e 100644
--- a/sound/soc/davinci/davinci-pcm.c
+++ b/sound/soc/davinci/davinci-pcm.c
@@ -800,7 +800,7 @@ static void davinci_pcm_free(struct snd_pcm *pcm)
dma_free_writecombine(pcm->card->dev, buf->bytes,
buf->area, buf->addr);
buf->area = NULL;
- iram_dma = (struct snd_dma_buffer *)buf->private_data;
+ iram_dma = buf->private_data;
if (iram_dma) {
sram_free(iram_dma->area, iram_dma->bytes);
kfree(iram_dma);
--
1.7.1.337.g6068.dirty

2010-07-12 20:51:14

by Joe Perches

[permalink] [raw]
Subject: [PATCH 31/36] net/core: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
net/core/pktgen.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 1ee2ebd..24a19de 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -846,7 +846,7 @@ static ssize_t pktgen_if_write(struct file *file,
const char __user * user_buffer, size_t count,
loff_t * offset)
{
- struct seq_file *seq = (struct seq_file *)file->private_data;
+ struct seq_file *seq = file->private_data;
struct pktgen_dev *pkt_dev = seq->private;
int i = 0, max, len;
char name[16], valstr[32];
@@ -1776,7 +1776,7 @@ static ssize_t pktgen_thread_write(struct file *file,
const char __user * user_buffer,
size_t count, loff_t * offset)
{
- struct seq_file *seq = (struct seq_file *)file->private_data;
+ struct seq_file *seq = file->private_data;
struct pktgen_thread *t = seq->private;
int i = 0, max, len, ret;
char name[40];
--
1.7.1.337.g6068.dirty

2010-07-12 20:51:20

by Joe Perches

[permalink] [raw]
Subject: [PATCH 32/36] net/irda: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
net/irda/irnet/irnet_ppp.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/net/irda/irnet/irnet_ppp.c b/net/irda/irnet/irnet_ppp.c
index 6a1a202..800bc53 100644
--- a/net/irda/irnet/irnet_ppp.c
+++ b/net/irda/irnet/irnet_ppp.c
@@ -527,7 +527,7 @@ static int
dev_irnet_close(struct inode * inode,
struct file * file)
{
- irnet_socket * ap = (struct irnet_socket *) file->private_data;
+ irnet_socket * ap = file->private_data;

DENTER(FS_TRACE, "(file=0x%p, ap=0x%p)\n",
file, ap);
@@ -564,7 +564,7 @@ dev_irnet_write(struct file * file,
size_t count,
loff_t * ppos)
{
- irnet_socket * ap = (struct irnet_socket *) file->private_data;
+ irnet_socket * ap = file->private_data;

DPASS(FS_TRACE, "(file=0x%p, ap=0x%p, count=%Zd)\n",
file, ap, count);
@@ -588,7 +588,7 @@ dev_irnet_read(struct file * file,
size_t count,
loff_t * ppos)
{
- irnet_socket * ap = (struct irnet_socket *) file->private_data;
+ irnet_socket * ap = file->private_data;

DPASS(FS_TRACE, "(file=0x%p, ap=0x%p, count=%Zd)\n",
file, ap, count);
@@ -609,7 +609,7 @@ static unsigned int
dev_irnet_poll(struct file * file,
poll_table * wait)
{
- irnet_socket * ap = (struct irnet_socket *) file->private_data;
+ irnet_socket * ap = file->private_data;
unsigned int mask;

DENTER(FS_TRACE, "(file=0x%p, ap=0x%p)\n",
@@ -638,7 +638,7 @@ dev_irnet_ioctl(
unsigned int cmd,
unsigned long arg)
{
- irnet_socket * ap = (struct irnet_socket *) file->private_data;
+ irnet_socket * ap = file->private_data;
int err;
int val;
void __user *argp = (void __user *)arg;
--
1.7.1.337.g6068.dirty

2010-07-12 20:52:06

by Joe Perches

[permalink] [raw]
Subject: [PATCH 34/36] sound/soc/blackfin: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
sound/soc/blackfin/bf5xx-ac97.c | 6 ++----
sound/soc/blackfin/bf5xx-tdm.c | 6 ++----
2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/sound/soc/blackfin/bf5xx-ac97.c b/sound/soc/blackfin/bf5xx-ac97.c
index 523b7fc..c0eba51 100644
--- a/sound/soc/blackfin/bf5xx-ac97.c
+++ b/sound/soc/blackfin/bf5xx-ac97.c
@@ -255,8 +255,7 @@ EXPORT_SYMBOL_GPL(soc_ac97_ops);
#ifdef CONFIG_PM
static int bf5xx_ac97_suspend(struct snd_soc_dai *dai)
{
- struct sport_device *sport =
- (struct sport_device *)dai->private_data;
+ struct sport_device *sport = dai->private_data;

pr_debug("%s : sport %d\n", __func__, dai->id);
if (!dai->active)
@@ -271,8 +270,7 @@ static int bf5xx_ac97_suspend(struct snd_soc_dai *dai)
static int bf5xx_ac97_resume(struct snd_soc_dai *dai)
{
int ret;
- struct sport_device *sport =
- (struct sport_device *)dai->private_data;
+ struct sport_device *sport = dai->private_data;

pr_debug("%s : sport %d\n", __func__, dai->id);
if (!dai->active)
diff --git a/sound/soc/blackfin/bf5xx-tdm.c b/sound/soc/blackfin/bf5xx-tdm.c
index 4b36012..24c1426 100644
--- a/sound/soc/blackfin/bf5xx-tdm.c
+++ b/sound/soc/blackfin/bf5xx-tdm.c
@@ -210,8 +210,7 @@ static int bf5xx_tdm_set_channel_map(struct snd_soc_dai *dai,
#ifdef CONFIG_PM
static int bf5xx_tdm_suspend(struct snd_soc_dai *dai)
{
- struct sport_device *sport =
- (struct sport_device *)dai->private_data;
+ struct sport_device *sport = dai->private_data;

if (!dai->active)
return 0;
@@ -225,8 +224,7 @@ static int bf5xx_tdm_suspend(struct snd_soc_dai *dai)
static int bf5xx_tdm_resume(struct snd_soc_dai *dai)
{
int ret;
- struct sport_device *sport =
- (struct sport_device *)dai->private_data;
+ struct sport_device *sport = dai->private_data;

if (!dai->active)
return 0;
--
1.7.1.337.g6068.dirty

2010-07-12 20:52:41

by Joe Perches

[permalink] [raw]
Subject: [PATCH 30/36] kernel: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
kernel/pm_qos_params.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/pm_qos_params.c b/kernel/pm_qos_params.c
index 14b757f..c8aa61c 100644
--- a/kernel/pm_qos_params.c
+++ b/kernel/pm_qos_params.c
@@ -394,7 +394,7 @@ static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf,
} else
return -EINVAL;

- pm_qos_req = (struct pm_qos_request_list *)filp->private_data;
+ pm_qos_req = filp->private_data;
pm_qos_update_request(pm_qos_req, value);

return count;
--
1.7.1.337.g6068.dirty

2010-07-12 20:52:39

by Joe Perches

[permalink] [raw]
Subject: [PATCH 27/36] fs/ocfs2: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
fs/ocfs2/dlm/dlmdebug.c | 6 +++---
fs/ocfs2/dlmfs/dlmfs.c | 3 +--
fs/ocfs2/dlmglue.c | 4 ++--
3 files changed, 6 insertions(+), 7 deletions(-)

diff --git a/fs/ocfs2/dlm/dlmdebug.c b/fs/ocfs2/dlm/dlmdebug.c
index 0cd24cf..5efdd37 100644
--- a/fs/ocfs2/dlm/dlmdebug.c
+++ b/fs/ocfs2/dlm/dlmdebug.c
@@ -419,7 +419,7 @@ static loff_t debug_buffer_llseek(struct file *file, loff_t off, int whence)

static int debug_buffer_release(struct inode *inode, struct file *file)
{
- struct debug_buffer *db = (struct debug_buffer *)file->private_data;
+ struct debug_buffer *db = file->private_data;

if (db)
kfree(db->buf);
@@ -715,7 +715,7 @@ static int debug_lockres_open(struct inode *inode, struct file *file)
goto bail;
}

- seq = (struct seq_file *) file->private_data;
+ seq = file->private_data;
seq->private = dl;

dlm_grab(dlm);
@@ -731,7 +731,7 @@ bail:

static int debug_lockres_release(struct inode *inode, struct file *file)
{
- struct seq_file *seq = (struct seq_file *)file->private_data;
+ struct seq_file *seq = file->private_data;
struct debug_lockres *dl = (struct debug_lockres *)seq->private;

if (dl->dl_res)
diff --git a/fs/ocfs2/dlmfs/dlmfs.c b/fs/ocfs2/dlmfs/dlmfs.c
index a43ebb1..c2903b8 100644
--- a/fs/ocfs2/dlmfs/dlmfs.c
+++ b/fs/ocfs2/dlmfs/dlmfs.c
@@ -182,8 +182,7 @@ static int dlmfs_file_release(struct inode *inode,
{
int level, status;
struct dlmfs_inode_private *ip = DLMFS_I(inode);
- struct dlmfs_filp_private *fp =
- (struct dlmfs_filp_private *) file->private_data;
+ struct dlmfs_filp_private *fp = file->private_data;

if (S_ISDIR(inode->i_mode))
BUG();
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
index 39eb16a..5e02a89 100644
--- a/fs/ocfs2/dlmglue.c
+++ b/fs/ocfs2/dlmglue.c
@@ -2966,7 +2966,7 @@ static const struct seq_operations ocfs2_dlm_seq_ops = {

static int ocfs2_dlm_debug_release(struct inode *inode, struct file *file)
{
- struct seq_file *seq = (struct seq_file *) file->private_data;
+ struct seq_file *seq = file->private_data;
struct ocfs2_dlm_seq_priv *priv = seq->private;
struct ocfs2_lock_res *res = &priv->p_iter_res;

@@ -3000,7 +3000,7 @@ static int ocfs2_dlm_debug_open(struct inode *inode, struct file *file)
goto out;
}

- seq = (struct seq_file *) file->private_data;
+ seq = file->private_data;
seq->private = priv;

ocfs2_add_lockres_tracking(&priv->p_iter_res,
--
1.7.1.337.g6068.dirty

2010-07-12 20:52:27

by Joe Perches

[permalink] [raw]
Subject: [PATCH 36/36] sound/core: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
sound/core/oss/mixer_oss.c | 22 +++++++++++-----------
sound/core/pcm.c | 3 +--
sound/core/timer.c | 4 ++--
3 files changed, 14 insertions(+), 15 deletions(-)

diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c
index f50ebf2..86afb13 100644
--- a/sound/core/oss/mixer_oss.c
+++ b/sound/core/oss/mixer_oss.c
@@ -77,7 +77,7 @@ static int snd_mixer_oss_release(struct inode *inode, struct file *file)
struct snd_mixer_oss_file *fmixer;

if (file->private_data) {
- fmixer = (struct snd_mixer_oss_file *) file->private_data;
+ fmixer = file->private_data;
module_put(fmixer->card->module);
snd_card_file_remove(fmixer->card, file);
kfree(fmixer);
@@ -368,7 +368,7 @@ static int snd_mixer_oss_ioctl1(struct snd_mixer_oss_file *fmixer, unsigned int

static long snd_mixer_oss_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
- return snd_mixer_oss_ioctl1((struct snd_mixer_oss_file *) file->private_data, cmd, arg);
+ return snd_mixer_oss_ioctl1(file->private_data, cmd, arg);
}

int snd_mixer_oss_ioctl_card(struct snd_card *card, unsigned int cmd, unsigned long arg)
@@ -582,7 +582,7 @@ static int snd_mixer_oss_get_volume1(struct snd_mixer_oss_file *fmixer,
struct snd_mixer_oss_slot *pslot,
int *left, int *right)
{
- struct slot *slot = (struct slot *)pslot->private_data;
+ struct slot *slot = pslot->private_data;

*left = *right = 100;
if (slot->present & SNDRV_MIXER_OSS_PRESENT_PVOLUME) {
@@ -691,7 +691,7 @@ static int snd_mixer_oss_put_volume1(struct snd_mixer_oss_file *fmixer,
struct snd_mixer_oss_slot *pslot,
int left, int right)
{
- struct slot *slot = (struct slot *)pslot->private_data;
+ struct slot *slot = pslot->private_data;

if (slot->present & SNDRV_MIXER_OSS_PRESENT_PVOLUME) {
snd_mixer_oss_put_volume1_vol(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_PVOLUME], left, right);
@@ -740,7 +740,7 @@ static int snd_mixer_oss_get_recsrc1_sw(struct snd_mixer_oss_file *fmixer,
struct snd_mixer_oss_slot *pslot,
int *active)
{
- struct slot *slot = (struct slot *)pslot->private_data;
+ struct slot *slot = pslot->private_data;
int left, right;

left = right = 1;
@@ -753,7 +753,7 @@ static int snd_mixer_oss_get_recsrc1_route(struct snd_mixer_oss_file *fmixer,
struct snd_mixer_oss_slot *pslot,
int *active)
{
- struct slot *slot = (struct slot *)pslot->private_data;
+ struct slot *slot = pslot->private_data;
int left, right;

left = right = 1;
@@ -766,7 +766,7 @@ static int snd_mixer_oss_put_recsrc1_sw(struct snd_mixer_oss_file *fmixer,
struct snd_mixer_oss_slot *pslot,
int active)
{
- struct slot *slot = (struct slot *)pslot->private_data;
+ struct slot *slot = pslot->private_data;

snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CSWITCH], active, active, 0);
return 0;
@@ -776,7 +776,7 @@ static int snd_mixer_oss_put_recsrc1_route(struct snd_mixer_oss_file *fmixer,
struct snd_mixer_oss_slot *pslot,
int active)
{
- struct slot *slot = (struct slot *)pslot->private_data;
+ struct slot *slot = pslot->private_data;

snd_mixer_oss_put_volume1_sw(fmixer, pslot, slot->numid[SNDRV_MIXER_OSS_ITEM_CROUTE], active, active, 1);
return 0;
@@ -813,7 +813,7 @@ static int snd_mixer_oss_get_recsrc2(struct snd_mixer_oss_file *fmixer, unsigned
if (!(mixer->mask_recsrc & (1 << idx)))
continue;
pslot = &mixer->slots[idx];
- slot = (struct slot *)pslot->private_data;
+ slot = pslot->private_data;
if (slot->signature != SNDRV_MIXER_OSS_SIGNATURE)
continue;
if (!(slot->present & SNDRV_MIXER_OSS_PRESENT_CAPTURE))
@@ -861,7 +861,7 @@ static int snd_mixer_oss_put_recsrc2(struct snd_mixer_oss_file *fmixer, unsigned
if (!(mixer->mask_recsrc & (1 << idx)))
continue;
pslot = &mixer->slots[idx];
- slot = (struct slot *)pslot->private_data;
+ slot = pslot->private_data;
if (slot->signature != SNDRV_MIXER_OSS_SIGNATURE)
continue;
if (!(slot->present & SNDRV_MIXER_OSS_PRESENT_CAPTURE))
@@ -925,7 +925,7 @@ static int snd_mixer_oss_build_test(struct snd_mixer_oss *mixer, struct slot *sl

static void snd_mixer_oss_slot_free(struct snd_mixer_oss_slot *chn)
{
- struct slot *p = (struct slot *)chn->private_data;
+ struct slot *p = chn->private_data;
if (p) {
if (p->allocated && p->assigned) {
kfree(p->assigned->name);
diff --git a/sound/core/pcm.c b/sound/core/pcm.c
index cbe815d..de5a0eb 100644
--- a/sound/core/pcm.c
+++ b/sound/core/pcm.c
@@ -358,8 +358,7 @@ static void snd_pcm_stream_proc_info_read(struct snd_info_entry *entry,
static void snd_pcm_substream_proc_info_read(struct snd_info_entry *entry,
struct snd_info_buffer *buffer)
{
- snd_pcm_proc_info_read((struct snd_pcm_substream *)entry->private_data,
- buffer);
+ snd_pcm_proc_info_read(entry->private_data, buffer);
}

static void snd_pcm_substream_proc_hw_params_read(struct snd_info_entry *entry,
diff --git a/sound/core/timer.c b/sound/core/timer.c
index 13afb60..5ab1014 100644
--- a/sound/core/timer.c
+++ b/sound/core/timer.c
@@ -962,7 +962,7 @@ static int snd_timer_s_start(struct snd_timer * timer)
struct snd_timer_system_private *priv;
unsigned long njiff;

- priv = (struct snd_timer_system_private *) timer->private_data;
+ priv = timer->private_data;
njiff = (priv->last_jiffies = jiffies);
if (priv->correction > timer->sticks - 1) {
priv->correction -= timer->sticks - 1;
@@ -981,7 +981,7 @@ static int snd_timer_s_stop(struct snd_timer * timer)
struct snd_timer_system_private *priv;
unsigned long jiff;

- priv = (struct snd_timer_system_private *) timer->private_data;
+ priv = timer->private_data;
del_timer(&priv->tlist);
jiff = jiffies;
if (time_before(jiff, priv->last_expires))
--
1.7.1.337.g6068.dirty

2010-07-12 20:53:01

by Joe Perches

[permalink] [raw]
Subject: [PATCH 28/36] fs: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
fs/seq_file.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/seq_file.c b/fs/seq_file.c
index e1f437b..0e7cb13 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -131,7 +131,7 @@ Eoverflow:
*/
ssize_t seq_read(struct file *file, char __user *buf, size_t size, loff_t *ppos)
{
- struct seq_file *m = (struct seq_file *)file->private_data;
+ struct seq_file *m = file->private_data;
size_t copied = 0;
loff_t pos;
size_t n;
@@ -280,7 +280,7 @@ EXPORT_SYMBOL(seq_read);
*/
loff_t seq_lseek(struct file *file, loff_t offset, int origin)
{
- struct seq_file *m = (struct seq_file *)file->private_data;
+ struct seq_file *m = file->private_data;
loff_t retval = -EINVAL;

mutex_lock(&m->lock);
@@ -324,7 +324,7 @@ EXPORT_SYMBOL(seq_lseek);
*/
int seq_release(struct inode *inode, struct file *file)
{
- struct seq_file *m = (struct seq_file *)file->private_data;
+ struct seq_file *m = file->private_data;
kfree(m->buf);
kfree(m);
return 0;
--
1.7.1.337.g6068.dirty

2010-07-12 20:53:06

by Joe Perches

[permalink] [raw]
Subject: [PATCH 24/36] fs/ecryptfs: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
fs/ecryptfs/ecryptfs_kernel.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/ecryptfs/ecryptfs_kernel.h b/fs/ecryptfs/ecryptfs_kernel.h
index 0032a9f..40186b9 100644
--- a/fs/ecryptfs/ecryptfs_kernel.h
+++ b/fs/ecryptfs/ecryptfs_kernel.h
@@ -477,7 +477,7 @@ ecryptfs_lower_header_size(struct ecryptfs_crypt_stat *crypt_stat)
static inline struct ecryptfs_file_info *
ecryptfs_file_to_private(struct file *file)
{
- return (struct ecryptfs_file_info *)file->private_data;
+ return file->private_data;
}

static inline void
--
1.7.1.337.g6068.dirty

2010-07-12 20:53:10

by Joe Perches

[permalink] [raw]
Subject: [PATCH 23/36] fs/coda: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
fs/coda/psdev.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/coda/psdev.c b/fs/coda/psdev.c
index 66b9cf7..2c4fd44 100644
--- a/fs/coda/psdev.c
+++ b/fs/coda/psdev.c
@@ -63,7 +63,7 @@ static struct class *coda_psdev_class;

static unsigned int coda_psdev_poll(struct file *file, poll_table * wait)
{
- struct venus_comm *vcp = (struct venus_comm *) file->private_data;
+ struct venus_comm *vcp = file->private_data;
unsigned int mask = POLLOUT | POLLWRNORM;

poll_wait(file, &vcp->vc_waitq, wait);
@@ -95,7 +95,7 @@ static long coda_psdev_ioctl(struct file * filp, unsigned int cmd, unsigned long
static ssize_t coda_psdev_write(struct file *file, const char __user *buf,
size_t nbytes, loff_t *off)
{
- struct venus_comm *vcp = (struct venus_comm *) file->private_data;
+ struct venus_comm *vcp = file->private_data;
struct upc_req *req = NULL;
struct upc_req *tmp;
struct list_head *lh;
@@ -209,7 +209,7 @@ static ssize_t coda_psdev_read(struct file * file, char __user * buf,
size_t nbytes, loff_t *off)
{
DECLARE_WAITQUEUE(wait, current);
- struct venus_comm *vcp = (struct venus_comm *) file->private_data;
+ struct venus_comm *vcp = file->private_data;
struct upc_req *req;
ssize_t retval = 0, count = 0;

@@ -300,7 +300,7 @@ static int coda_psdev_open(struct inode * inode, struct file * file)

static int coda_psdev_release(struct inode * inode, struct file * file)
{
- struct venus_comm *vcp = (struct venus_comm *) file->private_data;
+ struct venus_comm *vcp = file->private_data;
struct upc_req *req, *tmp;

if (!vcp || !vcp->vc_inuse ) {
--
1.7.1.337.g6068.dirty

2010-07-12 20:51:00

by Joe Perches

[permalink] [raw]
Subject: [PATCH 21/36] drivers/usb: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
drivers/usb/usb-skeleton.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c
index d110588..552679b 100644
--- a/drivers/usb/usb-skeleton.c
+++ b/drivers/usb/usb-skeleton.c
@@ -142,7 +142,7 @@ static int skel_release(struct inode *inode, struct file *file)
{
struct usb_skel *dev;

- dev = (struct usb_skel *)file->private_data;
+ dev = file->private_data;
if (dev == NULL)
return -ENODEV;

@@ -162,7 +162,7 @@ static int skel_flush(struct file *file, fl_owner_t id)
struct usb_skel *dev;
int res;

- dev = (struct usb_skel *)file->private_data;
+ dev = file->private_data;
if (dev == NULL)
return -ENODEV;

@@ -246,7 +246,7 @@ static ssize_t skel_read(struct file *file, char *buffer, size_t count,
int rv;
bool ongoing_io;

- dev = (struct usb_skel *)file->private_data;
+ dev = file->private_data;

/* if we cannot read at all, return EOF */
if (!dev->bulk_in_urb || !count)
@@ -401,7 +401,7 @@ static ssize_t skel_write(struct file *file, const char *user_buffer,
char *buf = NULL;
size_t writesize = min(count, (size_t)MAX_TRANSFER);

- dev = (struct usb_skel *)file->private_data;
+ dev = file->private_data;

/* verify that we actually have some data to write */
if (count == 0)
--
1.7.1.337.g6068.dirty

2010-07-12 20:53:44

by Joe Perches

[permalink] [raw]
Subject: [PATCH 25/36] fs/ext3: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
fs/ext3/dir.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/ext3/dir.c b/fs/ext3/dir.c
index e2e72c3..d056787 100644
--- a/fs/ext3/dir.c
+++ b/fs/ext3/dir.c
@@ -337,7 +337,7 @@ int ext3_htree_store_dirent(struct file *dir_file, __u32 hash,
struct dir_private_info *info;
int len;

- info = (struct dir_private_info *) dir_file->private_data;
+ info = dir_file->private_data;
p = &info->root.rb_node;

/* Create and allocate the fname structure */
--
1.7.1.337.g6068.dirty

2010-07-12 20:50:58

by Joe Perches

[permalink] [raw]
Subject: [PATCH 20/36] drivers/usb/misc: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
drivers/usb/misc/ftdi-elan.c | 4 ++--
drivers/usb/misc/iowarrior.c | 8 ++++----
drivers/usb/misc/legousbtower.c | 6 +++---
drivers/usb/misc/sisusbvga/sisusb.c | 10 +++++-----
drivers/usb/misc/usblcd.c | 8 ++++----
5 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/usb/misc/ftdi-elan.c b/drivers/usb/misc/ftdi-elan.c
index 82e1663..aecf380 100644
--- a/drivers/usb/misc/ftdi-elan.c
+++ b/drivers/usb/misc/ftdi-elan.c
@@ -650,7 +650,7 @@ static int ftdi_elan_open(struct inode *inode, struct file *file)

static int ftdi_elan_release(struct inode *inode, struct file *file)
{
- struct usb_ftdi *ftdi = (struct usb_ftdi *)file->private_data;
+ struct usb_ftdi *ftdi = file->private_data;
if (ftdi == NULL)
return -ENODEV;
up(&ftdi->sw_lock); /* decrement the count on our device */
@@ -673,7 +673,7 @@ static ssize_t ftdi_elan_read(struct file *file, char __user *buffer,
int bytes_read = 0;
int retry_on_empty = 10;
int retry_on_timeout = 5;
- struct usb_ftdi *ftdi = (struct usb_ftdi *)file->private_data;
+ struct usb_ftdi *ftdi = file->private_data;
if (ftdi->disconnected > 0) {
return -ENODEV;
}
diff --git a/drivers/usb/misc/iowarrior.c b/drivers/usb/misc/iowarrior.c
index 7dc9d3c..e81ac00 100644
--- a/drivers/usb/misc/iowarrior.c
+++ b/drivers/usb/misc/iowarrior.c
@@ -282,7 +282,7 @@ static ssize_t iowarrior_read(struct file *file, char __user *buffer,
int read_idx;
int offset;

- dev = (struct iowarrior *)file->private_data;
+ dev = file->private_data;

/* verify that the device wasn't unplugged */
if (dev == NULL || !dev->present)
@@ -348,7 +348,7 @@ static ssize_t iowarrior_write(struct file *file,
char *buf = NULL; /* for IOW24 and IOW56 we need a buffer */
struct urb *int_out_urb = NULL;

- dev = (struct iowarrior *)file->private_data;
+ dev = file->private_data;

mutex_lock(&dev->mutex);
/* verify that the device wasn't unplugged */
@@ -483,7 +483,7 @@ static long iowarrior_ioctl(struct file *file, unsigned int cmd,
int retval;
int io_res; /* checks for bytes read/written and copy_to/from_user results */

- dev = (struct iowarrior *)file->private_data;
+ dev = file->private_data;
if (dev == NULL) {
return -ENODEV;
}
@@ -656,7 +656,7 @@ static int iowarrior_release(struct inode *inode, struct file *file)
struct iowarrior *dev;
int retval = 0;

- dev = (struct iowarrior *)file->private_data;
+ dev = file->private_data;
if (dev == NULL) {
return -ENODEV;
}
diff --git a/drivers/usb/misc/legousbtower.c b/drivers/usb/misc/legousbtower.c
index 8547bf9..6482c6e 100644
--- a/drivers/usb/misc/legousbtower.c
+++ b/drivers/usb/misc/legousbtower.c
@@ -448,7 +448,7 @@ static int tower_release (struct inode *inode, struct file *file)

dbg(2, "%s: enter", __func__);

- dev = (struct lego_usb_tower *)file->private_data;
+ dev = file->private_data;

if (dev == NULL) {
dbg(1, "%s: object is NULL", __func__);
@@ -597,7 +597,7 @@ static ssize_t tower_read (struct file *file, char __user *buffer, size_t count,

dbg(2, "%s: enter, count = %Zd", __func__, count);

- dev = (struct lego_usb_tower *)file->private_data;
+ dev = file->private_data;

/* lock this object */
if (mutex_lock_interruptible(&dev->lock)) {
@@ -686,7 +686,7 @@ static ssize_t tower_write (struct file *file, const char __user *buffer, size_t

dbg(2, "%s: enter, count = %Zd", __func__, count);

- dev = (struct lego_usb_tower *)file->private_data;
+ dev = file->private_data;

/* lock this object */
if (mutex_lock_interruptible(&dev->lock)) {
diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c
index 30d9303..045120e 100644
--- a/drivers/usb/misc/sisusbvga/sisusb.c
+++ b/drivers/usb/misc/sisusbvga/sisusb.c
@@ -2486,7 +2486,7 @@ sisusb_release(struct inode *inode, struct file *file)
{
struct sisusb_usb_data *sisusb;

- if (!(sisusb = (struct sisusb_usb_data *)file->private_data))
+ if (!(sisusb = file->private_data))
return -ENODEV;

mutex_lock(&sisusb->lock);
@@ -2518,7 +2518,7 @@ sisusb_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
u16 buf16;
u32 buf32, address;

- if (!(sisusb = (struct sisusb_usb_data *)file->private_data))
+ if (!(sisusb = file->private_data))
return -ENODEV;

mutex_lock(&sisusb->lock);
@@ -2660,7 +2660,7 @@ sisusb_write(struct file *file, const char __user *buffer, size_t count,
u16 buf16;
u32 buf32, address;

- if (!(sisusb = (struct sisusb_usb_data *)file->private_data))
+ if (!(sisusb = file->private_data))
return -ENODEV;

mutex_lock(&sisusb->lock);
@@ -2803,7 +2803,7 @@ sisusb_lseek(struct file *file, loff_t offset, int orig)
struct sisusb_usb_data *sisusb;
loff_t ret;

- if (!(sisusb = (struct sisusb_usb_data *)file->private_data))
+ if (!(sisusb = file->private_data))
return -ENODEV;

mutex_lock(&sisusb->lock);
@@ -2968,7 +2968,7 @@ sisusb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
long retval = 0;
u32 __user *argp = (u32 __user *)arg;

- if (!(sisusb = (struct sisusb_usb_data *)file->private_data))
+ if (!(sisusb = file->private_data))
return -ENODEV;

mutex_lock(&sisusb->lock);
diff --git a/drivers/usb/misc/usblcd.c b/drivers/usb/misc/usblcd.c
index 7828c76..a0dad56 100644
--- a/drivers/usb/misc/usblcd.c
+++ b/drivers/usb/misc/usblcd.c
@@ -116,7 +116,7 @@ static int lcd_release(struct inode *inode, struct file *file)
{
struct usb_lcd *dev;

- dev = (struct usb_lcd *)file->private_data;
+ dev = file->private_data;
if (dev == NULL)
return -ENODEV;

@@ -132,7 +132,7 @@ static ssize_t lcd_read(struct file *file, char __user * buffer, size_t count, l
int retval = 0;
int bytes_read;

- dev = (struct usb_lcd *)file->private_data;
+ dev = file->private_data;

/* do a blocking bulk read to get data from the device */
retval = usb_bulk_msg(dev->udev,
@@ -158,7 +158,7 @@ static long lcd_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
u16 bcdDevice;
char buf[30];

- dev = (struct usb_lcd *)file->private_data;
+ dev = file->private_data;
if (dev == NULL)
return -ENODEV;

@@ -217,7 +217,7 @@ static ssize_t lcd_write(struct file *file, const char __user * user_buffer, siz
struct urb *urb = NULL;
char *buf = NULL;

- dev = (struct usb_lcd *)file->private_data;
+ dev = file->private_data;

/* verify that we actually have some data to write */
if (count == 0)
--
1.7.1.337.g6068.dirty

2010-07-12 20:54:12

by Joe Perches

[permalink] [raw]
Subject: [PATCH 22/36] fs/cifs: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
fs/cifs/file.c | 24 ++++++++++--------------
fs/cifs/inode.c | 4 ++--
fs/cifs/ioctl.c | 3 +--
3 files changed, 13 insertions(+), 18 deletions(-)

diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 409e4f5..b5fb2a0 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -427,7 +427,7 @@ static int cifs_reopen_file(struct file *file, bool can_flush)
__u16 netfid;

if (file->private_data)
- pCifsFile = (struct cifsFileInfo *)file->private_data;
+ pCifsFile = file->private_data;
else
return -EBADF;

@@ -565,8 +565,7 @@ int cifs_close(struct inode *inode, struct file *file)
int xid, timeout;
struct cifs_sb_info *cifs_sb;
struct cifsTconInfo *pTcon;
- struct cifsFileInfo *pSMBFile =
- (struct cifsFileInfo *)file->private_data;
+ struct cifsFileInfo *pSMBFile = file->private_data;

xid = GetXid();

@@ -641,8 +640,7 @@ int cifs_closedir(struct inode *inode, struct file *file)
{
int rc = 0;
int xid;
- struct cifsFileInfo *pCFileStruct =
- (struct cifsFileInfo *)file->private_data;
+ struct cifsFileInfo *pCFileStruct = file->private_data;
char *ptmp;

cFYI(1, "Closedir inode = 0x%p", inode);
@@ -863,8 +861,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
length, pfLock,
posix_lock_type, wait_flag);
} else {
- struct cifsFileInfo *fid =
- (struct cifsFileInfo *)file->private_data;
+ struct cifsFileInfo *fid = file->private_data;

if (numLock) {
rc = CIFSSMBLock(xid, tcon, netfid, length,
@@ -965,7 +962,7 @@ ssize_t cifs_user_write(struct file *file, const char __user *write_data,

if (file->private_data == NULL)
return -EBADF;
- open_file = (struct cifsFileInfo *) file->private_data;
+ open_file = file->private_data;

rc = generic_write_checks(file, poffset, &write_size, 0);
if (rc)
@@ -1067,7 +1064,7 @@ static ssize_t cifs_write(struct file *file, const char *write_data,

if (file->private_data == NULL)
return -EBADF;
- open_file = (struct cifsFileInfo *)file->private_data;
+ open_file = file->private_data;

xid = GetXid();

@@ -1651,8 +1648,7 @@ int cifs_fsync(struct file *file, int datasync)
int xid;
int rc = 0;
struct cifsTconInfo *tcon;
- struct cifsFileInfo *smbfile =
- (struct cifsFileInfo *)file->private_data;
+ struct cifsFileInfo *smbfile = file->private_data;
struct inode *inode = file->f_path.dentry->d_inode;

xid = GetXid();
@@ -1756,7 +1752,7 @@ ssize_t cifs_user_read(struct file *file, char __user *read_data,
FreeXid(xid);
return rc;
}
- open_file = (struct cifsFileInfo *)file->private_data;
+ open_file = file->private_data;

if ((file->f_flags & O_ACCMODE) == O_WRONLY)
cFYI(1, "attempting read on write only file instance");
@@ -1837,7 +1833,7 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
FreeXid(xid);
return rc;
}
- open_file = (struct cifsFileInfo *)file->private_data;
+ open_file = file->private_data;

if ((file->f_flags & O_ACCMODE) == O_WRONLY)
cFYI(1, "attempting read on write only file instance");
@@ -1968,7 +1964,7 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
FreeXid(xid);
return rc;
}
- open_file = (struct cifsFileInfo *)file->private_data;
+ open_file = file->private_data;
cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
pTcon = cifs_sb->tcon;

diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
index 107c84d..ee08248 100644
--- a/fs/cifs/inode.c
+++ b/fs/cifs/inode.c
@@ -288,7 +288,7 @@ int cifs_get_file_info_unix(struct file *filp)
struct inode *inode = filp->f_path.dentry->d_inode;
struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
struct cifsTconInfo *tcon = cifs_sb->tcon;
- struct cifsFileInfo *cfile = (struct cifsFileInfo *) filp->private_data;
+ struct cifsFileInfo *cfile = filp->private_data;

xid = GetXid();
rc = CIFSSMBUnixQFileInfo(xid, tcon, cfile->netfid, &find_data);
@@ -515,7 +515,7 @@ int cifs_get_file_info(struct file *filp)
struct inode *inode = filp->f_path.dentry->d_inode;
struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
struct cifsTconInfo *tcon = cifs_sb->tcon;
- struct cifsFileInfo *cfile = (struct cifsFileInfo *) filp->private_data;
+ struct cifsFileInfo *cfile = filp->private_data;

xid = GetXid();
rc = CIFSSMBQFileInfo(xid, tcon, cfile->netfid, &find_data);
diff --git a/fs/cifs/ioctl.c b/fs/cifs/ioctl.c
index 505926f..9d38a71 100644
--- a/fs/cifs/ioctl.c
+++ b/fs/cifs/ioctl.c
@@ -41,8 +41,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
__u64 ExtAttrMask = 0;
__u64 caps;
struct cifsTconInfo *tcon;
- struct cifsFileInfo *pSMBFile =
- (struct cifsFileInfo *)filep->private_data;
+ struct cifsFileInfo *pSMBFile = filep->private_data;
#endif /* CONFIG_CIFS_POSIX */

xid = GetXid();
--
1.7.1.337.g6068.dirty

2010-07-12 20:50:54

by Joe Perches

[permalink] [raw]
Subject: [PATCH 15/36] drivers/s390: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
drivers/s390/block/dasd_eer.c | 6 +++---
drivers/s390/char/tape_block.c | 4 ++--
drivers/s390/char/tape_char.c | 8 ++++----
drivers/s390/char/vmcp.c | 6 +++---
4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/drivers/s390/block/dasd_eer.c b/drivers/s390/block/dasd_eer.c
index dd88803..75688af 100644
--- a/drivers/s390/block/dasd_eer.c
+++ b/drivers/s390/block/dasd_eer.c
@@ -572,7 +572,7 @@ static int dasd_eer_close(struct inode *inp, struct file *filp)
struct eerbuffer *eerb;
unsigned long flags;

- eerb = (struct eerbuffer *) filp->private_data;
+ eerb = filp->private_data;
spin_lock_irqsave(&bufferlock, flags);
list_del(&eerb->list);
spin_unlock_irqrestore(&bufferlock, flags);
@@ -591,7 +591,7 @@ static ssize_t dasd_eer_read(struct file *filp, char __user *buf,
unsigned long flags;
struct eerbuffer *eerb;

- eerb = (struct eerbuffer *) filp->private_data;
+ eerb = filp->private_data;
if (mutex_lock_interruptible(&readbuffer_mutex))
return -ERESTARTSYS;

@@ -653,7 +653,7 @@ static unsigned int dasd_eer_poll(struct file *filp, poll_table *ptable)
unsigned long flags;
struct eerbuffer *eerb;

- eerb = (struct eerbuffer *) filp->private_data;
+ eerb = filp->private_data;
poll_wait(filp, &dasd_eer_read_wait_queue, ptable);
spin_lock_irqsave(&bufferlock, flags);
if (eerb->head != eerb->tail)
diff --git a/drivers/s390/char/tape_block.c b/drivers/s390/char/tape_block.c
index b7de025..d448fe5 100644
--- a/drivers/s390/char/tape_block.c
+++ b/drivers/s390/char/tape_block.c
@@ -296,7 +296,7 @@ tapeblock_revalidate_disk(struct gendisk *disk)
unsigned int nr_of_blks;
int rc;

- device = (struct tape_device *) disk->private_data;
+ device = disk->private_data;
BUG_ON(!device);

if (!device->blk_data.medium_changed)
@@ -345,7 +345,7 @@ tapeblock_medium_changed(struct gendisk *disk)
{
struct tape_device *device;

- device = (struct tape_device *) disk->private_data;
+ device = disk->private_data;
DBF_LH(6, "tapeblock_medium_changed(%p) = %d\n",
device, device->blk_data.medium_changed);

diff --git a/drivers/s390/char/tape_char.c b/drivers/s390/char/tape_char.c
index 539045a..bd037d2 100644
--- a/drivers/s390/char/tape_char.c
+++ b/drivers/s390/char/tape_char.c
@@ -134,7 +134,7 @@ tapechar_read(struct file *filp, char __user *data, size_t count, loff_t *ppos)
int rc;

DBF_EVENT(6, "TCHAR:read\n");
- device = (struct tape_device *) filp->private_data;
+ device = filp->private_data;

/*
* If the tape isn't terminated yet, do it now. And since we then
@@ -199,7 +199,7 @@ tapechar_write(struct file *filp, const char __user *data, size_t count, loff_t
int i, rc;

DBF_EVENT(6, "TCHAR:write\n");
- device = (struct tape_device *) filp->private_data;
+ device = filp->private_data;
/* Find out block size and number of blocks */
if (device->char_data.block_size != 0) {
if (count < device->char_data.block_size) {
@@ -317,7 +317,7 @@ tapechar_release(struct inode *inode, struct file *filp)
struct tape_device *device;

DBF_EVENT(6, "TCHAR:release: %x\n", iminor(inode));
- device = (struct tape_device *) filp->private_data;
+ device = filp->private_data;

/*
* If this is the rewinding tape minor then rewind. In that case we
@@ -454,7 +454,7 @@ tapechar_ioctl(struct file *filp, unsigned int no, unsigned long data)

DBF_EVENT(6, "TCHAR:ioct\n");

- device = (struct tape_device *) filp->private_data;
+ device = filp->private_data;
mutex_lock(&device->mutex);
rc = __tapechar_ioctl(device, no, data);
mutex_unlock(&device->mutex);
diff --git a/drivers/s390/char/vmcp.c b/drivers/s390/char/vmcp.c
index 04e532e..19a14d9 100644
--- a/drivers/s390/char/vmcp.c
+++ b/drivers/s390/char/vmcp.c
@@ -47,7 +47,7 @@ static int vmcp_release(struct inode *inode, struct file *file)
{
struct vmcp_session *session;

- session = (struct vmcp_session *)file->private_data;
+ session = file->private_data;
file->private_data = NULL;
free_pages((unsigned long)session->response, get_order(session->bufsize));
kfree(session);
@@ -94,7 +94,7 @@ vmcp_write(struct file *file, const char __user *buff, size_t count,
return -EFAULT;
}
cmd[count] = '\0';
- session = (struct vmcp_session *)file->private_data;
+ session = file->private_data;
if (mutex_lock_interruptible(&session->mutex)) {
kfree(cmd);
return -ERESTARTSYS;
@@ -136,7 +136,7 @@ static long vmcp_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
int __user *argp;
int temp;

- session = (struct vmcp_session *)file->private_data;
+ session = file->private_data;
if (is_compat_task())
argp = compat_ptr(arg);
else
--
1.7.1.337.g6068.dirty

2010-07-12 20:54:31

by Joe Perches

[permalink] [raw]
Subject: [PATCH 19/36] drivers/usb/gadget: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
drivers/usb/gadget/f_hid.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/gadget/f_hid.c b/drivers/usb/gadget/f_hid.c
index 1e00ff9..53e1202 100644
--- a/drivers/usb/gadget/f_hid.c
+++ b/drivers/usb/gadget/f_hid.c
@@ -142,7 +142,7 @@ static struct usb_descriptor_header *hidg_fs_descriptors[] = {
static ssize_t f_hidg_read(struct file *file, char __user *buffer,
size_t count, loff_t *ptr)
{
- struct f_hidg *hidg = (struct f_hidg *)file->private_data;
+ struct f_hidg *hidg = file->private_data;
char *tmp_buff = NULL;
unsigned long flags;

@@ -200,7 +200,7 @@ static void f_hidg_req_complete(struct usb_ep *ep, struct usb_request *req)
static ssize_t f_hidg_write(struct file *file, const char __user *buffer,
size_t count, loff_t *offp)
{
- struct f_hidg *hidg = (struct f_hidg *)file->private_data;
+ struct f_hidg *hidg = file->private_data;
ssize_t status = -ENOMEM;

if (!access_ok(VERIFY_READ, buffer, count))
@@ -257,7 +257,7 @@ static ssize_t f_hidg_write(struct file *file, const char __user *buffer,

static unsigned int f_hidg_poll(struct file *file, poll_table *wait)
{
- struct f_hidg *hidg = (struct f_hidg *)file->private_data;
+ struct f_hidg *hidg = file->private_data;
unsigned int ret = 0;

poll_wait(file, &hidg->read_queue, wait);
--
1.7.1.337.g6068.dirty

2010-07-12 20:54:57

by Joe Perches

[permalink] [raw]
Subject: [PATCH 18/36] drivers/staging: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
drivers/staging/batman-adv/bat_debugfs.c | 4 ++--
drivers/staging/batman-adv/icmp_socket.c | 12 ++++--------
drivers/staging/cx25821/cx25821-alsa.c | 2 +-
drivers/staging/easycap/easycap_ioctl.c | 4 ++--
drivers/staging/easycap/easycap_main.c | 4 ++--
drivers/staging/easycap/easycap_sound.c | 2 +-
6 files changed, 12 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/batman-adv/bat_debugfs.c b/drivers/staging/batman-adv/bat_debugfs.c
index 8e8eef0..507da68 100644
--- a/drivers/staging/batman-adv/bat_debugfs.c
+++ b/drivers/staging/batman-adv/bat_debugfs.c
@@ -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;
@@ -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);
diff --git a/drivers/staging/batman-adv/icmp_socket.c b/drivers/staging/batman-adv/icmp_socket.c
index 532f246..fc3d32c 100644
--- a/drivers/staging/batman-adv/icmp_socket.c
+++ b/drivers/staging/batman-adv/icmp_socket.c
@@ -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;
@@ -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;
@@ -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;
@@ -247,8 +244,7 @@ out:

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);

diff --git a/drivers/staging/cx25821/cx25821-alsa.c b/drivers/staging/cx25821/cx25821-alsa.c
index a43b188..bbe3643 100644
--- a/drivers/staging/cx25821/cx25821-alsa.c
+++ b/drivers/staging/cx25821/cx25821-alsa.c
@@ -698,7 +698,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;
diff --git a/drivers/staging/easycap/easycap_ioctl.c b/drivers/staging/easycap/easycap_ioctl.c
index f71cd9e..a36a8e8 100644
--- a/drivers/staging/easycap/easycap_ioctl.c
+++ b/drivers/staging/easycap/easycap_ioctl.c
@@ -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;
@@ -1972,7 +1972,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;
diff --git a/drivers/staging/easycap/easycap_main.c b/drivers/staging/easycap/easycap_main.c
index 18259df..8724b4a 100644
--- a/drivers/staging/easycap/easycap_main.c
+++ b/drivers/staging/easycap/easycap_main.c
@@ -531,7 +531,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");
@@ -823,7 +823,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;
diff --git a/drivers/staging/easycap/easycap_sound.c b/drivers/staging/easycap/easycap_sound.c
index 532c410..b0fc517 100644
--- a/drivers/staging/easycap/easycap_sound.c
+++ b/drivers/staging/easycap/easycap_sound.c
@@ -563,7 +563,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;
--
1.7.1.337.g6068.dirty

2010-07-12 20:55:20

by Joe Perches

[permalink] [raw]
Subject: [PATCH 17/36] drivers/scsi: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
drivers/scsi/aacraid/linit.c | 2 +-
drivers/scsi/pmcraid.c | 7 +++----
drivers/scsi/sg.c | 18 +++++++++---------
3 files changed, 13 insertions(+), 14 deletions(-)

diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index 33898b6..d0a7c1d 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -770,7 +770,7 @@ static long aac_compat_cfg_ioctl(struct file *file, unsigned cmd, unsigned long
{
if (!capable(CAP_SYS_RAWIO))
return -EPERM;
- return aac_compat_do_ioctl((struct aac_dev *)file->private_data, cmd, arg);
+ return aac_compat_do_ioctl(file->private_data, cmd, arg);
}
#endif

diff --git a/drivers/scsi/pmcraid.c b/drivers/scsi/pmcraid.c
index 9ebcea3..ecc45c8 100644
--- a/drivers/scsi/pmcraid.c
+++ b/drivers/scsi/pmcraid.c
@@ -3599,8 +3599,7 @@ static int pmcraid_chr_open(struct inode *inode, struct file *filep)
*/
static int pmcraid_chr_release(struct inode *inode, struct file *filep)
{
- struct pmcraid_instance *pinstance =
- ((struct pmcraid_instance *)filep->private_data);
+ struct pmcraid_instance *pinstance = filep->private_data;

filep->private_data = NULL;
fasync_helper(-1, filep, 0, &pinstance->aen_queue);
@@ -3619,7 +3618,7 @@ static int pmcraid_chr_fasync(int fd, struct file *filep, int mode)
struct pmcraid_instance *pinstance;
int rc;

- pinstance = (struct pmcraid_instance *)filep->private_data;
+ pinstance = filep->private_data;
mutex_lock(&pinstance->aen_queue_lock);
rc = fasync_helper(fd, filep, mode, &pinstance->aen_queue);
mutex_unlock(&pinstance->aen_queue_lock);
@@ -4110,7 +4109,7 @@ static long pmcraid_chr_ioctl(
return retval;
}

- pinstance = (struct pmcraid_instance *)filep->private_data;
+ pinstance = filep->private_data;

if (!pinstance) {
pmcraid_info("adapter instance is not found\n");
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index ef752b2..c11ab95 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -210,7 +210,7 @@ static void sg_put_dev(Sg_device *sdp);

static int sg_allow_access(struct file *filp, unsigned char *cmd)
{
- struct sg_fd *sfp = (struct sg_fd *)filp->private_data;
+ struct sg_fd *sfp = filp->private_data;

if (sfp->parentdp->device->type == TYPE_SCANNER)
return 0;
@@ -318,7 +318,7 @@ sg_release(struct inode *inode, struct file *filp)
Sg_device *sdp;
Sg_fd *sfp;

- if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp)))
+ if ((!(sfp = filp->private_data)) || (!(sdp = sfp->parentdp)))
return -ENXIO;
SCSI_LOG_TIMEOUT(3, printk("sg_release: %s\n", sdp->disk->disk_name));

@@ -342,7 +342,7 @@ sg_read(struct file *filp, char __user *buf, size_t count, loff_t * ppos)
struct sg_header *old_hdr = NULL;
int retval = 0;

- if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp)))
+ if ((!(sfp = filp->private_data)) || (!(sdp = sfp->parentdp)))
return -ENXIO;
SCSI_LOG_TIMEOUT(3, printk("sg_read: %s, count=%d\n",
sdp->disk->disk_name, (int) count));
@@ -533,7 +533,7 @@ sg_write(struct file *filp, const char __user *buf, size_t count, loff_t * ppos)
sg_io_hdr_t *hp;
unsigned char cmnd[MAX_COMMAND_SIZE];

- if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp)))
+ if ((!(sfp = filp->private_data)) || (!(sdp = sfp->parentdp)))
return -ENXIO;
SCSI_LOG_TIMEOUT(3, printk("sg_write: %s, count=%d\n",
sdp->disk->disk_name, (int) count));
@@ -768,7 +768,7 @@ sg_ioctl(struct file *filp, unsigned int cmd_in, unsigned long arg)
Sg_request *srp;
unsigned long iflags;

- if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp)))
+ if ((!(sfp = filp->private_data)) || (!(sdp = sfp->parentdp)))
return -ENXIO;

SCSI_LOG_TIMEOUT(3, printk("sg_ioctl: %s, cmd=0x%x\n",
@@ -1096,7 +1096,7 @@ static long sg_compat_ioctl(struct file *filp, unsigned int cmd_in, unsigned lon
Sg_fd *sfp;
struct scsi_device *sdev;

- if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp)))
+ if ((!(sfp = filp->private_data)) || (!(sdp = sfp->parentdp)))
return -ENXIO;

sdev = sdp->device;
@@ -1122,7 +1122,7 @@ sg_poll(struct file *filp, poll_table * wait)
int count = 0;
unsigned long iflags;

- if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp))
+ if ((!(sfp = filp->private_data)) || (!(sdp = sfp->parentdp))
|| sfp->closed)
return POLLERR;
poll_wait(filp, &sfp->read_wait, wait);
@@ -1153,7 +1153,7 @@ sg_fasync(int fd, struct file *filp, int mode)
Sg_device *sdp;
Sg_fd *sfp;

- if ((!(sfp = (Sg_fd *) filp->private_data)) || (!(sdp = sfp->parentdp)))
+ if ((!(sfp = filp->private_data)) || (!(sdp = sfp->parentdp)))
return -ENXIO;
SCSI_LOG_TIMEOUT(3, printk("sg_fasync: %s, mode=%d\n",
sdp->disk->disk_name, mode));
@@ -1208,7 +1208,7 @@ sg_mmap(struct file *filp, struct vm_area_struct *vma)
Sg_scatter_hold *rsv_schp;
int k, length;

- if ((!filp) || (!vma) || (!(sfp = (Sg_fd *) filp->private_data)))
+ if ((!filp) || (!vma) || (!(sfp = filp->private_data)))
return -ENXIO;
req_sz = vma->vm_end - vma->vm_start;
SCSI_LOG_TIMEOUT(3, printk("sg_mmap starting, vm_start=%p, len=%d\n",
--
1.7.1.337.g6068.dirty

2010-07-12 20:50:49

by Joe Perches

[permalink] [raw]
Subject: [PATCH 11/36] drivers/media: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
drivers/media/IR/imon.c | 6 +++---
drivers/media/common/saa7146_vbi.c | 4 ++--
drivers/media/common/saa7146_video.c | 4 ++--
drivers/media/dvb/bt8xx/dst_ca.c | 2 +-
drivers/media/video/cx18/cx18-ioctl.c | 2 +-
drivers/media/video/cx88/cx88-alsa.c | 2 +-
drivers/media/video/hdpvr/hdpvr-video.c | 4 ++--
drivers/media/video/mem2mem_testdev.c | 4 ++--
drivers/media/video/saa7134/saa7134-alsa.c | 2 +-
drivers/media/video/uvc/uvc_v4l2.c | 8 ++++----
10 files changed, 19 insertions(+), 19 deletions(-)

diff --git a/drivers/media/IR/imon.c b/drivers/media/IR/imon.c
index 0195dd5..65c125e 100644
--- a/drivers/media/IR/imon.c
+++ b/drivers/media/IR/imon.c
@@ -407,7 +407,7 @@ static int display_close(struct inode *inode, struct file *file)
struct imon_context *ictx = NULL;
int retval = 0;

- ictx = (struct imon_context *)file->private_data;
+ ictx = file->private_data;

if (!ictx) {
err("%s: no context for device", __func__);
@@ -812,7 +812,7 @@ static ssize_t vfd_write(struct file *file, const char *buf,
const unsigned char vfd_packet6[] = {
0x01, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF };

- ictx = (struct imon_context *)file->private_data;
+ ictx = file->private_data;
if (!ictx) {
err("%s: no context for device", __func__);
return -ENODEV;
@@ -896,7 +896,7 @@ static ssize_t lcd_write(struct file *file, const char *buf,
int retval = 0;
struct imon_context *ictx;

- ictx = (struct imon_context *)file->private_data;
+ ictx = file->private_data;
if (!ictx) {
err("%s: no context for device", __func__);
return -ENODEV;
diff --git a/drivers/media/common/saa7146_vbi.c b/drivers/media/common/saa7146_vbi.c
index 74e2b56..8224c30 100644
--- a/drivers/media/common/saa7146_vbi.c
+++ b/drivers/media/common/saa7146_vbi.c
@@ -375,7 +375,7 @@ static void vbi_init(struct saa7146_dev *dev, struct saa7146_vv *vv)

static int vbi_open(struct saa7146_dev *dev, struct file *file)
{
- struct saa7146_fh *fh = (struct saa7146_fh *)file->private_data;
+ struct saa7146_fh *fh = file->private_data;

u32 arbtr_ctrl = saa7146_read(dev, PCI_BT_V1);
int ret = 0;
@@ -437,7 +437,7 @@ static int vbi_open(struct saa7146_dev *dev, struct file *file)

static void vbi_close(struct saa7146_dev *dev, struct file *file)
{
- struct saa7146_fh *fh = (struct saa7146_fh *)file->private_data;
+ struct saa7146_fh *fh = file->private_data;
struct saa7146_vv *vv = dev->vv_data;
DEB_VBI(("dev:%p, fh:%p\n",dev,fh));

diff --git a/drivers/media/common/saa7146_video.c b/drivers/media/common/saa7146_video.c
index b8b2c55..a212a91 100644
--- a/drivers/media/common/saa7146_video.c
+++ b/drivers/media/common/saa7146_video.c
@@ -1370,7 +1370,7 @@ static void video_init(struct saa7146_dev *dev, struct saa7146_vv *vv)

static int video_open(struct saa7146_dev *dev, struct file *file)
{
- struct saa7146_fh *fh = (struct saa7146_fh *)file->private_data;
+ struct saa7146_fh *fh = file->private_data;
struct saa7146_format *sfmt;

fh->video_fmt.width = 384;
@@ -1394,7 +1394,7 @@ static int video_open(struct saa7146_dev *dev, struct file *file)

static void video_close(struct saa7146_dev *dev, struct file *file)
{
- struct saa7146_fh *fh = (struct saa7146_fh *)file->private_data;
+ struct saa7146_fh *fh = file->private_data;
struct saa7146_vv *vv = dev->vv_data;
struct videobuf_queue *q = &fh->video_q;
int err;
diff --git a/drivers/media/dvb/bt8xx/dst_ca.c b/drivers/media/dvb/bt8xx/dst_ca.c
index 770243c..cf87051 100644
--- a/drivers/media/dvb/bt8xx/dst_ca.c
+++ b/drivers/media/dvb/bt8xx/dst_ca.c
@@ -565,7 +565,7 @@ static long dst_ca_ioctl(struct file *file, unsigned int cmd, unsigned long ioct
int result = 0;

lock_kernel();
- dvbdev = (struct dvb_device *)file->private_data;
+ dvbdev = file->private_data;
state = (struct dst_state *)dvbdev->priv;
p_ca_message = kmalloc(sizeof (struct ca_msg), GFP_KERNEL);
p_ca_slot_info = kmalloc(sizeof (struct ca_slot_info), GFP_KERNEL);
diff --git a/drivers/media/video/cx18/cx18-ioctl.c b/drivers/media/video/cx18/cx18-ioctl.c
index 20eaf38..d679240 100644
--- a/drivers/media/video/cx18/cx18-ioctl.c
+++ b/drivers/media/video/cx18/cx18-ioctl.c
@@ -1081,7 +1081,7 @@ long cx18_v4l2_ioctl(struct file *filp, unsigned int cmd,
unsigned long arg)
{
struct video_device *vfd = video_devdata(filp);
- struct cx18_open_id *id = (struct cx18_open_id *)filp->private_data;
+ struct cx18_open_id *id = filp->private_data;
struct cx18 *cx = id->cx;
long res;

diff --git a/drivers/media/video/cx88/cx88-alsa.c b/drivers/media/video/cx88/cx88-alsa.c
index 9209d5b..4f383cd 100644
--- a/drivers/media/video/cx88/cx88-alsa.c
+++ b/drivers/media/video/cx88/cx88-alsa.c
@@ -739,7 +739,7 @@ static int __devinit snd_cx88_create(struct snd_card *card,

pci_set_master(pci);

- chip = (snd_cx88_card_t *) card->private_data;
+ chip = card->private_data;

core = cx88_core_get(pci);
if (NULL == core) {
diff --git a/drivers/media/video/hdpvr/hdpvr-video.c b/drivers/media/video/hdpvr/hdpvr-video.c
index c338f3f..4863a21 100644
--- a/drivers/media/video/hdpvr/hdpvr-video.c
+++ b/drivers/media/video/hdpvr/hdpvr-video.c
@@ -394,7 +394,7 @@ err:

static int hdpvr_release(struct file *file)
{
- struct hdpvr_fh *fh = (struct hdpvr_fh *)file->private_data;
+ struct hdpvr_fh *fh = file->private_data;
struct hdpvr_device *dev = fh->dev;

if (!dev)
@@ -518,7 +518,7 @@ err:
static unsigned int hdpvr_poll(struct file *filp, poll_table *wait)
{
struct hdpvr_buffer *buf = NULL;
- struct hdpvr_fh *fh = (struct hdpvr_fh *)filp->private_data;
+ struct hdpvr_fh *fh = filp->private_data;
struct hdpvr_device *dev = fh->dev;
unsigned int mask = 0;

diff --git a/drivers/media/video/mem2mem_testdev.c b/drivers/media/video/mem2mem_testdev.c
index 554eaf1..7fd54bf 100644
--- a/drivers/media/video/mem2mem_testdev.c
+++ b/drivers/media/video/mem2mem_testdev.c
@@ -903,14 +903,14 @@ static int m2mtest_release(struct file *file)
static unsigned int m2mtest_poll(struct file *file,
struct poll_table_struct *wait)
{
- struct m2mtest_ctx *ctx = (struct m2mtest_ctx *)file->private_data;
+ struct m2mtest_ctx *ctx = file->private_data;

return v4l2_m2m_poll(file, ctx->m2m_ctx, wait);
}

static int m2mtest_mmap(struct file *file, struct vm_area_struct *vma)
{
- struct m2mtest_ctx *ctx = (struct m2mtest_ctx *)file->private_data;
+ struct m2mtest_ctx *ctx = file->private_data;

return v4l2_m2m_mmap(file, ctx->m2m_ctx, vma);
}
diff --git a/drivers/media/video/saa7134/saa7134-alsa.c b/drivers/media/video/saa7134/saa7134-alsa.c
index 68b7e8d..10460fd 100644
--- a/drivers/media/video/saa7134/saa7134-alsa.c
+++ b/drivers/media/video/saa7134/saa7134-alsa.c
@@ -1080,7 +1080,7 @@ static int alsa_card_saa7134_create(struct saa7134_dev *dev, int devnum)
/* Card "creation" */

card->private_free = snd_saa7134_free;
- chip = (snd_card_saa7134_t *) card->private_data;
+ chip = card->private_data;

spin_lock_init(&chip->lock);
spin_lock_init(&chip->mixer_lock);
diff --git a/drivers/media/video/uvc/uvc_v4l2.c b/drivers/media/video/uvc/uvc_v4l2.c
index 369ce06..86db326 100644
--- a/drivers/media/video/uvc/uvc_v4l2.c
+++ b/drivers/media/video/uvc/uvc_v4l2.c
@@ -516,7 +516,7 @@ static int uvc_v4l2_open(struct file *file)

static int uvc_v4l2_release(struct file *file)
{
- struct uvc_fh *handle = (struct uvc_fh *)file->private_data;
+ struct uvc_fh *handle = file->private_data;
struct uvc_streaming *stream = handle->stream;

uvc_trace(UVC_TRACE_CALLS, "uvc_v4l2_release\n");
@@ -547,7 +547,7 @@ static int uvc_v4l2_release(struct file *file)
static long uvc_v4l2_do_ioctl(struct file *file, unsigned int cmd, void *arg)
{
struct video_device *vdev = video_devdata(file);
- struct uvc_fh *handle = (struct uvc_fh *)file->private_data;
+ struct uvc_fh *handle = file->private_data;
struct uvc_video_chain *chain = handle->chain;
struct uvc_streaming *stream = handle->stream;
long ret = 0;
@@ -1116,7 +1116,7 @@ static const struct vm_operations_struct uvc_vm_ops = {

static int uvc_v4l2_mmap(struct file *file, struct vm_area_struct *vma)
{
- struct uvc_fh *handle = (struct uvc_fh *)file->private_data;
+ struct uvc_fh *handle = file->private_data;
struct uvc_streaming *stream = handle->stream;
struct uvc_video_queue *queue = &stream->queue;
struct uvc_buffer *uninitialized_var(buffer);
@@ -1171,7 +1171,7 @@ done:

static unsigned int uvc_v4l2_poll(struct file *file, poll_table *wait)
{
- struct uvc_fh *handle = (struct uvc_fh *)file->private_data;
+ struct uvc_fh *handle = file->private_data;
struct uvc_streaming *stream = handle->stream;

uvc_trace(UVC_TRACE_CALLS, "uvc_v4l2_poll\n");
--
1.7.1.337.g6068.dirty

2010-07-12 20:50:47

by Joe Perches

[permalink] [raw]
Subject: [PATCH 12/36] drivers/misc: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
drivers/misc/ibmasm/ibmasmfs.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/ibmasm/ibmasmfs.c b/drivers/misc/ibmasm/ibmasmfs.c
index 8844a3f..8d650d6 100644
--- a/drivers/misc/ibmasm/ibmasmfs.c
+++ b/drivers/misc/ibmasm/ibmasmfs.c
@@ -517,7 +517,7 @@ static int remote_settings_file_close(struct inode *inode, struct file *file)

static ssize_t remote_settings_file_read(struct file *file, char __user *buf, size_t count, loff_t *offset)
{
- void __iomem *address = (void __iomem *)file->private_data;
+ void __iomem *address = file->private_data;
unsigned char *page;
int retval;
int len = 0;
@@ -551,7 +551,7 @@ exit:

static ssize_t remote_settings_file_write(struct file *file, const char __user *ubuff, size_t count, loff_t *offset)
{
- void __iomem *address = (void __iomem *)file->private_data;
+ void __iomem *address = file->private_data;
char *buff;
unsigned int value;

--
1.7.1.337.g6068.dirty

2010-07-12 20:55:53

by Joe Perches

[permalink] [raw]
Subject: [PATCH 14/36] drivers/net/wireless: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
drivers/net/wireless/airo.c | 22 +++++++++++-----------
drivers/net/wireless/ath/ath9k/htc_drv_main.c | 9 +++------
drivers/net/wireless/iwlwifi/iwl-debugfs.c | 10 +++++-----
drivers/net/wireless/libertas/debugfs.c | 4 ++--
4 files changed, 21 insertions(+), 24 deletions(-)

diff --git a/drivers/net/wireless/airo.c b/drivers/net/wireless/airo.c
index 6b605df..115442b 100644
--- a/drivers/net/wireless/airo.c
+++ b/drivers/net/wireless/airo.c
@@ -4657,7 +4657,7 @@ static ssize_t proc_write( struct file *file,
loff_t *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)
return -EINVAL;
@@ -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)
return -ENOMEM;
- data = (struct proc_data *)file->private_data;
+ data = file->private_data;
if ((data->rbuffer = kmalloc( 2048, GFP_KERNEL )) == NULL) {
kfree (file->private_data);
return -ENOMEM;
@@ -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)
return -ENOMEM;
- data = (struct proc_data *)file->private_data;
+ data = file->private_data;
if ((data->rbuffer = kmalloc( 4096, GFP_KERNEL )) == NULL) {
kfree (file->private_data);
return -ENOMEM;
@@ -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)
return -ENOMEM;
- data = (struct proc_data *)file->private_data;
+ data = file->private_data;
if ((data->rbuffer = kmalloc( 2048, GFP_KERNEL )) == NULL) {
kfree (file->private_data);
return -ENOMEM;
@@ -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)
{
- 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 net_device *dev = dp->data;
struct airo_info *ai = dev->ml_priv;
@@ -5163,7 +5163,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 = (struct proc_data *)file->private_data;
+ struct proc_data *data = file->private_data;
struct proc_dir_entry *dp = PDE(inode);
struct net_device *dev = dp->data;
struct airo_info *ai = dev->ml_priv;
@@ -5309,7 +5309,7 @@ static void proc_wepkey_on_close( struct inode *inode, struct file *file ) {

memset(key, 0, sizeof(key));

- data = (struct proc_data *)file->private_data;
+ data = file->private_data;
if ( !data->writelen ) return;

if (data->wbuffer[0] >= '0' && data->wbuffer[0] <= '3' &&
@@ -5363,7 +5363,7 @@ static int proc_wepkey_open( struct inode *inode, struct file *file )
if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
return -ENOMEM;
memset(&wkr, 0, sizeof(wkr));
- data = (struct proc_data *)file->private_data;
+ data = file->private_data;
if ((data->rbuffer = kzalloc( 180, GFP_KERNEL )) == NULL) {
kfree (file->private_data);
return -ENOMEM;
@@ -5409,7 +5409,7 @@ static int proc_SSID_open(struct inode *inode, struct file *file)

if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
return -ENOMEM;
- data = (struct proc_data *)file->private_data;
+ data = file->private_data;
if ((data->rbuffer = kmalloc( 104, GFP_KERNEL )) == NULL) {
kfree (file->private_data);
return -ENOMEM;
@@ -5453,7 +5453,7 @@ static int proc_APList_open( struct inode *inode, struct file *file ) {

if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
return -ENOMEM;
- data = (struct proc_data *)file->private_data;
+ data = file->private_data;
if ((data->rbuffer = kmalloc( 104, GFP_KERNEL )) == NULL) {
kfree (file->private_data);
return -ENOMEM;
@@ -5495,7 +5495,7 @@ static int proc_BSSList_open( struct inode *inode, struct file *file ) {

if ((file->private_data = kzalloc(sizeof(struct proc_data ), GFP_KERNEL)) == NULL)
return -ENOMEM;
- data = (struct proc_data *)file->private_data;
+ data = file->private_data;
if ((data->rbuffer = kmalloc( 1024, GFP_KERNEL )) == NULL) {
kfree (file->private_data);
return -ENOMEM;
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
index e38ca66..47f7603 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
@@ -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,
size_t count, loff_t *ppos)
{
- struct ath9k_htc_priv *priv =
- (struct ath9k_htc_priv *) file->private_data;
+ struct ath9k_htc_priv *priv = file->private_data;
struct ath9k_htc_target_stats cmd_rsp;
char buf[512];
unsigned int len = 0;
@@ -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,
size_t count, loff_t *ppos)
{
- struct ath9k_htc_priv *priv =
- (struct ath9k_htc_priv *) file->private_data;
+ struct ath9k_htc_priv *priv = file->private_data;
char buf[512];
unsigned int len = 0;

@@ -582,8 +580,7 @@ static const struct file_operations fops_xmit = {
static ssize_t read_file_recv(struct file *file, char __user *user_buf,
size_t count, loff_t *ppos)
{
- struct ath9k_htc_priv *priv =
- (struct ath9k_htc_priv *) file->private_data;
+ struct ath9k_htc_priv *priv = file->private_data;
char buf[512];
unsigned int len = 0;

diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index 088a2c1..7b25d14 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -1267,7 +1267,7 @@ static ssize_t iwl_dbgfs_ucode_tracing_read(struct file *file,
char __user *user_buf,
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;
char buf[128];
const size_t bufsz = sizeof(buf);
@@ -1317,7 +1317,7 @@ static ssize_t iwl_dbgfs_rxon_flags_read(struct file *file,
char __user *user_buf,
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;
char buf[20];

@@ -1329,7 +1329,7 @@ static ssize_t iwl_dbgfs_rxon_filter_flags_read(struct file *file,
char __user *user_buf,
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;
char buf[20];

@@ -1342,7 +1342,7 @@ static ssize_t iwl_dbgfs_fh_reg_read(struct file *file,
char __user *user_buf,
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;
int pos = 0;
ssize_t ret = -EFAULT;
@@ -1404,7 +1404,7 @@ static ssize_t iwl_dbgfs_plcp_delta_read(struct file *file,
char __user *user_buf,
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;
char buf[12];
const size_t bufsz = sizeof(buf);
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index 1736746..667695b 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -839,7 +839,7 @@ static ssize_t lbs_debugfs_read(struct file *file, char __user *userbuf,

p = buf;

- d = (struct debug_data *)file->private_data;
+ d = file->private_data;

for (i = 0; i < num_of_items; i++) {
if (d[i].size == 1)
@@ -878,7 +878,7 @@ static ssize_t lbs_debugfs_write(struct file *f, const char __user *buf,
char *p0;
char *p1;
char *p2;
- struct debug_data *d = (struct debug_data *)f->private_data;
+ struct debug_data *d = f->private_data;

pdata = kmalloc(cnt, GFP_KERNEL);
if (pdata == NULL)
--
1.7.1.337.g6068.dirty

2010-07-12 20:56:15

by Joe Perches

[permalink] [raw]
Subject: [PATCH 13/36] drivers/net/caif: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
drivers/net/caif/caif_spi.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/caif/caif_spi.c b/drivers/net/caif/caif_spi.c
index 03049e8..6c94803 100644
--- a/drivers/net/caif/caif_spi.c
+++ b/drivers/net/caif/caif_spi.c
@@ -134,7 +134,7 @@ static ssize_t dbgfs_state(struct file *file, char __user *user_buf,
char *buf;
int len = 0;
ssize_t size;
- struct cfspi *cfspi = (struct cfspi *)file->private_data;
+ struct cfspi *cfspi = file->private_data;

buf = kzalloc(DEBUGFS_BUF_SIZE, GFP_KERNEL);
if (!buf)
@@ -205,7 +205,7 @@ static ssize_t dbgfs_frame(struct file *file, char __user *user_buf,
ssize_t size;
struct cfspi *cfspi;

- cfspi = (struct cfspi *)file->private_data;
+ cfspi = file->private_data;
buf = kzalloc(DEBUGFS_BUF_SIZE, GFP_KERNEL);
if (!buf)
return 0;
--
1.7.1.337.g6068.dirty

2010-07-12 20:50:39

by Joe Perches

[permalink] [raw]
Subject: [PATCH 06/36] drivers/char: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
drivers/char/snsc.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/char/snsc.c b/drivers/char/snsc.c
index 32b74de..ae6aa91 100644
--- a/drivers/char/snsc.c
+++ b/drivers/char/snsc.c
@@ -129,7 +129,7 @@ scdrv_open(struct inode *inode, struct file *file)
static int
scdrv_release(struct inode *inode, struct file *file)
{
- struct subch_data_s *sd = (struct subch_data_s *) file->private_data;
+ struct subch_data_s *sd = file->private_data;
int rv;

/* free the interrupt */
@@ -161,7 +161,7 @@ scdrv_read(struct file *file, char __user *buf, size_t count, loff_t *f_pos)
int status;
int len;
unsigned long flags;
- struct subch_data_s *sd = (struct subch_data_s *) file->private_data;
+ struct subch_data_s *sd = file->private_data;

/* try to get control of the read buffer */
if (down_trylock(&sd->sd_rbs)) {
@@ -253,7 +253,7 @@ scdrv_write(struct file *file, const char __user *buf,
{
unsigned long flags;
int status;
- struct subch_data_s *sd = (struct subch_data_s *) file->private_data;
+ struct subch_data_s *sd = file->private_data;

/* try to get control of the write buffer */
if (down_trylock(&sd->sd_wbs)) {
@@ -326,7 +326,7 @@ scdrv_poll(struct file *file, struct poll_table_struct *wait)
{
unsigned int mask = 0;
int status = 0;
- struct subch_data_s *sd = (struct subch_data_s *) file->private_data;
+ struct subch_data_s *sd = file->private_data;
unsigned long flags;

poll_wait(file, &sd->sd_rq, wait);
--
1.7.1.337.g6068.dirty

2010-07-12 20:50:41

by Joe Perches

[permalink] [raw]
Subject: [PATCH 04/36] arch/s390: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
arch/s390/kernel/debug.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/s390/kernel/debug.c b/arch/s390/kernel/debug.c
index 9819226..39439c7 100644
--- a/arch/s390/kernel/debug.c
+++ b/arch/s390/kernel/debug.c
@@ -531,7 +531,7 @@ debug_output(struct file *file, /* file descriptor */
size_t entry_offset;
file_private_info_t *p_info;

- p_info = ((file_private_info_t *) file->private_data);
+ p_info = file->private_data;
if (*offset != p_info->offset)
return -EPIPE;
if(p_info->act_area >= p_info->debug_info_snap->nr_areas)
@@ -581,7 +581,7 @@ debug_input(struct file *file, const char __user *user_buf, size_t length,
file_private_info_t *p_info;

mutex_lock(&debug_mutex);
- p_info = ((file_private_info_t *) file->private_data);
+ p_info = file->private_data;
if (p_info->view->input_proc)
rc = p_info->view->input_proc(p_info->debug_info_org,
p_info->view, file, user_buf,
@@ -671,7 +671,7 @@ static int
debug_close(struct inode *inode, struct file *file)
{
file_private_info_t *p_info;
- p_info = (file_private_info_t *) file->private_data;
+ p_info = file->private_data;
if(p_info->debug_info_snap)
debug_info_free(p_info->debug_info_snap);
debug_info_put(p_info->debug_info_org);
--
1.7.1.337.g6068.dirty

2010-07-12 20:50:44

by Joe Perches

[permalink] [raw]
Subject: [PATCH 07/36] drivers/gpu: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
drivers/gpu/drm/radeon/radeon_ttm.c | 2 +-
drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c | 2 +-
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
index e9918d8..6bacaa1 100644
--- a/drivers/gpu/drm/radeon/radeon_ttm.c
+++ b/drivers/gpu/drm/radeon/radeon_ttm.c
@@ -631,7 +631,7 @@ int radeon_mmap(struct file *filp, struct vm_area_struct *vma)
return drm_mmap(filp, vma);
}

- file_priv = (struct drm_file *)filp->private_data;
+ file_priv = filp->private_data;
rdev = file_priv->minor->dev->dev_private;
if (rdev == NULL) {
return -EINVAL;
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
index e6a1eb7..dc043c3 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c
@@ -542,7 +542,7 @@ int vmw_fifo_mmap(struct file *filp, struct vm_area_struct *vma)
struct drm_file *file_priv;
struct vmw_private *dev_priv;

- file_priv = (struct drm_file *)filp->private_data;
+ file_priv = filp->private_data;
dev_priv = vmw_priv(file_priv->minor->dev);

if (vma->vm_pgoff != (dev_priv->mmio_start >> PAGE_SHIFT) ||
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c
index e3df4ad..730951b 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c
@@ -39,7 +39,7 @@ int vmw_mmap(struct file *filp, struct vm_area_struct *vma)
return drm_mmap(filp, vma);
}

- file_priv = (struct drm_file *)filp->private_data;
+ file_priv = filp->private_data;
dev_priv = vmw_priv(file_priv->minor->dev);
return ttm_bo_mmap(filp, vma, &dev_priv->bdev);
}
--
1.7.1.337.g6068.dirty

2010-07-12 20:57:05

by Joe Perches

[permalink] [raw]
Subject: [PATCH 09/36] drivers/infiniband: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
drivers/infiniband/hw/ipath/ipath_file_ops.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/hw/ipath/ipath_file_ops.c b/drivers/infiniband/hw/ipath/ipath_file_ops.c
index 9c5c66d..65eb892 100644
--- a/drivers/infiniband/hw/ipath/ipath_file_ops.c
+++ b/drivers/infiniband/hw/ipath/ipath_file_ops.c
@@ -2055,7 +2055,7 @@ static int ipath_close(struct inode *in, struct file *fp)

mutex_lock(&ipath_mutex);

- fd = (struct ipath_filedata *) fp->private_data;
+ fd = fp->private_data;
fp->private_data = NULL;
pd = fd->pd;
if (!pd) {
--
1.7.1.337.g6068.dirty

2010-07-12 20:56:49

by Joe Perches

[permalink] [raw]
Subject: [PATCH 10/36] drivers/isdn: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
drivers/isdn/capi/capi.c | 6 +++---
drivers/isdn/hysdn/hysdn_proclog.c | 2 +-
drivers/isdn/i4l/isdn_ppp.c | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/isdn/capi/capi.c b/drivers/isdn/capi/capi.c
index 0cabe31..c2d4ba4 100644
--- a/drivers/isdn/capi/capi.c
+++ b/drivers/isdn/capi/capi.c
@@ -691,7 +691,7 @@ unlock_out:
static ssize_t
capi_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
{
- struct capidev *cdev = (struct capidev *)file->private_data;
+ struct capidev *cdev = file->private_data;
struct sk_buff *skb;
size_t copied;
int err;
@@ -726,7 +726,7 @@ capi_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
static ssize_t
capi_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos)
{
- struct capidev *cdev = (struct capidev *)file->private_data;
+ struct capidev *cdev = file->private_data;
struct sk_buff *skb;
u16 mlen;

@@ -773,7 +773,7 @@ capi_write(struct file *file, const char __user *buf, size_t count, loff_t *ppos
static unsigned int
capi_poll(struct file *file, poll_table * wait)
{
- struct capidev *cdev = (struct capidev *)file->private_data;
+ struct capidev *cdev = file->private_data;
unsigned int mask = 0;

if (!cdev->ap.applid)
diff --git a/drivers/isdn/hysdn/hysdn_proclog.c b/drivers/isdn/hysdn/hysdn_proclog.c
index e83f6fd..c58a72d 100644
--- a/drivers/isdn/hysdn/hysdn_proclog.c
+++ b/drivers/isdn/hysdn/hysdn_proclog.c
@@ -157,7 +157,7 @@ hysdn_log_write(struct file *file, const char __user *buf, size_t count, loff_t
int found = 0;
unsigned char *cp, valbuf[128];
long base = 10;
- hysdn_card *card = (hysdn_card *) file->private_data;
+ hysdn_card *card = file->private_data;

if (count > (sizeof(valbuf) - 1))
count = sizeof(valbuf) - 1; /* limit length */
diff --git a/drivers/isdn/i4l/isdn_ppp.c b/drivers/isdn/i4l/isdn_ppp.c
index 8c46bae..fe824e0 100644
--- a/drivers/isdn/i4l/isdn_ppp.c
+++ b/drivers/isdn/i4l/isdn_ppp.c
@@ -477,7 +477,7 @@ isdn_ppp_ioctl(int min, struct file *file, unsigned int cmd, unsigned long arg)
struct isdn_ppp_comp_data data;
void __user *argp = (void __user *)arg;

- is = (struct ippp_struct *) file->private_data;
+ is = file->private_data;
lp = is->lp;

if (is->debug & 0x1)
--
1.7.1.337.g6068.dirty

2010-07-12 20:50:35

by Joe Perches

[permalink] [raw]
Subject: [PATCH 02/36] arch/ia64: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
arch/ia64/kernel/perfmon.c | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 7443290..9b6580c 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -1573,7 +1573,7 @@ pfm_read(struct file *filp, char __user *buf, size_t size, loff_t *ppos)
return -EINVAL;
}

- ctx = (pfm_context_t *)filp->private_data;
+ ctx = filp->private_data;
if (ctx == NULL) {
printk(KERN_ERR "perfmon: pfm_read: NULL ctx [%d]\n", task_pid_nr(current));
return -EINVAL;
@@ -1673,7 +1673,7 @@ pfm_poll(struct file *filp, poll_table * wait)
return 0;
}

- ctx = (pfm_context_t *)filp->private_data;
+ ctx = filp->private_data;
if (ctx == NULL) {
printk(KERN_ERR "perfmon: pfm_poll: NULL ctx [%d]\n", task_pid_nr(current));
return 0;
@@ -1733,7 +1733,7 @@ pfm_fasync(int fd, struct file *filp, int on)
return -EBADF;
}

- ctx = (pfm_context_t *)filp->private_data;
+ ctx = filp->private_data;
if (ctx == NULL) {
printk(KERN_ERR "perfmon: pfm_fasync NULL ctx [%d]\n", task_pid_nr(current));
return -EBADF;
@@ -1841,7 +1841,7 @@ pfm_flush(struct file *filp, fl_owner_t id)
return -EBADF;
}

- ctx = (pfm_context_t *)filp->private_data;
+ ctx = filp->private_data;
if (ctx == NULL) {
printk(KERN_ERR "perfmon: pfm_flush: NULL ctx [%d]\n", task_pid_nr(current));
return -EBADF;
@@ -1984,7 +1984,7 @@ pfm_close(struct inode *inode, struct file *filp)
return -EBADF;
}

- ctx = (pfm_context_t *)filp->private_data;
+ ctx = filp->private_data;
if (ctx == NULL) {
printk(KERN_ERR "perfmon: pfm_close: NULL ctx [%d]\n", task_pid_nr(current));
return -EBADF;
@@ -4906,7 +4906,7 @@ restart_args:
goto error_args;
}

- ctx = (pfm_context_t *)file->private_data;
+ ctx = file->private_data;
if (unlikely(ctx == NULL)) {
DPRINT(("no context for fd %d\n", fd));
goto error_args;
--
1.7.1.337.g6068.dirty

2010-07-12 20:50:37

by Joe Perches

[permalink] [raw]
Subject: [PATCH 05/36] drivers/bluetooth: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
drivers/bluetooth/btmrvl_debugfs.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/bluetooth/btmrvl_debugfs.c b/drivers/bluetooth/btmrvl_debugfs.c
index b50b41d..54739b0 100644
--- a/drivers/bluetooth/btmrvl_debugfs.c
+++ b/drivers/bluetooth/btmrvl_debugfs.c
@@ -216,7 +216,7 @@ static const struct file_operations btmrvl_gpiogap_fops = {
static ssize_t btmrvl_hscmd_write(struct file *file, const char __user *ubuf,
size_t count, loff_t *ppos)
{
- struct btmrvl_private *priv = (struct btmrvl_private *) file->private_data;
+ struct btmrvl_private *priv = file->private_data;
char buf[16];
long result, ret;

--
1.7.1.337.g6068.dirty

2010-07-12 20:57:50

by Joe Perches

[permalink] [raw]
Subject: [PATCH 03/36] arch/powerpc: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
arch/powerpc/kvm/timing.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/kvm/timing.c b/arch/powerpc/kvm/timing.c
index 7037855..46fa04f 100644
--- a/arch/powerpc/kvm/timing.c
+++ b/arch/powerpc/kvm/timing.c
@@ -182,7 +182,7 @@ static ssize_t kvmppc_exit_timing_write(struct file *file,
}

if (c == 'c') {
- struct seq_file *seqf = (struct seq_file *)file->private_data;
+ struct seq_file *seqf = file->private_data;
struct kvm_vcpu *vcpu = seqf->private;
/* Write does not affect our buffers previously generated with
* show. seq_file is locked here to prevent races of init with
--
1.7.1.337.g6068.dirty

2010-07-12 20:57:28

by Joe Perches

[permalink] [raw]
Subject: [PATCH 08/36] drivers/ieee1394: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
drivers/ieee1394/dv1394.c | 4 ++--
drivers/ieee1394/raw1394.c | 4 ++--
drivers/ieee1394/video1394.c | 6 +++---
3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/ieee1394/dv1394.c b/drivers/ieee1394/dv1394.c
index f8fcbd0..c5a031b 100644
--- a/drivers/ieee1394/dv1394.c
+++ b/drivers/ieee1394/dv1394.c
@@ -172,7 +172,7 @@ static DEFINE_SPINLOCK(dv1394_cards_lock);

static inline struct video_card* file_to_video_card(struct file *file)
{
- return (struct video_card*) file->private_data;
+ return file->private_data;
}

/*** FRAME METHODS *********************************************************/
@@ -1783,7 +1783,7 @@ static int dv1394_open(struct inode *inode, struct file *file)
struct video_card *video = NULL;

if (file->private_data) {
- video = (struct video_card*) file->private_data;
+ video = file->private_data;

} else {
/* look up the card by ID */
diff --git a/drivers/ieee1394/raw1394.c b/drivers/ieee1394/raw1394.c
index 2c417ae..f340142 100644
--- a/drivers/ieee1394/raw1394.c
+++ b/drivers/ieee1394/raw1394.c
@@ -440,7 +440,7 @@ static struct pending_request *next_complete_req(struct file_info *fi)
static ssize_t raw1394_read(struct file *file, char __user * buffer,
size_t count, loff_t * offset_is_ignored)
{
- struct file_info *fi = (struct file_info *)file->private_data;
+ struct file_info *fi = file->private_data;
struct pending_request *req;
ssize_t ret;

@@ -2244,7 +2244,7 @@ static int state_connected(struct file_info *fi, struct pending_request *req)
static ssize_t raw1394_write(struct file *file, const char __user * buffer,
size_t count, loff_t * offset_is_ignored)
{
- struct file_info *fi = (struct file_info *)file->private_data;
+ struct file_info *fi = file->private_data;
struct pending_request *req;
ssize_t retval = -EBADFD;

diff --git a/drivers/ieee1394/video1394.c b/drivers/ieee1394/video1394.c
index a77483b..5c74f79 100644
--- a/drivers/ieee1394/video1394.c
+++ b/drivers/ieee1394/video1394.c
@@ -720,7 +720,7 @@ static inline unsigned video1394_buffer_state(struct dma_iso_ctx *d,
static long video1394_ioctl(struct file *file,
unsigned int cmd, unsigned long arg)
{
- struct file_ctx *ctx = (struct file_ctx *)file->private_data;
+ struct file_ctx *ctx = file->private_data;
struct ti_ohci *ohci = ctx->ohci;
unsigned long flags;
void __user *argp = (void __user *)arg;
@@ -1172,7 +1172,7 @@ static long video1394_ioctl(struct file *file,

static int video1394_mmap(struct file *file, struct vm_area_struct *vma)
{
- struct file_ctx *ctx = (struct file_ctx *)file->private_data;
+ struct file_ctx *ctx = file->private_data;

if (ctx->current_ctx == NULL) {
PRINT(KERN_ERR, ctx->ohci->host->id,
@@ -1239,7 +1239,7 @@ static int video1394_open(struct inode *inode, struct file *file)

static int video1394_release(struct inode *inode, struct file *file)
{
- struct file_ctx *ctx = (struct file_ctx *)file->private_data;
+ struct file_ctx *ctx = file->private_data;
struct ti_ohci *ohci = ctx->ohci;
struct list_head *lh, *next;
u64 mask;
--
1.7.1.337.g6068.dirty

2010-07-12 20:58:18

by Joe Perches

[permalink] [raw]
Subject: [PATCH 01/36] arch/cris: Remove unnecessary casts of private_data

Signed-off-by: Joe Perches <[email protected]>
---
arch/cris/arch-v32/drivers/mach-fs/gpio.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/arch/cris/arch-v32/drivers/mach-fs/gpio.c b/arch/cris/arch-v32/drivers/mach-fs/gpio.c
index d89ab80..9939857 100644
--- a/arch/cris/arch-v32/drivers/mach-fs/gpio.c
+++ b/arch/cris/arch-v32/drivers/mach-fs/gpio.c
@@ -185,7 +185,7 @@ static volatile unsigned long *dir_oe[NUM_PORTS] = {
static unsigned int gpio_poll(struct file *file, struct poll_table_struct *wait)
{
unsigned int mask = 0;
- struct gpio_private *priv = (struct gpio_private *)file->private_data;
+ struct gpio_private *priv = file->private_data;
unsigned long data;
poll_wait(file, &priv->alarm_wq, wait);
if (priv->minor == GPIO_MINOR_A) {
@@ -353,7 +353,7 @@ gpio_pa_interrupt(int irq, void *dev_id)
static ssize_t gpio_write(struct file *file, const char *buf, size_t count,
loff_t *off)
{
- struct gpio_private *priv = (struct gpio_private *)file->private_data;
+ struct gpio_private *priv = file->private_data;
unsigned char data, clk_mask, data_mask, write_msb;
unsigned long flags;
unsigned long shadow;
@@ -468,7 +468,7 @@ gpio_release(struct inode *inode, struct file *filp)

spin_lock_irq(&alarm_lock);
p = alarmlist;
- todel = (struct gpio_private *)filp->private_data;
+ todel = filp->private_data;

if (p == todel) {
alarmlist = todel->next;
@@ -567,7 +567,7 @@ gpio_ioctl(struct inode *inode, struct file *file,
unsigned long flags;
unsigned long val;
unsigned long shadow;
- struct gpio_private *priv = (struct gpio_private *)file->private_data;
+ struct gpio_private *priv = file->private_data;
if (_IOC_TYPE(cmd) != ETRAXGPIO_IOCTYPE)
return -EINVAL;

@@ -714,7 +714,7 @@ virtual_gpio_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
unsigned long flags;
unsigned short val;
unsigned short shadow;
- struct gpio_private *priv = (struct gpio_private *)file->private_data;
+ struct gpio_private *priv = file->private_data;

switch (_IOC_NR(cmd)) {
case IO_SETBITS:
--
1.7.1.337.g6068.dirty

2010-07-12 21:40:41

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [PATCH 05/36] drivers/bluetooth: Remove unnecessary casts of private_data

Hi Joe,

> Signed-off-by: Joe Perches <[email protected]>
> ---
> drivers/bluetooth/btmrvl_debugfs.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)

patch has been applied to bluetooth-next-2.6 tree. Thanks.

Regards

Marcel

2010-07-12 22:39:50

by Joel Becker

[permalink] [raw]
Subject: Re: [PATCH 27/36] fs/ocfs2: Remove unnecessary casts of private_data

On Mon, Jul 12, 2010 at 01:50:19PM -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <[email protected]>
> ---
> fs/ocfs2/dlm/dlmdebug.c | 6 +++---
> fs/ocfs2/dlmfs/dlmfs.c | 3 +--
> fs/ocfs2/dlmglue.c | 4 ++--
> 3 files changed, 6 insertions(+), 7 deletions(-)

Acked-by: Joel Becker <[email protected]>

Btw, how hilarious is the comment for private_data?

Joel

--

A good programming language should have features that make the
kind of people who use the phrase "software engineering" shake
their heads disapprovingly.
- Paul Graham

Joel Becker
Consulting Software Developer
Oracle
E-mail: [email protected]
Phone: (650) 506-8127

2010-07-12 23:58:06

by Jarod Wilson

[permalink] [raw]
Subject: Re: [PATCH 11/36] drivers/media: Remove unnecessary casts of private_data

On Mon, Jul 12, 2010 at 4:50 PM, Joe Perches <[email protected]> wrote:
> Signed-off-by: Joe Perches <[email protected]>
> ---
> ?drivers/media/IR/imon.c ? ? ? ? ? ? ? ? ? ?| ? ?6 +++---

For the imon parts,

Acked-by: Jarod Wilson <[email protected]>


--
Jarod Wilson
[email protected]

2010-07-13 04:13:32

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 10/36] drivers/isdn: Remove unnecessary casts of private_data

From: Joe Perches <[email protected]>
Date: Mon, 12 Jul 2010 13:50:02 -0700

> Signed-off-by: Joe Perches <[email protected]>

Applied.

2010-07-13 04:13:40

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 13/36] drivers/net/caif: Remove unnecessary casts of private_data

From: Joe Perches <[email protected]>
Date: Mon, 12 Jul 2010 13:50:05 -0700

> Signed-off-by: Joe Perches <[email protected]>

Applied.

2010-07-13 04:13:48

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 31/36] net/core: Remove unnecessary casts of private_data

From: Joe Perches <[email protected]>
Date: Mon, 12 Jul 2010 13:50:23 -0700

> Signed-off-by: Joe Perches <[email protected]>

Applied.

2010-07-13 04:13:57

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 32/36] net/irda: Remove unnecessary casts of private_data

From: Joe Perches <[email protected]>
Date: Mon, 12 Jul 2010 13:50:24 -0700

> Signed-off-by: Joe Perches <[email protected]>

Applied.

2010-07-13 04:18:42

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 16/36] drivers/sbus: Remove unnecessary casts of private_data

From: Joe Perches <[email protected]>
Date: Mon, 12 Jul 2010 13:50:08 -0700

> Signed-off-by: Joe Perches <[email protected]>

Applied.

Looks like we need a pattern for drivers/sbus in MAINTAINERS, I'll add it.

2010-07-13 05:04:46

by Joe Perches

[permalink] [raw]
Subject: Re: [PATCH 16/36] drivers/sbus: Remove unnecessary casts of private_data

On Mon, 2010-07-12 at 21:18 -0700, David Miller wrote:
> Looks like we need a pattern for drivers/sbus in MAINTAINERS, I'll add it.

Oh good, thanks.

Unsurprisingly, it looks like it should be you...

$ git log --format=%an drivers/sbus | sort | uniq -c | sort -rn | head -5
54 David S. Miller
12 Christoph Hellwig
11 Arnd Bergmann
11 Al Viro
6 Tejun Heo

2010-07-13 08:14:05

by Laurent Pinchart

[permalink] [raw]
Subject: Re: [PATCH 11/36] drivers/media: Remove unnecessary casts of private_data

Hi Joe,

On Monday 12 July 2010 22:50:03 Joe Perches wrote:
> Signed-off-by: Joe Perches <[email protected]>

For uvcvideo,

Acked-by: Laurent Pinchart <[email protected]>

--
Regards,

Laurent Pinchart

2010-07-13 08:25:56

by Stefan Richter

[permalink] [raw]
Subject: Re: [PATCH 08/36] drivers/ieee1394: Remove unnecessary casts of private_data

Joe Perches wrote:
> Signed-off-by: Joe Perches <[email protected]>
> ---
> drivers/ieee1394/dv1394.c | 4 ++--
> drivers/ieee1394/raw1394.c | 4 ++--
> drivers/ieee1394/video1394.c | 6 +++---
> 3 files changed, 7 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/ieee1394/dv1394.c b/drivers/ieee1394/dv1394.c
> index f8fcbd0..c5a031b 100644
> --- a/drivers/ieee1394/dv1394.c
> +++ b/drivers/ieee1394/dv1394.c
> @@ -172,7 +172,7 @@ static DEFINE_SPINLOCK(dv1394_cards_lock);
>
> static inline struct video_card* file_to_video_card(struct file *file)
> {
> - return (struct video_card*) file->private_data;
> + return file->private_data;
[...]

Committed to linux1394-2.6.git.

drivers/ieee1394/ is both frozen and obsolete code that is scheduled for
removal. But this change is obvious enough to be applied nevertheless
before that code finally goes away.
--
Stefan Richter
-=====-==-=- -=== -==-=
http://arcgraph.de/sr/

2010-07-13 10:45:54

by Liam Girdwood

[permalink] [raw]
Subject: Re: [PATCH 34/36] sound/soc/blackfin: Remove unnecessary casts of private_data

On Mon, 2010-07-12 at 13:50 -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <[email protected]>

Fwiw, we are getting rid of the void * private_data in the ASoC
multi-component patch series and will use dev_get_drvdata() style
accessors.

Both ASoC patches

Acked-by: Liam Girdwood <[email protected]>
--
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk

2010-07-13 11:38:51

by Mark Brown

[permalink] [raw]
Subject: Re: [PATCH 34/36] sound/soc/blackfin: Remove unnecessary casts of private_data

On Mon, Jul 12, 2010 at 01:50:26PM -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <[email protected]>

Applied both, thanks.

2010-07-13 18:41:41

by Ralph Campbell

[permalink] [raw]
Subject: Re: [PATCH 09/36] drivers/infiniband: Remove unnecessary casts of private_data

Acked-by: Ralph Campbell <[email protected]>

On Mon, 2010-07-12 at 13:50 -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <[email protected]>
> ---
> drivers/infiniband/hw/ipath/ipath_file_ops.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/infiniband/hw/ipath/ipath_file_ops.c b/drivers/infiniband/hw/ipath/ipath_file_ops.c
> index 9c5c66d..65eb892 100644
> --- a/drivers/infiniband/hw/ipath/ipath_file_ops.c
> +++ b/drivers/infiniband/hw/ipath/ipath_file_ops.c
> @@ -2055,7 +2055,7 @@ static int ipath_close(struct inode *in, struct file *fp)
>
> mutex_lock(&ipath_mutex);
>
> - fd = (struct ipath_filedata *) fp->private_data;
> + fd = fp->private_data;
> fp->private_data = NULL;
> pd = fd->pd;
> if (!pd) {

2010-07-15 02:41:27

by Steve French

[permalink] [raw]
Subject: Re: [PATCH 22/36] fs/cifs: Remove unnecessary casts of private_data

merged into cifs-2.6.git

On Mon, Jul 12, 2010 at 3:50 PM, Joe Perches <[email protected]> wrote:
> Signed-off-by: Joe Perches <[email protected]>
> ---
> ?fs/cifs/file.c ?| ? 24 ++++++++++--------------
> ?fs/cifs/inode.c | ? ?4 ++--
> ?fs/cifs/ioctl.c | ? ?3 +--
> ?3 files changed, 13 insertions(+), 18 deletions(-)
>
> diff --git a/fs/cifs/file.c b/fs/cifs/file.c
> index 409e4f5..b5fb2a0 100644
> --- a/fs/cifs/file.c
> +++ b/fs/cifs/file.c
> @@ -427,7 +427,7 @@ static int cifs_reopen_file(struct file *file, bool can_flush)
> ? ? ? ?__u16 netfid;
>
> ? ? ? ?if (file->private_data)
> - ? ? ? ? ? ? ? pCifsFile = (struct cifsFileInfo *)file->private_data;
> + ? ? ? ? ? ? ? pCifsFile = file->private_data;
> ? ? ? ?else
> ? ? ? ? ? ? ? ?return -EBADF;
>
> @@ -565,8 +565,7 @@ int cifs_close(struct inode *inode, struct file *file)
> ? ? ? ?int xid, timeout;
> ? ? ? ?struct cifs_sb_info *cifs_sb;
> ? ? ? ?struct cifsTconInfo *pTcon;
> - ? ? ? struct cifsFileInfo *pSMBFile =
> - ? ? ? ? ? ? ? (struct cifsFileInfo *)file->private_data;
> + ? ? ? struct cifsFileInfo *pSMBFile = file->private_data;
>
> ? ? ? ?xid = GetXid();
>
> @@ -641,8 +640,7 @@ int cifs_closedir(struct inode *inode, struct file *file)
> ?{
> ? ? ? ?int rc = 0;
> ? ? ? ?int xid;
> - ? ? ? struct cifsFileInfo *pCFileStruct =
> - ? ? ? ? ? (struct cifsFileInfo *)file->private_data;
> + ? ? ? struct cifsFileInfo *pCFileStruct = file->private_data;
> ? ? ? ?char *ptmp;
>
> ? ? ? ?cFYI(1, "Closedir inode = 0x%p", inode);
> @@ -863,8 +861,7 @@ int cifs_lock(struct file *file, int cmd, struct file_lock *pfLock)
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?length, pfLock,
> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?posix_lock_type, wait_flag);
> ? ? ? ?} else {
> - ? ? ? ? ? ? ? struct cifsFileInfo *fid =
> - ? ? ? ? ? ? ? ? ? ? ? (struct cifsFileInfo *)file->private_data;
> + ? ? ? ? ? ? ? struct cifsFileInfo *fid = file->private_data;
>
> ? ? ? ? ? ? ? ?if (numLock) {
> ? ? ? ? ? ? ? ? ? ? ? ?rc = CIFSSMBLock(xid, tcon, netfid, length,
> @@ -965,7 +962,7 @@ ssize_t cifs_user_write(struct file *file, const char __user *write_data,
>
> ? ? ? ?if (file->private_data == NULL)
> ? ? ? ? ? ? ? ?return -EBADF;
> - ? ? ? open_file = (struct cifsFileInfo *) file->private_data;
> + ? ? ? open_file = file->private_data;
>
> ? ? ? ?rc = generic_write_checks(file, poffset, &write_size, 0);
> ? ? ? ?if (rc)
> @@ -1067,7 +1064,7 @@ static ssize_t cifs_write(struct file *file, const char *write_data,
>
> ? ? ? ?if (file->private_data == NULL)
> ? ? ? ? ? ? ? ?return -EBADF;
> - ? ? ? open_file = (struct cifsFileInfo *)file->private_data;
> + ? ? ? open_file = file->private_data;
>
> ? ? ? ?xid = GetXid();
>
> @@ -1651,8 +1648,7 @@ int cifs_fsync(struct file *file, int datasync)
> ? ? ? ?int xid;
> ? ? ? ?int rc = 0;
> ? ? ? ?struct cifsTconInfo *tcon;
> - ? ? ? struct cifsFileInfo *smbfile =
> - ? ? ? ? ? ? ? (struct cifsFileInfo *)file->private_data;
> + ? ? ? struct cifsFileInfo *smbfile = file->private_data;
> ? ? ? ?struct inode *inode = file->f_path.dentry->d_inode;
>
> ? ? ? ?xid = GetXid();
> @@ -1756,7 +1752,7 @@ ssize_t cifs_user_read(struct file *file, char __user *read_data,
> ? ? ? ? ? ? ? ?FreeXid(xid);
> ? ? ? ? ? ? ? ?return rc;
> ? ? ? ?}
> - ? ? ? open_file = (struct cifsFileInfo *)file->private_data;
> + ? ? ? open_file = file->private_data;
>
> ? ? ? ?if ((file->f_flags & O_ACCMODE) == O_WRONLY)
> ? ? ? ? ? ? ? ?cFYI(1, "attempting read on write only file instance");
> @@ -1837,7 +1833,7 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
> ? ? ? ? ? ? ? ?FreeXid(xid);
> ? ? ? ? ? ? ? ?return rc;
> ? ? ? ?}
> - ? ? ? open_file = (struct cifsFileInfo *)file->private_data;
> + ? ? ? open_file = file->private_data;
>
> ? ? ? ?if ((file->f_flags & O_ACCMODE) == O_WRONLY)
> ? ? ? ? ? ? ? ?cFYI(1, "attempting read on write only file instance");
> @@ -1968,7 +1964,7 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
> ? ? ? ? ? ? ? ?FreeXid(xid);
> ? ? ? ? ? ? ? ?return rc;
> ? ? ? ?}
> - ? ? ? open_file = (struct cifsFileInfo *)file->private_data;
> + ? ? ? open_file = file->private_data;
> ? ? ? ?cifs_sb = CIFS_SB(file->f_path.dentry->d_sb);
> ? ? ? ?pTcon = cifs_sb->tcon;
>
> diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
> index 107c84d..ee08248 100644
> --- a/fs/cifs/inode.c
> +++ b/fs/cifs/inode.c
> @@ -288,7 +288,7 @@ int cifs_get_file_info_unix(struct file *filp)
> ? ? ? ?struct inode *inode = filp->f_path.dentry->d_inode;
> ? ? ? ?struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
> ? ? ? ?struct cifsTconInfo *tcon = cifs_sb->tcon;
> - ? ? ? struct cifsFileInfo *cfile = (struct cifsFileInfo *) filp->private_data;
> + ? ? ? struct cifsFileInfo *cfile = filp->private_data;
>
> ? ? ? ?xid = GetXid();
> ? ? ? ?rc = CIFSSMBUnixQFileInfo(xid, tcon, cfile->netfid, &find_data);
> @@ -515,7 +515,7 @@ int cifs_get_file_info(struct file *filp)
> ? ? ? ?struct inode *inode = filp->f_path.dentry->d_inode;
> ? ? ? ?struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
> ? ? ? ?struct cifsTconInfo *tcon = cifs_sb->tcon;
> - ? ? ? struct cifsFileInfo *cfile = (struct cifsFileInfo *) filp->private_data;
> + ? ? ? struct cifsFileInfo *cfile = filp->private_data;
>
> ? ? ? ?xid = GetXid();
> ? ? ? ?rc = CIFSSMBQFileInfo(xid, tcon, cfile->netfid, &find_data);
> diff --git a/fs/cifs/ioctl.c b/fs/cifs/ioctl.c
> index 505926f..9d38a71 100644
> --- a/fs/cifs/ioctl.c
> +++ b/fs/cifs/ioctl.c
> @@ -41,8 +41,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
> ? ? ? ?__u64 ? ExtAttrMask = 0;
> ? ? ? ?__u64 ? caps;
> ? ? ? ?struct cifsTconInfo *tcon;
> - ? ? ? struct cifsFileInfo *pSMBFile =
> - ? ? ? ? ? ? ? (struct cifsFileInfo *)filep->private_data;
> + ? ? ? struct cifsFileInfo *pSMBFile = filep->private_data;
> ?#endif /* CONFIG_CIFS_POSIX */
>
> ? ? ? ?xid = GetXid();
> --
> 1.7.1.337.g6068.dirty
>
>



--
Thanks,

Steve

2010-07-20 15:20:29

by Jiri Kosina

[permalink] [raw]
Subject: Re: [PATCH 27/36] fs/ocfs2: Remove unnecessary casts of private_data

On Mon, 12 Jul 2010, Joel Becker wrote:

> On Mon, Jul 12, 2010 at 01:50:19PM -0700, Joe Perches wrote:
> > Signed-off-by: Joe Perches <[email protected]>
> > ---
> > fs/ocfs2/dlm/dlmdebug.c | 6 +++---
> > fs/ocfs2/dlmfs/dlmfs.c | 3 +--
> > fs/ocfs2/dlmglue.c | 4 ++--
> > 3 files changed, 6 insertions(+), 7 deletions(-)
>
> Acked-by: Joel Becker <[email protected]>

As this change is not present in linux-next as of today, I have applied
it. Thanks,

--
Jiri Kosina
SUSE Labs, Novell Inc.

2010-07-20 15:24:23

by Jiri Kosina

[permalink] [raw]
Subject: Re: [PATCH 09/36] drivers/infiniband: Remove unnecessary casts of private_data

On Tue, 13 Jul 2010, Ralph Campbell wrote:

> Acked-by: Ralph Campbell <[email protected]>
>
> On Mon, 2010-07-12 at 13:50 -0700, Joe Perches wrote:
> > Signed-off-by: Joe Perches <[email protected]>
> > ---
> > drivers/infiniband/hw/ipath/ipath_file_ops.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/drivers/infiniband/hw/ipath/ipath_file_ops.c b/drivers/infiniband/hw/ipath/ipath_file_ops.c
> > index 9c5c66d..65eb892 100644
> > --- a/drivers/infiniband/hw/ipath/ipath_file_ops.c
> > +++ b/drivers/infiniband/hw/ipath/ipath_file_ops.c
> > @@ -2055,7 +2055,7 @@ static int ipath_close(struct inode *in, struct file *fp)
> >
> > mutex_lock(&ipath_mutex);
> >
> > - fd = (struct ipath_filedata *) fp->private_data;
> > + fd = fp->private_data;
> > fp->private_data = NULL;
> > pd = fd->pd;
> > if (!pd) {

As the patch is not present in linux-next as of today, I have applied it.
Thanks,

--
Jiri Kosina
SUSE Labs, Novell Inc.

2010-07-22 18:58:27

by Steven Rostedt

[permalink] [raw]
Subject: Re: [PATCH 29/36] kernel/trace: Remove unnecessary casts of private_data

Late reply due to traveling, but...

On Mon, 2010-07-12 at 13:50 -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <[email protected]>

Acked-by: Steven Rostedt <[email protected]>

-- Steve

> ---
> kernel/trace/ftrace.c | 4 ++--
> kernel/trace/trace.c | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
> index 0d88ce9..0691e87 100644
> --- a/kernel/trace/ftrace.c
> +++ b/kernel/trace/ftrace.c
> @@ -1592,7 +1592,7 @@ ftrace_failures_open(struct inode *inode, struct file *file)
>
> ret = ftrace_avail_open(inode, file);
> if (!ret) {
> - m = (struct seq_file *)file->private_data;
> + m = file->private_data;
> iter = (struct ftrace_iterator *)m->private;
> iter->flags = FTRACE_ITER_FAILURES;
> }
> @@ -2349,7 +2349,7 @@ static void __init set_ftrace_early_filters(void)
> static int
> ftrace_regex_release(struct inode *inode, struct file *file, int enable)
> {
> - struct seq_file *m = (struct seq_file *)file->private_data;
> + struct seq_file *m = file->private_data;
> struct ftrace_iterator *iter;
> struct trace_parser *parser;
>
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index 8683dec..10b82a1 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -2257,7 +2257,7 @@ int tracing_open_generic(struct inode *inode, struct file *filp)
>
> static int tracing_release(struct inode *inode, struct file *file)
> {
> - struct seq_file *m = (struct seq_file *)file->private_data;
> + struct seq_file *m = file->private_data;
> struct trace_iterator *iter;
> int cpu;
>

2010-07-23 12:56:46

by Theodore Ts'o

[permalink] [raw]
Subject: Re: [PATCH 26/36] fs/ext4: Remove unnecessary casts of private_data

On Mon, Jul 12, 2010 at 01:50:18PM -0700, Joe Perches wrote:
> Signed-off-by: Joe Perches <[email protected]>
> ---
> fs/ext4/dir.c | 2 +-
> fs/ext4/mballoc.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)

Thanks, applied to the ext4 tree.

- Ted

2010-07-30 17:29:00

by Jesper Nilsson

[permalink] [raw]
Subject: Re: [PATCH 01/36] arch/cris: Remove unnecessary casts of private_data

On Mon, Jul 12, 2010 at 10:49:53PM +0200, Joe Perches wrote:
> Signed-off-by: Joe Perches <[email protected]>

Thanks, added to the cris tree.

/^JN - Jesper Nilsson
--
Jesper Nilsson -- [email protected]