The semantic patch used to find this is:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
  *((T *)e)
|
  ((T *)x)[...]
|
  ((T *)x)->f
|
- (T *)
  e
)
Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 
 static int ll_agl_thread(void *arg)
 {
-       struct dentry       *parent = (struct dentry *)arg;
+       struct dentry       *parent = arg;
        struct inode         *dir    = d_inode(parent);
        struct ll_inode_info     *plli   = ll_i2info(dir);
        struct ll_inode_info     *clli;
 
 static int ll_statahead_thread(void *arg)
 {
-       struct dentry       *parent = (struct dentry *)arg;
+       struct dentry       *parent = arg;
        struct inode         *dir    = d_inode(parent);
        struct ll_inode_info     *plli   = ll_i2info(dir);
        struct ll_inode_info     *clli;