diff mbox

[OPW,kernel,07/16] staging: media: lirc: Remove useless cast on void pointer

Message ID 20141030113247.GH15682@kt-Inspiron-3542
State New, archived
Headers show

Commit Message

Tapasweni Pathak Oct. 30, 2014, 11:32 a.m. UTC
void pointers do not need to be cast to other pointer types.

The semantic patch used to find this:

@r@
expression x;
void* e;
type T;
identifier f;
@@

(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)

Build tested it.

Signed-off-by: Tapasweni Pathak <tapaswenipathak@gmail.com>
---
 drivers/staging/media/lirc/lirc_igorplugusb.c |    2 +-
 drivers/staging/media/lirc/lirc_imon.c        |    4 ++--
 drivers/staging/media/lirc/lirc_sasem.c       |    4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

--
1.7.9.5
diff mbox

Patch

diff --git a/drivers/staging/media/lirc/lirc_igorplugusb.c b/drivers/staging/media/lirc/lirc_igorplugusb.c
index 431d1e8..fd5d3d2 100644
--- a/drivers/staging/media/lirc/lirc_igorplugusb.c
+++ b/drivers/staging/media/lirc/lirc_igorplugusb.c
@@ -282,7 +282,7 @@  static void send_fragment(struct igorplug *ir, struct lirc_buffer *buf,
 static int igorplugusb_remote_poll(void *data, struct lirc_buffer *buf)
 {
 	int ret;
-	struct igorplug *ir = (struct igorplug *)data;
+	struct igorplug *ir = data;

 	if (!ir || !ir->usbdev)  /* Has the device been removed? */
 		return -ENODEV;
diff --git a/drivers/staging/media/lirc/lirc_imon.c b/drivers/staging/media/lirc/lirc_imon.c
index e4cfbe3..387dc4b 100644
--- a/drivers/staging/media/lirc/lirc_imon.c
+++ b/drivers/staging/media/lirc/lirc_imon.c
@@ -495,7 +495,7 @@  static int ir_open(void *data)
 	/* prevent races with disconnect */
 	mutex_lock(&driver_lock);

-	context = (struct imon_context *)data;
+	context = data;

 	/* initial IR protocol decode variables */
 	context->rx.count = 0;
@@ -516,7 +516,7 @@  static void ir_close(void *data)
 {
 	struct imon_context *context;

-	context = (struct imon_context *)data;
+	context = data;
 	if (!context) {
 		pr_err("%s: no context for device\n", __func__);
 		return;
diff --git a/drivers/staging/media/lirc/lirc_sasem.c b/drivers/staging/media/lirc/lirc_sasem.c
index e345efb..3836c42 100644
--- a/drivers/staging/media/lirc/lirc_sasem.c
+++ b/drivers/staging/media/lirc/lirc_sasem.c
@@ -489,7 +489,7 @@  static int ir_open(void *data)
 	/* prevent races with disconnect */
 	mutex_lock(&disconnect_lock);

-	context = (struct sasem_context *) data;
+	context = data;

 	mutex_lock(&context->ctx_lock);

@@ -531,7 +531,7 @@  static void ir_close(void *data)
 {
 	struct sasem_context *context;

-	context = (struct sasem_context *)data;
+	context = data;
 	if (!context) {
 		pr_err("%s: no context for device\n", __func__);
 		return;