Skip to contentSkip to conversation

trivial: Remove unnecessary casts of private_data

PATCH Applied Joe Perches 7 participants 32 messages Sep 5, 2010 – Oct 6, 2010

Subsystems (20)
lore
Share & tools
lore
#0 lore raw

cover trivial: Remove unnecessary casts of private_data

Resend removal of remaining casts of private_data

Joe Perches (13):
drivers/gpu/drm: Remove unnecessary casts of private_data drivers/infiniband: Remove unnecessary casts of private_data drivers/net/wireless/iwlwifi: Remove unnecessary casts of private_data drivers/s390: Remove unnecessary casts of private_data drivers/scsi: Remove unnecessary casts of private_data drivers/staging/lirc: Remove unnecessary casts of private_data fs/ecryptfs: Remove unnecessary casts of private_data fs/seq_file.c: Remove unnecessary casts of private_data kernel/pm_qos_params.c: Remove unnecessary casts of private_data kernel/trace: Remove unnecessary casts of private_data net/ipv4: Remove unnecessary casts of private_data net/sunrpc/rpc_pipe.c: Remove unnecessary casts of private_data
sound: Remove unnecessary casts of private_data

 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/infiniband/hw/qib/qib_file_ops.c       |    4 ++--
 drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c |    2 +-
 drivers/net/wireless/iwlwifi/iwl-debugfs.c     |    4 ++--
 drivers/s390/char/vmcp.c                       |    6 +++---
 drivers/scsi/aacraid/linit.c                   |    2 +-
 drivers/scsi/sg.c                              |    2 +-
 drivers/staging/lirc/lirc_imon.c               |    4 ++--
 drivers/staging/lirc/lirc_zilog.c              |   10 +++++-----
 fs/ecryptfs/ecryptfs_kernel.h                  |    2 +-
 fs/seq_file.c                                  |    6 +++---
 kernel/pm_qos_params.c                         |    2 +-
 kernel/trace/ftrace.c                          |    4 ++--
 kernel/trace/trace.c                           |    2 +-
 net/ipv4/raw.c                                 |    2 +-
 net/sunrpc/rpc_pipe.c                          |    4 ++--
 sound/core/oss/mixer_oss.c                     |   22 +++++++++++-----------
 sound/core/pcm.c                               |    3 +--
 sound/drivers/virmidi.c                        |    2 +-
 sound/i2c/other/ak4xxx-adda.c                  |    2 +-
 sound/isa/ad1816a/ad1816a.c                    |    2 +-
 sound/isa/azt2320.c                            |    2 +-
 sound/isa/gus/gusmax.c                         |    4 ++--
 sound/isa/sb/sb8.c                             |    2 +-
 sound/oss/au1550_ac97.c                        |   18 +++++++++---------
 sound/pci/emu10k1/emumpu401.c                  |    2 +-
 sound/pci/ice1712/pontis.c                     |    6 +++---
 sound/pci/ice1712/prodigy192.c                 |    2 +-
 sound/pci/rme96.c                              |    8 ++++----
 sound/pci/rme9652/hdsp.c                       |    8 ++++----
 32 files changed, 72 insertions(+), 73 deletions(-)
Signature · 1 line
1.7.2.19.g9a302
#1 lore raw

PATCH 1/13 drivers/gpu/drm: Remove unnecessary casts of private_data

---
 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(-)
drivers/gpu/drm/radeon/radeon_ttm.c +1 -1
index 84c53e4..a823d8f 100644
@@ -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;
drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c +1 -1
index e6a1eb7..dc043c3 100644
@@ -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) ||
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c +1 -1
index 8312328..1e8eedd 100644
@@ -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);
 }
Signature · 1 line
1.7.2.19.g9a302
#2 lore raw

Re: [PATCH 01/13] drivers/gpu/drm: Remove unnecessary casts of private_data

Quoted 38 lines · Joe Perches
---
 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(-)
drivers/gpu/drm/radeon/radeon_ttm.c +1 -1
index 84c53e4..a823d8f 100644
@@ -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;
drivers/gpu/drm/vmwgfx/vmwgfx_fifo.c +1 -1
index e6a1eb7..dc043c3 100644
@@ -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) ||
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c +0 -0
index 8312328..1e8eedd 100644

drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c int vmw_mmap(struct file *filp, struct vm_area_struct *vma) · line 45

Quoted 8 lines
drivers/gpu/drm/vmwgfx/vmwgfx_ttm_glue.c +1 -1
@@ -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);
 }

This patch isn't present in linux-next as of today. Taking through trivial queue.

Thanks,

Signature · 2 lines
Jiri Kosina
SUSE Labs, Novell Inc.
#3 lore raw

PATCH 2/13 drivers/infiniband: Remove unnecessary casts of private_data

In reply to Joe Perches
---
 drivers/infiniband/hw/qib/qib_file_ops.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/qib/qib_file_ops.c +2 -2
index 6b11645..cef5d67 100644
@@ -1722,7 +1722,7 @@ static int qib_close(struct inode *in, struct file *fp)
 
 	mutex_lock(&qib_mutex);
 
