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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
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;
/* prevent races with disconnect */
mutex_lock(&driver_lock);
- context = (struct imon_context *)data;
+ context = data;
/* initial IR protocol decode variables */
context->rx.count = 0;
{
struct imon_context *context;
- context = (struct imon_context *)data;
+ context = data;
if (!context) {
pr_err("%s: no context for device\n", __func__);
return;
/* prevent races with disconnect */
mutex_lock(&disconnect_lock);
- context = (struct sasem_context *) data;
+ context = data;
mutex_lock(&context->ctx_lock);
{
struct sasem_context *context;
- context = (struct sasem_context *)data;
+ context = data;
if (!context) {
pr_err("%s: no context for device\n", __func__);
return;