-	fd = (struct qib_filedata *) fp->private_data;
+	fd = fp->private_data;
 	fp->private_data = NULL;
 	rcd = fd->rcd;
 	if (!rcd) {
@@ -1808,7 +1808,7 @@ static int qib_ctxt_info(struct file *fp, struct qib_ctxt_info __user *uinfo)
 	struct qib_ctxtdata *rcd = ctxt_fp(fp);
 	struct qib_filedata *fd;
 
-	fd = (struct qib_filedata *) fp->private_data;
+	fd = fp->private_data;
 
 	info.num_active = qib_count_active_units();
 	info.unit = rcd->dd->unit;
Signature · 1 line
1.7.2.19.g9a302
Acked-by on v1 2/13
#4 lore raw

Re: [PATCH 02/13] drivers/infiniband: Remove unnecessary casts of private_data

Quoted 19 lines · Joe Perches
---
 drivers/infiniband/hw/qib/qib_file_ops.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/qib/qib_file_ops.c +1 -1
index 6b11645..cef5d67 100644
@@ -1722,7 +1722,7 @@ static int qib_close(struct inode *in, struct file *fp)
 
 	mutex_lock(&qib_mutex);
 
-	fd = (struct qib_filedata *) fp->private_data;
+	fd = fp->private_data;
 	fp->private_data = NULL;
 	rcd = fd->rcd;
 	if (!rcd) {

drivers/infiniband/hw/qib/qib_file_ops.c static int qib_ctxt_info(struct file *fp, struct qib_ctxt_info __user *uinfo) · line 1814

Quoted 8 lines
drivers/infiniband/hw/qib/qib_file_ops.c +1 -1
@@ -1808,7 +1808,7 @@ static int qib_ctxt_info(struct file *fp, struct qib_ctxt_info __user *uinfo)
 	struct qib_ctxtdata *rcd = ctxt_fp(fp);
 	struct qib_filedata *fd;
 
-	fd = (struct qib_filedata *) fp->private_data;
+	fd = fp->private_data;
 
 	info.num_active = qib_count_active_units();
 	info.unit = rcd->dd->unit;

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Applied
#5 lore raw

Re: [PATCH 02/13] drivers/infiniband: Remove unnecessary casts of private_data

Quoted 1 line · Ralph Campbell

Applied, thanks.

Quoted 27 lines
Quoted 27 lines
---
 drivers/infiniband/hw/qib/qib_file_ops.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/qib/qib_file_ops.c +2 -2
index 6b11645..cef5d67 100644
@@ -1722,7 +1722,7 @@ static int qib_close(struct inode *in, struct file *fp)
 
 	mutex_lock(&qib_mutex);
 
-	fd = (struct qib_filedata *) fp->private_data;
+	fd = fp->private_data;
 	fp->private_data = NULL;
 	rcd = fd->rcd;
 	if (!rcd) {
@@ -1808,7 +1808,7 @@ static int qib_ctxt_info(struct file *fp, struct qib_ctxt_info __user *uinfo)
 	struct qib_ctxtdata *rcd = ctxt_fp(fp);
 	struct qib_filedata *fd;
 
-	fd = (struct qib_filedata *) fp->private_data;
+	fd = fp->private_data;
 
 	info.num_active = qib_count_active_units();
 	info.unit = rcd->dd->unit;
Signature · 6 lines
Jiri Kosina
SUSE Labs, Novell Inc.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#7 lore raw

PATCH 3/13 drivers/net/wireless/iwlwifi: Remove unnecessary casts of private_data

In reply to Joe Perches
---
 drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c |    2 +-
 drivers/net/wireless/iwlwifi/iwl-debugfs.c     |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/iwlwifi/iwl-agn-debugfs.c +1 -1
index d706b8a..215d29e 100644
@@ -929,7 +929,7 @@ ssize_t iwl_ucode_bt_stats_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;
 	int bufsz = (sizeof(struct statistics_bt_activity) * 24) + 200;
drivers/net/wireless/iwlwifi/iwl-debugfs.c +2 -2
index 0ee8f51..85e5ad4 100644
@@ -1528,7 +1528,7 @@ static ssize_t iwl_dbgfs_ucode_bt_stats_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;
 
 	return priv->cfg->ops->lib->debugfs_ops.bt_stats_read(file,
 			user_buf, count, ppos);
@@ -1566,7 +1566,7 @@ static ssize_t iwl_dbgfs_bt_traffic_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[200];
 	const size_t bufsz = sizeof(buf);
Signature · 1 line
1.7.2.19.g9a302
#8 lore raw

PATCH 4/13 drivers/s390: Remove unnecessary casts of private_data

In reply to Joe Perches
---
 drivers/s390/char/vmcp.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/s390/char/vmcp.c +3 -3
index 04e532e..19a14d9 100644
@@ -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
Signature · 1 line
1.7.2.19.g9a302
#9 lore raw

Re: [PATCH 04/13] drivers/s390: Remove unnecessary casts of private_data

Quoted 28 lines · Joe Perches
---
 drivers/s390/char/vmcp.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/s390/char/vmcp.c +2 -2
index 04e532e..19a14d9 100644
@@ -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;

drivers/s390/char/vmcp.c static long vmcp_ioctl(struct file *file, unsigned int cmd, unsigned long arg) · line 142

Quoted 8 lines
drivers/s390/char/vmcp.c +1 -1
@@ -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

Not present in linux-next as of today. Applied, thanks.

Signature · 2 lines
Jiri Kosina
SUSE Labs, Novell Inc.
#10 lore raw

PATCH 5/13 drivers/scsi: Remove unnecessary casts of private_data

In reply to Joe Perches
---
 drivers/scsi/aacraid/linit.c |    2 +-
 drivers/scsi/sg.c            |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/aacraid/linit.c +1 -1
index cad6f9a..aa40036 100644
@@ -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
 
drivers/scsi/sg.c +1 -1
index 78d6163..6efa8dd 100644
@@ -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;
Signature · 1 line
1.7.2.19.g9a302
#11 lore raw

Re: [PATCH 05/13] drivers/scsi: Remove unnecessary casts of private_data

Quoted 24 lines · Joe Perches
---
 drivers/scsi/aacraid/linit.c |    2 +-
 drivers/scsi/sg.c            |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/aacraid/linit.c +1 -1
index cad6f9a..aa40036 100644
@@ -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
 
drivers/scsi/sg.c +0 -0
index 78d6163..6efa8dd 100644

drivers/scsi/sg.c static void sg_put_dev(Sg_device *sdp); · line 216

Quoted 8 lines
drivers/scsi/sg.c +1 -1
@@ -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;

This patch isn't present in linux-next as of today. Applying to my tree now.

Signature · 2 lines
Jiri Kosina
SUSE Labs, Novell Inc.
#12 lore raw

PATCH 6/13 drivers/staging/lirc: Remove unnecessary casts of private_data

In reply to Joe Perches
---
 drivers/staging/lirc/lirc_imon.c  |    4 ++--
 drivers/staging/lirc/lirc_zilog.c |   10 +++++-----
 2 files changed, 7 insertions(+), 7 deletions(-)
drivers/staging/lirc/lirc_imon.c +2 -2
index 818bec0..9949dfa 100644
@@ -277,7 +277,7 @@ static int display_close(struct inode *inode, struct file *file)
 	struct imon_context *context = NULL;
 	int retval = 0;
 
-	context = (struct imon_context *)file->private_data;
+	context = file->private_data;
 
 	if (!context) {
 		err("%s: no context for device", __func__);
@@ -380,7 +380,7 @@ static ssize_t vfd_write(struct file *file, const char *buf,
 		0x01, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF };
 	int *data_buf;
 
-	context = (struct imon_context *)file->private_data;
+	context = file->private_data;
 	if (!context) {
 		err("%s: no context for device", __func__);
 		return -ENODEV;
drivers/staging/lirc/lirc_zilog.c +5 -5
index 100caab..9b77552 100644
@@ -716,7 +716,7 @@ static loff_t lseek(struct file *filep, loff_t offset, int orig)
 /* copied from lirc_dev */
 static ssize_t read(struct file *filep, char *outbuf, size_t n, loff_t *ppos)
 {
-	struct IR *ir = (struct IR *)filep->private_data;
+	struct IR *ir = filep->private_data;
 	unsigned char buf[ir->buf.chunk_size];
 	int ret = 0, written = 0;
 	DECLARE_WAITQUEUE(wait, current);
@@ -898,7 +898,7 @@ done:
 static ssize_t write(struct file *filep, const char *buf, size_t n,
 			  loff_t *ppos)
 {
-	struct IR *ir = (struct IR *)filep->private_data;
+	struct IR *ir = filep->private_data;
 	size_t i;
 	int failures = 0;
 
@@ -972,7 +972,7 @@ static ssize_t write(struct file *filep, const char *buf, size_t n,
 /* copied from lirc_dev */
 static unsigned int poll(struct file *filep, poll_table *wait)
 {
-	struct IR *ir = (struct IR *)filep->private_data;
+	struct IR *ir = filep->private_data;
 	unsigned int ret;
 
 	dprintk("poll called\n");
@@ -994,7 +994,7 @@ static unsigned int poll(struct file *filep, poll_table *wait)
 
 static long ioctl(struct file *filep, unsigned int cmd, unsigned long arg)
 {
-	struct IR *ir = (struct IR *)filep->private_data;
+	struct IR *ir = filep->private_data;
 	int result;
 	unsigned long mode, features = 0;
 
@@ -1086,7 +1086,7 @@ static int open(struct inode *node, struct file *filep)
 static int close(struct inode *node, struct file *filep)
 {
 	/* find our IR struct */
-	struct IR *ir = (struct IR *)filep->private_data;
+	struct IR *ir = filep->private_data;
 	if (ir == NULL) {
 		zilog_error("close: no private_data attached to the file!\n");
 		return -ENODEV;
Signature · 1 line
1.7.2.19.g9a302
#13 lore raw

PATCH 7/13 fs/ecryptfs: Remove unnecessary casts of private_data

In reply to Joe Perches
---
 fs/ecryptfs/ecryptfs_kernel.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/ecryptfs/ecryptfs_kernel.h +1 -1
index 0032a9f..40186b9 100644
@@ -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
Signature · 1 line
1.7.2.19.g9a302
Applied
#14 lore raw

Re: [PATCH 07/13] fs/ecryptfs: Remove unnecessary casts of private_data

Quoted 10 lines · Joe Perches
---
 fs/ecryptfs/ecryptfs_kernel.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/ecryptfs/ecryptfs_kernel.h +0 -0
index 0032a9f..40186b9 100644

fs/ecryptfs/ecryptfs_kernel.h ecryptfs_lower_header_size(struct ecryptfs_crypt_stat *crypt_stat) · line 483

Quoted 8 lines
fs/ecryptfs/ecryptfs_kernel.h +1 -1
@@ -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

Applied, thanks.

Signature · 2 lines
Jiri Kosina
SUSE Labs, Novell Inc.
#15 lore raw

PATCH 8/13 fs/seq_file.c: Remove unnecessary casts of private_data

In reply to Joe Perches
---
 fs/seq_file.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
fs/seq_file.c +3 -3
index e1f437b..0e7cb13 100644
@@ -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;
Signature · 1 line
1.7.2.19.g9a302
#16 lore raw

Re: [PATCH 08/13] fs/seq_file.c: Remove unnecessary casts of private_data

Quoted 28 lines · Joe Perches
---
 fs/seq_file.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
fs/seq_file.c +2 -2
index e1f437b..0e7cb13 100644
@@ -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);

fs/seq_file.c EXPORT_SYMBOL(seq_lseek); · line 330

Quoted 8 lines
fs/seq_file.c +1 -1
@@ -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;

Doesn't seem to be present in linux-next as of today. I am going to fold it into trivial queue, if anyone has any objections, shout now.

Signature · 2 lines
Jiri Kosina
SUSE Labs, Novell Inc.
#17 lore raw

PATCH 9/13 kernel/pm_qos_params.c: Remove unnecessary casts of private_data

In reply to Joe Perches
---
 kernel/pm_qos_params.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/pm_qos_params.c +1 -1
index b7e4c36..8414e51 100644
@@ -396,7 +396,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;
Signature · 1 line
1.7.2.19.g9a302
Applied
#18 lore raw

Re: [PATCH 09/13] kernel/pm_qos_params.c: Remove unnecessary casts of private_data

Quoted 10 lines · Joe Perches
---
 kernel/pm_qos_params.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/pm_qos_params.c +0 -0
index b7e4c36..8414e51 100644

kernel/pm_qos_params.c static ssize_t pm_qos_power_write(struct file *filp, const char __user *buf, · line 402

Quoted 8 lines
kernel/pm_qos_params.c +1 -1
@@ -396,7 +396,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;

Applied.

Signature · 2 lines
Jiri Kosina
SUSE Labs, Novell Inc.
#19 lore raw

PATCH 10/13 kernel/trace: Remove unnecessary casts of private_data

In reply to Joe Perches
---
 kernel/trace/ftrace.c |    4 ++--
 kernel/trace/trace.c  |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
kernel/trace/ftrace.c +2 -2
index 7cb1f45..fc9ee37 100644
@@ -1599,7 +1599,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;
 	}
@@ -2356,7 +2356,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;
 
kernel/trace/trace.c +1 -1
index 9ec59f5..001bcd2 100644
@@ -2196,7 +2196,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;
 
Signature · 1 line
1.7.2.19.g9a302
#20 lore raw

Re: [PATCH 10/13] kernel/trace: Remove unnecessary casts of private_data

Quoted 11 lines · Joe Perches
---
 kernel/trace/ftrace.c |    4 ++--
 kernel/trace/trace.c  |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
kernel/trace/ftrace.c +0 -0
index 7cb1f45..fc9ee37 100644

kernel/trace/ftrace.c ftrace_failures_open(struct inode *inode, struct file *file) · line 1603

Quoted 6 lines
kernel/trace/ftrace.c +1 -1
@@ -1599,7 +1599,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;

How about m->private here?

Signature · 2 lines
Jiri Kosina
SUSE Labs, Novell Inc.
#21 lore raw

PATCH 11/13 net/ipv4: Remove unnecessary casts of private_data

In reply to Joe Perches
---
 net/ipv4/raw.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
net/ipv4/raw.c +1 -1
index 1f85ef2..ea9aa9b 100644
@@ -985,7 +985,7 @@ int raw_seq_open(struct inode *ino, struct file *file,
 	if (err < 0)
 		return err;
 
-	i = raw_seq_private((struct seq_file *)file->private_data);
+	i = raw_seq_private(file->private_data);
 	i->h = h;
 	return 0;
 }
Signature · 1 line
1.7.2.19.g9a302
maintainer
#23 lore raw

Re: [PATCH 11/13] net/ipv4: Remove unnecessary casts of private_data

From: David Miller <[email protected]>
Date: Mon, 06 Sep 2010 18:30:36 -0700 (PDT)

Quoted 6 lines

From: Joe Perches <[email protected]>
Date: Sat, 4 Sep 2010 18:52:52 -0700

Quoted 1 line

Applied.

So Joe, did you even friggin' build test this?

raw_seq_private() expands to something which dereferences the pointer, which you've now made void, which is illegal and breaks the build.

Reverted.

#24 lore raw

PATCH 1/1 include/net/raw.h: Convert raw_seq_private macro to inline

Quoted 3 lines · David Miller

raw_seq_private() expands to something which dereferences the pointer, which you've now made void, which is illegal and breaks the build. Reverted.

Apologies, I had this in my tree which I didn't send because it wasn't a private_data cast removal.

---
 include/net/raw.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
include/net/raw.h +4 -1
index 43c5750..c621200 100644
@@ -45,7 +45,10 @@ struct raw_iter_state {
 	struct raw_hashinfo *h;
 };
 
-#define raw_seq_private(seq) ((struct raw_iter_state *)(seq)->private)
+inline struct raw_iter_state *raw_seq_private(struct seq_file *seq)
+{
+	return seq->private;
+}
 void *raw_seq_start(struct seq_file *seq, loff_t *pos);
 void *raw_seq_next(struct seq_file *seq, void *v, loff_t *pos);
 void raw_seq_stop(struct seq_file *seq, void *v);
#25 lore raw

Re: [PATCH net-next] include/net/raw.h: Convert raw_seq_private macro to inline

include/net/raw.h struct raw_iter_state { · line 48

Quoted 10 lines · Joe Perches
include/net/raw.h +1 -1
index 43c5750..c621200 100644
@@ -45,7 +45,10 @@ struct raw_iter_state {
 	struct raw_hashinfo *h;
 };
 
-#define raw_seq_private(seq) ((struct raw_iter_state *)(seq)->private)
+inline struct raw_iter_state *raw_seq_private(struct seq_file *seq)

This needs to be declared static.

Quoted 6 lines
include/net/raw.h +3 -0
+{
+	return seq->private;
+}
 void *raw_seq_start(struct seq_file *seq, loff_t *pos);
 void *raw_seq_next(struct seq_file *seq, void *v, loff_t *pos);
 void raw_seq_stop(struct seq_file *seq, void *v);
Signature · 1 line
Nick Bowler, Elliptic Technologies (http://www.elliptictech.com/)
#26 lore raw

PATCH v2 1/1 include/net/raw.h: Convert raw_seq_private macro to inline

---
 include/net/raw.h |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
include/net/raw.h +4 -1
index 43c5750..42ce6fe 100644
@@ -45,7 +45,10 @@ struct raw_iter_state {
 	struct raw_hashinfo *h;
 };
 
-#define raw_seq_private(seq) ((struct raw_iter_state *)(seq)->private)
+static inline struct raw_iter_state *raw_seq_private(struct seq_file *seq)
+{
+	return seq->private;
+}
 void *raw_seq_start(struct seq_file *seq, loff_t *pos);
 void *raw_seq_next(struct seq_file *seq, void *v, loff_t *pos);
 void raw_seq_stop(struct seq_file *seq, void *v);
#28 lore raw

PATCH 12/13 net/sunrpc/rpc_pipe.c: Remove unnecessary casts of private_data

In reply to Joe Perches
---
 net/sunrpc/rpc_pipe.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
net/sunrpc/rpc_pipe.c +2 -2
index 95ccbcf..1f7fc50 100644
@@ -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);
Signature · 1 line
1.7.2.19.g9a302
#29 lore raw

Re: [PATCH 12/13] net/sunrpc/rpc_pipe.c: Remove unnecessary casts of private_data

Quoted 19 lines · Joe Perches
---
 net/sunrpc/rpc_pipe.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
net/sunrpc/rpc_pipe.c +1 -1
index 95ccbcf..1f7fc50 100644
@@ -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;

net/sunrpc/rpc_pipe.c rpc_pipe_ioctl_unlocked(struct file *filp, unsigned int cmd, unsigned long arg) · line 328

Quoted 8 lines
net/sunrpc/rpc_pipe.c +1 -1
@@ -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);

Not present in linux-next as of today. Applying to trivial queue.

Signature · 6 lines
Jiri Kosina
SUSE Labs, Novell Inc.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#30 lore raw

PATCH 13/13 sound: Remove unnecessary casts of private_data

In reply to Joe Perches
---
 sound/core/oss/mixer_oss.c     |   22 +++++++++++-----------
 sound/core/pcm.c               |    3 +--
 sound/drivers/virmidi.c        |    2 +-
 sound/i2c/other/ak4xxx-adda.c  |    2 +-
 sound/isa/ad1816a/ad1816a.c    |    2 +-
 sound/isa/azt2320.c            |    2 +-
 sound/isa/gus/gusmax.c         |    4 ++--
 sound/isa/sb/sb8.c             |    2 +-
 sound/oss/au1550_ac97.c        |   18 +++++++++---------
 sound/pci/emu10k1/emumpu401.c  |    2 +-
 sound/pci/ice1712/pontis.c     |    6 +++---
 sound/pci/ice1712/prodigy192.c |    2 +-
 sound/pci/rme96.c              |    8 ++++----
 sound/pci/rme9652/hdsp.c       |    8 ++++----
 14 files changed, 41 insertions(+), 42 deletions(-)
sound/core/oss/mixer_oss.c +11 -11
index f50ebf2..86afb13 100644
@@ -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);
sound/core/pcm.c +1 -2
index 204af48..88525a9 100644
@@ -364,8 +364,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,
sound/drivers/virmidi.c +1 -1
index 0e631c3..f4cd493 100644
@@ -94,7 +94,7 @@ static int __devinit snd_virmidi_probe(struct platform_device *devptr)
 			      sizeof(struct snd_card_virmidi), &card);
 	if (err < 0)
 		return err;
-	vmidi = (struct snd_card_virmidi *)card->private_data;
+	vmidi = card->private_data;
 	vmidi->card = card;
 
 	if (midi_devs[dev] > MAX_MIDI_DEVICES) {
sound/i2c/other/ak4xxx-adda.c +1 -1
index 1adb8a3..ebab6c7 100644
@@ -878,7 +878,7 @@ static int build_deemphasis(struct snd_akm4xxx *ak, int num_emphs)
 static void proc_regs_read(struct snd_info_entry *entry,
 		struct snd_info_buffer *buffer)
 {
-	struct snd_akm4xxx *ak = (struct snd_akm4xxx *)entry->private_data;
+	struct snd_akm4xxx *ak = entry->private_data;
 	int reg, val, chip;
 	for (chip = 0; chip < ak->num_chips; chip++) {
 		for (reg = 0; reg < ak->total_regs; reg++) {
sound/isa/ad1816a/ad1816a.c +1 -1
index bbcbf92..3cb75bc 100644
@@ -162,7 +162,7 @@ static int __devinit snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard
 				sizeof(struct snd_card_ad1816a), &card);
 	if (error < 0)
 		return error;
-	acard = (struct snd_card_ad1816a *)card->private_data;
+	acard = card->private_data;
 
 	if ((error = snd_card_ad1816a_pnp(dev, acard, pcard, pid))) {
 		snd_card_free(card);
sound/isa/azt2320.c +1 -1
index f7aa637..aac8dc1 100644
@@ -188,7 +188,7 @@ static int __devinit snd_card_azt2320_probe(int dev,
 				sizeof(struct snd_card_azt2320), &card);
 	if (error < 0)
 		return error;
-	acard = (struct snd_card_azt2320 *)card->private_data;
+	acard = card->private_data;
 
 	if ((error = snd_card_azt2320_pnp(dev, acard, pcard, pid))) {
 		snd_card_free(card);
sound/isa/gus/gusmax.c +2 -2
index f26eac8..3e4a58b 100644
@@ -191,7 +191,7 @@ static int __devinit snd_gusmax_mixer(struct snd_wss *chip)
 
 static void snd_gusmax_free(struct snd_card *card)
 {
-	struct snd_gusmax *maxcard = (struct snd_gusmax *)card->private_data;
+	struct snd_gusmax *maxcard = card->private_data;
 	
 	if (maxcard == NULL)
 		return;
@@ -219,7 +219,7 @@ static int __devinit snd_gusmax_probe(struct device *pdev, unsigned int dev)
 	if (err < 0)
 		return err;
 	card->private_free = snd_gusmax_free;
-	maxcard = (struct snd_gusmax *)card->private_data;
+	maxcard = card->private_data;
 	maxcard->card = card;
 	maxcard->irq = -1;
 	
sound/isa/sb/sb8.c +1 -1
index 81284a8..2259e3f 100644
@@ -72,7 +72,7 @@ static irqreturn_t snd_sb8_interrupt(int irq, void *dev_id)
 
 static void snd_sb8_free(struct snd_card *card)
 {
-	struct snd_sb8 *acard = (struct snd_sb8 *)card->private_data;
+	struct snd_sb8 *acard = card->private_data;
 
 	if (acard == NULL)
 		return;
sound/oss/au1550_ac97.c +9 -9
index c6f2621..8a12621 100644
@@ -171,7 +171,7 @@ au1550_delay(int msec)
 static u16
 rdcodec(struct ac97_codec *codec, u8 addr)
 {
-	struct au1550_state *s = (struct au1550_state *)codec->private_data;
+	struct au1550_state *s = codec->private_data;
 	unsigned long   flags;
 	u32             cmd, val;
 	u16             data;
@@ -239,7 +239,7 @@ rdcodec(struct ac97_codec *codec, u8 addr)
 static void
 wrcodec(struct ac97_codec *codec, u8 addr, u16 data)
 {
-	struct au1550_state *s = (struct au1550_state *)codec->private_data;
+	struct au1550_state *s = codec->private_data;
 	unsigned long   flags;
 	u32             cmd, val;
 	int             i;
@@ -820,7 +820,7 @@ mixdev_ioctl(struct ac97_codec *codec, unsigned int cmd,
 static long
 au1550_ioctl_mixdev(struct file *file, unsigned int cmd, unsigned long arg)
 {
-	struct au1550_state *s = (struct au1550_state *)file->private_data;
+	struct au1550_state *s = file->private_data;
 	struct ac97_codec *codec = s->codec;
 	int ret;
 
@@ -1031,7 +1031,7 @@ copy_dmabuf_user(struct dmabuf *db, char* userbuf, int count, int to_user)
 static ssize_t
 au1550_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
 {
-	struct au1550_state *s = (struct au1550_state *)file->private_data;
+	struct au1550_state *s = file->private_data;
 	struct dmabuf  *db = &s->dma_adc;
 	DECLARE_WAITQUEUE(wait, current);
 	ssize_t         ret;
@@ -1111,7 +1111,7 @@ out2:
 static ssize_t
 au1550_write(struct file *file, const char *buffer, size_t count, loff_t * ppos)
 {
-	struct au1550_state *s = (struct au1550_state *)file->private_data;
+	struct au1550_state *s = file->private_data;
 	struct dmabuf  *db = &s->dma_dac;
 	DECLARE_WAITQUEUE(wait, current);
 	ssize_t         ret = 0;
@@ -1211,7 +1211,7 @@ out2:
 static unsigned int
 au1550_poll(struct file *file, struct poll_table_struct *wait)
 {
-	struct au1550_state *s = (struct au1550_state *)file->private_data;
+	struct au1550_state *s = file->private_data;
 	unsigned long   flags;
 	unsigned int    mask = 0;
 
@@ -1250,7 +1250,7 @@ au1550_poll(struct file *file, struct poll_table_struct *wait)
 static int
 au1550_mmap(struct file *file, struct vm_area_struct *vma)
 {
-	struct au1550_state *s = (struct au1550_state *)file->private_data;
+	struct au1550_state *s = file->private_data;
 	struct dmabuf  *db;
 	unsigned long   size;
 	int ret = 0;
@@ -1342,7 +1342,7 @@ dma_count_done(struct dmabuf *db)
 static int
 au1550_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
-	struct au1550_state *s = (struct au1550_state *)file->private_data;
+	struct au1550_state *s = file->private_data;
 	unsigned long   flags;
 	audio_buf_info  abinfo;
 	count_info      cinfo;
@@ -1868,7 +1868,7 @@ out2:
 static int
 au1550_release(struct inode *inode, struct file *file)
 {
-	struct au1550_state *s = (struct au1550_state *)file->private_data;
+	struct au1550_state *s = file->private_data;
 
 	lock_kernel();
 
sound/pci/emu10k1/emumpu401.c +1 -1
index 8578c70..bab5648 100644
@@ -321,7 +321,7 @@ static struct snd_rawmidi_ops snd_emu10k1_midi_input =
 
 static void snd_emu10k1_midi_free(struct snd_rawmidi *rmidi)
 {
-	struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)rmidi->private_data;
+	struct snd_emu10k1_midi *midi = rmidi->private_data;
 	midi->interrupt = NULL;
 	midi->rmidi = NULL;
 }
sound/pci/ice1712/pontis.c +3 -3
index 6bc3f91..cdb873f 100644
@@ -638,7 +638,7 @@ static struct snd_kcontrol_new pontis_controls[] __devinitdata = {
  */
 static void wm_proc_regs_write(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
 {
-	struct snd_ice1712 *ice = (struct snd_ice1712 *)entry->private_data;
+	struct snd_ice1712 *ice = entry->private_data;
 	char line[64];
 	unsigned int reg, val;
 	mutex_lock(&ice->gpio_mutex);
@@ -653,7 +653,7 @@ static void wm_proc_regs_write(struct snd_info_entry *entry, struct snd_info_buf
 
 static void wm_proc_regs_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
 {
-	struct snd_ice1712 *ice = (struct snd_ice1712 *)entry->private_data;
+	struct snd_ice1712 *ice = entry->private_data;
 	int reg, val;
 
 	mutex_lock(&ice->gpio_mutex);
@@ -676,7 +676,7 @@ static void wm_proc_init(struct snd_ice1712 *ice)
 
 static void cs_proc_regs_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
 {
-	struct snd_ice1712 *ice = (struct snd_ice1712 *)entry->private_data;
+	struct snd_ice1712 *ice = entry->private_data;
 	int reg, val;
 
 	mutex_lock(&ice->gpio_mutex);
sound/pci/ice1712/prodigy192.c +1 -1
index 2a8e5cd..e36ddb9 100644
@@ -654,7 +654,7 @@ static int prodigy192_ak4114_init(struct snd_ice1712 *ice)
 static void stac9460_proc_regs_read(struct snd_info_entry *entry,
 		struct snd_info_buffer *buffer)
 {
-	struct snd_ice1712 *ice = (struct snd_ice1712 *)entry->private_data;
+	struct snd_ice1712 *ice = entry->private_data;
 	int reg, val;
 	/* registers 0x0 - 0x14 */
 	for (reg = 0; reg <= 0x15; reg++) {
sound/pci/rme96.c +4 -4
index d19dc05..d5f5b44 100644
@@ -1527,14 +1527,14 @@ snd_rme96_free(void *private_data)
 static void
 snd_rme96_free_spdif_pcm(struct snd_pcm *pcm)
 {
-	struct rme96 *rme96 = (struct rme96 *) pcm->private_data;
+	struct rme96 *rme96 = pcm->private_data;
 	rme96->spdif_pcm = NULL;
 }
 
 static void
 snd_rme96_free_adat_pcm(struct snd_pcm *pcm)
 {
-	struct rme96 *rme96 = (struct rme96 *) pcm->private_data;
+	struct rme96 *rme96 = pcm->private_data;
 	rme96->adat_pcm = NULL;
 }
 
@@ -1661,7 +1661,7 @@ static void
 snd_rme96_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
 {
 	int n;
-	struct rme96 *rme96 = (struct rme96 *)entry->private_data;
+	struct rme96 *rme96 = entry->private_data;
 	
 	rme96->rcreg = readl(rme96->iobase + RME96_IO_CONTROL_REGISTER);
 
@@ -2348,7 +2348,7 @@ snd_rme96_probe(struct pci_dev *pci,
 	if (err < 0)
 		return err;
 	card->private_free = snd_rme96_card_free;
-	rme96 = (struct rme96 *)card->private_data;	
+	rme96 = card->private_data;
 	rme96->card = card;
 	rme96->pci = pci;
 	snd_card_set_dev(card, &pci->dev);
sound/pci/rme9652/hdsp.c +4 -4
index b92adef..599e090 100644
@@ -3284,7 +3284,7 @@ static int snd_hdsp_create_controls(struct snd_card *card, struct hdsp *hdsp)
 static void
 snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
 {
-	struct hdsp *hdsp = (struct hdsp *) entry->private_data;
+	struct hdsp *hdsp = entry->private_data;
 	unsigned int status;
 	unsigned int status2;
 	char *pref_sync_ref;
@@ -4566,7 +4566,7 @@ static int hdsp_get_peak(struct hdsp *hdsp, struct hdsp_peak_rms __user *peak_rm
 
 static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigned int cmd, unsigned long arg)
 {
-	struct hdsp *hdsp = (struct hdsp *)hw->private_data;
+	struct hdsp *hdsp = hw->private_data;
 	void __user *argp = (void __user *)arg;
 	int err;
 
@@ -5155,7 +5155,7 @@ static int snd_hdsp_free(struct hdsp *hdsp)
 
 static void snd_hdsp_card_free(struct snd_card *card)
 {
-	struct hdsp *hdsp = (struct hdsp *) card->private_data;
+	struct hdsp *hdsp = card->private_data;
 
 	if (hdsp)
 		snd_hdsp_free(hdsp);
@@ -5181,7 +5181,7 @@ static int __devinit snd_hdsp_probe(struct pci_dev *pci,
 	if (err < 0)
 		return err;
 
-	hdsp = (struct hdsp *) card->private_data;
+	hdsp = card->private_data;
 	card->private_free = snd_hdsp_card_free;
 	hdsp->dev = dev;
 	hdsp->pci = pci;
Signature · 1 line
1.7.2.19.g9a302
#31 lore raw

Re: [PATCH 13/13] sound: Remove unnecessary casts of private_data

At Sat, 4 Sep 2010 18:52:54 -0700,

Quoted 2 lines · Joe Perches

Applied now. Thanks.

Takashi

Quoted 445 lines
---
 sound/core/oss/mixer_oss.c     |   22 +++++++++++-----------
 sound/core/pcm.c               |    3 +--
 sound/drivers/virmidi.c        |    2 +-
 sound/i2c/other/ak4xxx-adda.c  |    2 +-
 sound/isa/ad1816a/ad1816a.c    |    2 +-
 sound/isa/azt2320.c            |    2 +-
 sound/isa/gus/gusmax.c         |    4 ++--
 sound/isa/sb/sb8.c             |    2 +-
 sound/oss/au1550_ac97.c        |   18 +++++++++---------
 sound/pci/emu10k1/emumpu401.c  |    2 +-
 sound/pci/ice1712/pontis.c     |    6 +++---
 sound/pci/ice1712/prodigy192.c |    2 +-
 sound/pci/rme96.c              |    8 ++++----
 sound/pci/rme9652/hdsp.c       |    8 ++++----
 14 files changed, 41 insertions(+), 42 deletions(-)
sound/core/oss/mixer_oss.c +11 -11
index f50ebf2..86afb13 100644
@@ -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);
sound/core/pcm.c +1 -2
index 204af48..88525a9 100644
@@ -364,8 +364,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,
sound/drivers/virmidi.c +1 -1
index 0e631c3..f4cd493 100644
@@ -94,7 +94,7 @@ static int __devinit snd_virmidi_probe(struct platform_device *devptr)
 			      sizeof(struct snd_card_virmidi), &card);
 	if (err < 0)
 		return err;
-	vmidi = (struct snd_card_virmidi *)card->private_data;
+	vmidi = card->private_data;
 	vmidi->card = card;
 
 	if (midi_devs[dev] > MAX_MIDI_DEVICES) {
sound/i2c/other/ak4xxx-adda.c +1 -1
index 1adb8a3..ebab6c7 100644
@@ -878,7 +878,7 @@ static int build_deemphasis(struct snd_akm4xxx *ak, int num_emphs)
 static void proc_regs_read(struct snd_info_entry *entry,
 		struct snd_info_buffer *buffer)
 {
-	struct snd_akm4xxx *ak = (struct snd_akm4xxx *)entry->private_data;
+	struct snd_akm4xxx *ak = entry->private_data;
 	int reg, val, chip;
 	for (chip = 0; chip < ak->num_chips; chip++) {
 		for (reg = 0; reg < ak->total_regs; reg++) {
sound/isa/ad1816a/ad1816a.c +1 -1
index bbcbf92..3cb75bc 100644
@@ -162,7 +162,7 @@ static int __devinit snd_card_ad1816a_probe(int dev, struct pnp_card_link *pcard
 				sizeof(struct snd_card_ad1816a), &card);
 	if (error < 0)
 		return error;
-	acard = (struct snd_card_ad1816a *)card->private_data;
+	acard = card->private_data;
 
 	if ((error = snd_card_ad1816a_pnp(dev, acard, pcard, pid))) {
 		snd_card_free(card);
sound/isa/azt2320.c +1 -1
index f7aa637..aac8dc1 100644
@@ -188,7 +188,7 @@ static int __devinit snd_card_azt2320_probe(int dev,
 				sizeof(struct snd_card_azt2320), &card);
 	if (error < 0)
 		return error;
-	acard = (struct snd_card_azt2320 *)card->private_data;
+	acard = card->private_data;
 
 	if ((error = snd_card_azt2320_pnp(dev, acard, pcard, pid))) {
 		snd_card_free(card);
sound/isa/gus/gusmax.c +2 -2
index f26eac8..3e4a58b 100644
@@ -191,7 +191,7 @@ static int __devinit snd_gusmax_mixer(struct snd_wss *chip)
 
 static void snd_gusmax_free(struct snd_card *card)
 {
-	struct snd_gusmax *maxcard = (struct snd_gusmax *)card->private_data;
+	struct snd_gusmax *maxcard = card->private_data;
 
 	if (maxcard == NULL)
 		return;
@@ -219,7 +219,7 @@ static int __devinit snd_gusmax_probe(struct device *pdev, unsigned int dev)
 	if (err < 0)
 		return err;
 	card->private_free = snd_gusmax_free;
-	maxcard = (struct snd_gusmax *)card->private_data;
+	maxcard = card->private_data;
 	maxcard->card = card;
 	maxcard->irq = -1;
 
sound/isa/sb/sb8.c +1 -1
index 81284a8..2259e3f 100644
@@ -72,7 +72,7 @@ static irqreturn_t snd_sb8_interrupt(int irq, void *dev_id)
 
 static void snd_sb8_free(struct snd_card *card)
 {
-	struct snd_sb8 *acard = (struct snd_sb8 *)card->private_data;
+	struct snd_sb8 *acard = card->private_data;
 
 	if (acard == NULL)
 		return;
sound/oss/au1550_ac97.c +9 -9
index c6f2621..8a12621 100644
@@ -171,7 +171,7 @@ au1550_delay(int msec)
 static u16
 rdcodec(struct ac97_codec *codec, u8 addr)
 {
-	struct au1550_state *s = (struct au1550_state *)codec->private_data;
+	struct au1550_state *s = codec->private_data;
 	unsigned long   flags;
 	u32             cmd, val;
 	u16             data;
@@ -239,7 +239,7 @@ rdcodec(struct ac97_codec *codec, u8 addr)
 static void
 wrcodec(struct ac97_codec *codec, u8 addr, u16 data)
 {
-	struct au1550_state *s = (struct au1550_state *)codec->private_data;
+	struct au1550_state *s = codec->private_data;
 	unsigned long   flags;
 	u32             cmd, val;
 	int             i;
@@ -820,7 +820,7 @@ mixdev_ioctl(struct ac97_codec *codec, unsigned int cmd,
 static long
 au1550_ioctl_mixdev(struct file *file, unsigned int cmd, unsigned long arg)
 {
-	struct au1550_state *s = (struct au1550_state *)file->private_data;
+	struct au1550_state *s = file->private_data;
 	struct ac97_codec *codec = s->codec;
 	int ret;
 
@@ -1031,7 +1031,7 @@ copy_dmabuf_user(struct dmabuf *db, char* userbuf, int count, int to_user)
 static ssize_t
 au1550_read(struct file *file, char *buffer, size_t count, loff_t *ppos)
 {
-	struct au1550_state *s = (struct au1550_state *)file->private_data;
+	struct au1550_state *s = file->private_data;
 	struct dmabuf  *db = &s->dma_adc;
 	DECLARE_WAITQUEUE(wait, current);
 	ssize_t         ret;
@@ -1111,7 +1111,7 @@ out2:
 static ssize_t
 au1550_write(struct file *file, const char *buffer, size_t count, loff_t * ppos)
 {
-	struct au1550_state *s = (struct au1550_state *)file->private_data;
+	struct au1550_state *s = file->private_data;
 	struct dmabuf  *db = &s->dma_dac;
 	DECLARE_WAITQUEUE(wait, current);
 	ssize_t         ret = 0;
@@ -1211,7 +1211,7 @@ out2:
 static unsigned int
 au1550_poll(struct file *file, struct poll_table_struct *wait)
 {
-	struct au1550_state *s = (struct au1550_state *)file->private_data;
+	struct au1550_state *s = file->private_data;
 	unsigned long   flags;
 	unsigned int    mask = 0;
 
@@ -1250,7 +1250,7 @@ au1550_poll(struct file *file, struct poll_table_struct *wait)
 static int
 au1550_mmap(struct file *file, struct vm_area_struct *vma)
 {
-	struct au1550_state *s = (struct au1550_state *)file->private_data;
+	struct au1550_state *s = file->private_data;
 	struct dmabuf  *db;
 	unsigned long   size;
 	int ret = 0;
@@ -1342,7 +1342,7 @@ dma_count_done(struct dmabuf *db)
 static int
 au1550_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
-	struct au1550_state *s = (struct au1550_state *)file->private_data;
+	struct au1550_state *s = file->private_data;
 	unsigned long   flags;
 	audio_buf_info  abinfo;
 	count_info      cinfo;
@@ -1868,7 +1868,7 @@ out2:
 static int
 au1550_release(struct inode *inode, struct file *file)
 {
-	struct au1550_state *s = (struct au1550_state *)file->private_data;
+	struct au1550_state *s = file->private_data;
 
 	lock_kernel();
 
sound/pci/emu10k1/emumpu401.c +1 -1
index 8578c70..bab5648 100644
@@ -321,7 +321,7 @@ static struct snd_rawmidi_ops snd_emu10k1_midi_input =
 
 static void snd_emu10k1_midi_free(struct snd_rawmidi *rmidi)
 {
-	struct snd_emu10k1_midi *midi = (struct snd_emu10k1_midi *)rmidi->private_data;
+	struct snd_emu10k1_midi *midi = rmidi->private_data;
 	midi->interrupt = NULL;
 	midi->rmidi = NULL;
 }
sound/pci/ice1712/pontis.c +3 -3
index 6bc3f91..cdb873f 100644
@@ -638,7 +638,7 @@ static struct snd_kcontrol_new pontis_controls[] __devinitdata = {
  */
 static void wm_proc_regs_write(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
 {
-	struct snd_ice1712 *ice = (struct snd_ice1712 *)entry->private_data;
+	struct snd_ice1712 *ice = entry->private_data;
 	char line[64];
 	unsigned int reg, val;
 	mutex_lock(&ice->gpio_mutex);
@@ -653,7 +653,7 @@ static void wm_proc_regs_write(struct snd_info_entry *entry, struct snd_info_buf
 
 static void wm_proc_regs_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
 {
-	struct snd_ice1712 *ice = (struct snd_ice1712 *)entry->private_data;
+	struct snd_ice1712 *ice = entry->private_data;
 	int reg, val;
 
 	mutex_lock(&ice->gpio_mutex);
@@ -676,7 +676,7 @@ static void wm_proc_init(struct snd_ice1712 *ice)
 
 static void cs_proc_regs_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
 {
-	struct snd_ice1712 *ice = (struct snd_ice1712 *)entry->private_data;
+	struct snd_ice1712 *ice = entry->private_data;
 	int reg, val;
 
 	mutex_lock(&ice->gpio_mutex);
sound/pci/ice1712/prodigy192.c +1 -1
index 2a8e5cd..e36ddb9 100644
@@ -654,7 +654,7 @@ static int prodigy192_ak4114_init(struct snd_ice1712 *ice)
 static void stac9460_proc_regs_read(struct snd_info_entry *entry,
 		struct snd_info_buffer *buffer)
 {
-	struct snd_ice1712 *ice = (struct snd_ice1712 *)entry->private_data;
+	struct snd_ice1712 *ice = entry->private_data;
 	int reg, val;
 	/* registers 0x0 - 0x14 */
 	for (reg = 0; reg <= 0x15; reg++) {
sound/pci/rme96.c +4 -4
index d19dc05..d5f5b44 100644
@@ -1527,14 +1527,14 @@ snd_rme96_free(void *private_data)
 static void
 snd_rme96_free_spdif_pcm(struct snd_pcm *pcm)
 {
-	struct rme96 *rme96 = (struct rme96 *) pcm->private_data;
+	struct rme96 *rme96 = pcm->private_data;
 	rme96->spdif_pcm = NULL;
 }
 
 static void
 snd_rme96_free_adat_pcm(struct snd_pcm *pcm)
 {
-	struct rme96 *rme96 = (struct rme96 *) pcm->private_data;
+	struct rme96 *rme96 = pcm->private_data;
 	rme96->adat_pcm = NULL;
 }
 
@@ -1661,7 +1661,7 @@ static void
 snd_rme96_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
 {
 	int n;
-	struct rme96 *rme96 = (struct rme96 *)entry->private_data;
+	struct rme96 *rme96 = entry->private_data;
 
 	rme96->rcreg = readl(rme96->iobase + RME96_IO_CONTROL_REGISTER);
 
@@ -2348,7 +2348,7 @@ snd_rme96_probe(struct pci_dev *pci,
 	if (err < 0)
 		return err;
 	card->private_free = snd_rme96_card_free;
-	rme96 = (struct rme96 *)card->private_data;	
+	rme96 = card->private_data;
 	rme96->card = card;
 	rme96->pci = pci;
 	snd_card_set_dev(card, &pci->dev);
sound/pci/rme9652/hdsp.c +4 -4
index b92adef..599e090 100644
@@ -3284,7 +3284,7 @@ static int snd_hdsp_create_controls(struct snd_card *card, struct hdsp *hdsp)
 static void
 snd_hdsp_proc_read(struct snd_info_entry *entry, struct snd_info_buffer *buffer)
 {
-	struct hdsp *hdsp = (struct hdsp *) entry->private_data;
+	struct hdsp *hdsp = entry->private_data;
 	unsigned int status;
 	unsigned int status2;
 	char *pref_sync_ref;
@@ -4566,7 +4566,7 @@ static int hdsp_get_peak(struct hdsp *hdsp, struct hdsp_peak_rms __user *peak_rm
 
 static int snd_hdsp_hwdep_ioctl(struct snd_hwdep *hw, struct file *file, unsigned int cmd, unsigned long arg)
 {
-	struct hdsp *hdsp = (struct hdsp *)hw->private_data;
+	struct hdsp *hdsp = hw->private_data;
 	void __user *argp = (void __user *)arg;
 	int err;
 
@@ -5155,7 +5155,7 @@ static int snd_hdsp_free(struct hdsp *hdsp)
 
 static void snd_hdsp_card_free(struct snd_card *card)
 {
-	struct hdsp *hdsp = (struct hdsp *) card->private_data;
+	struct hdsp *hdsp = card->private_data;
 
 	if (hdsp)
 		snd_hdsp_free(hdsp);
@@ -5181,7 +5181,7 @@ static int __devinit snd_hdsp_probe(struct pci_dev *pci,
 	if (err < 0)
 		return err;
 
-	hdsp = (struct hdsp *) card->private_data;
+	hdsp = card->private_data;
 	card->private_free = snd_hdsp_card_free;
 	hdsp->dev = dev;
 	hdsp->pci = pci;
Signature · 1 line
1.7.2.19.g9a302