Guest User

2casts-664.patch

a guest
Apr 13th, 2015
82
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. diff -u -p a/net/tipc/bcast.c b/net/tipc/bcast.c
  2. --- a/net/tipc/bcast.c
  3. +++ b/net/tipc/bcast.c
  4. @@ -105,7 +105,7 @@ static u32 bcbuf_acks(struct sk_buff *bu
  5.  
  6.  static void bcbuf_set_acks(struct sk_buff *buf, u32 acks)
  7.  {
  8. -   TIPC_SKB_CB(buf)->handle = (void *)(unsigned long)acks;
  9. +   TIPC_SKB_CB(buf)->handle = acks;
  10.  }
  11.  
  12.  static void bcbuf_decr_acks(struct sk_buff *buf)
  13. diff -u -p a/net/netfilter/nf_log.c b/net/netfilter/nf_log.c
  14. --- a/net/netfilter/nf_log.c
  15. +++ b/net/netfilter/nf_log.c
  16. @@ -454,7 +454,7 @@ static int netfilter_log_sysctl_init(str
  17.             nf_log_sysctl_table[i].proc_handler =
  18.                 nf_log_proc_dostring;
  19.             nf_log_sysctl_table[i].extra1 =
  20. -               (void *)(unsigned long) i;
  21. +               i;
  22.         }
  23.     }
  24.  
  25. diff -u -p a/fs/dlm/user.c b/fs/dlm/user.c
  26. --- a/fs/dlm/user.c
  27. +++ b/fs/dlm/user.c
  28. @@ -110,11 +110,11 @@ static void compat_input(struct dlm_writ
  29.         kb->i.lock.parent = kb32->i.lock.parent;
  30.         kb->i.lock.xid = kb32->i.lock.xid;
  31.         kb->i.lock.timeout = kb32->i.lock.timeout;
  32. -       kb->i.lock.castparam = (void *)(long)kb32->i.lock.castparam;
  33. -       kb->i.lock.castaddr = (void *)(long)kb32->i.lock.castaddr;
  34. -       kb->i.lock.bastparam = (void *)(long)kb32->i.lock.bastparam;
  35. -       kb->i.lock.bastaddr = (void *)(long)kb32->i.lock.bastaddr;
  36. -       kb->i.lock.lksb = (void *)(long)kb32->i.lock.lksb;
  37. +       kb->i.lock.castparam = kb32->i.lock.castparam;
  38. +       kb->i.lock.castaddr = kb32->i.lock.castaddr;
  39. +       kb->i.lock.bastparam = kb32->i.lock.bastparam;
  40. +       kb->i.lock.bastaddr = kb32->i.lock.bastaddr;
  41. +       kb->i.lock.lksb = kb32->i.lock.lksb;
  42.         memcpy(kb->i.lock.lvb, kb32->i.lock.lvb, DLM_USER_LVB_LEN);
  43.         memcpy(kb->i.lock.name, kb32->i.lock.name, namelen);
  44.     }
  45. @@ -127,9 +127,9 @@ static void compat_output(struct dlm_loc
  46.     res32->version[1] = res->version[1];
  47.     res32->version[2] = res->version[2];
  48.  
  49. -   res32->user_astaddr = (__u32)(long)res->user_astaddr;
  50. -   res32->user_astparam = (__u32)(long)res->user_astparam;
  51. -   res32->user_lksb = (__u32)(long)res->user_lksb;
  52. +   res32->user_astaddr = res->user_astaddr;
  53. +   res32->user_astparam = res->user_astparam;
  54. +   res32->user_lksb = res->user_lksb;
  55.     res32->bast_mode = res->bast_mode;
  56.  
  57.     res32->lvb_offset = res->lvb_offset;
  58. @@ -138,7 +138,7 @@ static void compat_output(struct dlm_loc
  59.     res32->lksb.sb_status = res->lksb.sb_status;
  60.     res32->lksb.sb_flags = res->lksb.sb_flags;
  61.     res32->lksb.sb_lkid = res->lksb.sb_lkid;
  62. -   res32->lksb.sb_lvbptr = (__u32)(long)res->lksb.sb_lvbptr;
  63. +   res32->lksb.sb_lvbptr = res->lksb.sb_lvbptr;
  64.  }
  65.  #endif
  66.  
  67. diff -u -p a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c
  68. --- a/fs/cifs/cifssmb.c
  69. +++ b/fs/cifs/cifssmb.c
  70. @@ -618,7 +618,7 @@ CIFSSMBNegotiate(const unsigned int xid,
  71.     server->max_rw = le32_to_cpu(pSMBr->MaxRawSize);
  72.     cifs_dbg(NOISY, "Max buf = %d\n", ses->server->maxBuf);
  73.     server->capabilities = le32_to_cpu(pSMBr->Capabilities);
  74. -   server->timeAdj = (int)(__s16)le16_to_cpu(pSMBr->ServerTimeZone);
  75. +   server->timeAdj = le16_to_cpu(pSMBr->ServerTimeZone);
  76.     server->timeAdj *= 60;
  77.  
  78.     if (pSMBr->EncryptionKeyLength == CIFS_CRYPTO_KEY_SIZE) {
  79. diff -u -p a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
  80. --- a/fs/btrfs/extent_io.c
  81. +++ b/fs/btrfs/extent_io.c
  82. @@ -2131,7 +2131,7 @@ int clean_io_failure(struct inode *inode
  83.     if (ret)
  84.         return 0;
  85.  
  86. -   failrec = (struct io_failure_record *)(unsigned long) private_failure;
  87. +   failrec = private_failure;
  88.     BUG_ON(!failrec->this_mirror);
  89.  
  90.     if (failrec->in_validation) {
  91. @@ -2191,7 +2191,7 @@ void btrfs_free_io_failure_record(struct
  92.  
  93.         next = next_state(state);
  94.  
  95. -       failrec = (struct io_failure_record *)(unsigned long)state->private;
  96. +       failrec = state->private;
  97.         free_extent_state(state);
  98.         kfree(failrec);
  99.  
  100. @@ -2272,7 +2272,7 @@ int btrfs_get_io_failure_record(struct i
  101.             return ret;
  102.         }
  103.     } else {
  104. -       failrec = (struct io_failure_record *)(unsigned long)private;
  105. +       failrec = private;
  106.         pr_debug("Get IO Failure Record: (found) logical=%llu, start=%llu, len=%llu, validation=%d\n",
  107.              failrec->logical, failrec->start, failrec->len,
  108.              failrec->in_validation);
  109. diff -u -p a/fs/fuse/dir.c b/fs/fuse/dir.c
  110. --- a/fs/fuse/dir.c
  111. +++ b/fs/fuse/dir.c
  112. @@ -54,7 +54,7 @@ static inline u64 fuse_dentry_time(struc
  113.  static void fuse_dentry_settime(struct dentry *entry, u64 time)
  114.  {
  115.     entry->d_time = time;
  116. -   entry->d_fsdata = (void *) (unsigned long) (time >> 32);
  117. +   entry->d_fsdata = (time >> 32);
  118.  }
  119.  
  120.  static u64 fuse_dentry_time(struct dentry *entry)
  121. diff -u -p a/fs/ubifs/find.c b/fs/ubifs/find.c
  122. --- a/fs/ubifs/find.c
  123. +++ b/fs/ubifs/find.c
  124. @@ -785,7 +785,7 @@ int ubifs_save_dirty_idx_lnums(struct ub
  125.              c->dirty_idx.arr[c->dirty_idx.cnt - 1]->free);
  126.     /* Replace the lprops pointers with LEB numbers */
  127.     for (i = 0; i < c->dirty_idx.cnt; i++)
  128. -       c->dirty_idx.arr[i] = (void *)(size_t)c->dirty_idx.arr[i]->lnum;
  129. +       c->dirty_idx.arr[i] = c->dirty_idx.arr[i]->lnum;
  130.     ubifs_release_lprops(c);
  131.     return 0;
  132.  }
  133. diff -u -p a/fs/aio.c b/fs/aio.c
  134. --- a/fs/aio.c
  135. +++ b/fs/aio.c
  136. @@ -1065,7 +1065,7 @@ void aio_complete(struct kiocb *iocb, lo
  137.     ev_page = kmap_atomic(ctx->ring_pages[pos / AIO_EVENTS_PER_PAGE]);
  138.     event = ev_page + pos % AIO_EVENTS_PER_PAGE;
  139.  
  140. -   event->obj = (u64)(unsigned long)iocb->ki_obj.user;
  141. +   event->obj = iocb->ki_obj.user;
  142.     event->data = iocb->ki_user_data;
  143.     event->res = res;
  144.     event->res2 = res2;
  145. diff -u -p a/virt/kvm/arm/vgic-v2-emul.c b/virt/kvm/arm/vgic-v2-emul.c
  146. --- a/virt/kvm/arm/vgic-v2-emul.c
  147. +++ b/virt/kvm/arm/vgic-v2-emul.c
  148. @@ -767,7 +767,7 @@ static int vgic_v2_set_attr(struct kvm_d
  149.     switch (attr->group) {
  150.     case KVM_DEV_ARM_VGIC_GRP_DIST_REGS:
  151.     case KVM_DEV_ARM_VGIC_GRP_CPU_REGS: {
  152. -       u32 __user *uaddr = (u32 __user *)(long)attr->addr;
  153. +       u32 __user *uaddr = attr->addr;
  154.         u32 reg;
  155.  
  156.         if (get_user(reg, uaddr))
  157. @@ -793,7 +793,7 @@ static int vgic_v2_get_attr(struct kvm_d
  158.     switch (attr->group) {
  159.     case KVM_DEV_ARM_VGIC_GRP_DIST_REGS:
  160.     case KVM_DEV_ARM_VGIC_GRP_CPU_REGS: {
  161. -       u32 __user *uaddr = (u32 __user *)(long)attr->addr;
  162. +       u32 __user *uaddr = attr->addr;
  163.         u32 reg = 0;
  164.  
  165.         ret = vgic_attr_regs_access(dev, attr, &reg, false);
  166. diff -u -p a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
  167. --- a/scripts/kconfig/mconf.c
  168. +++ b/scripts/kconfig/mconf.c
  169. @@ -687,7 +687,7 @@ static void conf(struct menu *menu, stru
  170.             switch (item_tag()) {
  171.             case 'm':
  172.                 if (single_menu_mode)
  173. -                   submenu->data = (void *) (long) !submenu->data;
  174. +                   submenu->data = !submenu->data;
  175.                 else
  176.                     conf(submenu, NULL);
  177.                 break;
  178. diff -u -p a/kernel/jump_label.c b/kernel/jump_label.c
  179. --- a/kernel/jump_label.c
  180. +++ b/kernel/jump_label.c
  181. @@ -202,7 +202,7 @@ void __init jump_label_init(void)
  182.     for (iter = iter_start; iter < iter_stop; iter++) {
  183.         struct static_key *iterk;
  184.  
  185. -       iterk = (struct static_key *)(unsigned long)iter->key;
  186. +       iterk = iter->key;
  187.         arch_jump_label_transform_static(iter, jump_label_type(iterk));
  188.         if (iterk == key)
  189.             continue;
  190. @@ -297,7 +297,7 @@ static int jump_label_add_module(struct
  191.     for (iter = iter_start; iter < iter_stop; iter++) {
  192.         struct static_key *iterk;
  193.  
  194. -       iterk = (struct static_key *)(unsigned long)iter->key;
  195. +       iterk = iter->key;
  196.         if (iterk == key)
  197.             continue;
  198.  
  199. @@ -337,7 +337,7 @@ static void jump_label_del_module(struct
  200.         if (iter->key == (jump_label_t)(unsigned long)key)
  201.             continue;
  202.  
  203. -       key = (struct static_key *)(unsigned long)iter->key;
  204. +       key = iter->key;
  205.  
  206.         if (__module_address(iter->key) == mod)
  207.             continue;
  208. diff -u -p a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
  209. --- a/kernel/bpf/helpers.c
  210. +++ b/kernel/bpf/helpers.c
  211. @@ -27,8 +27,8 @@ static u64 bpf_map_lookup_elem(u64 r1, u
  212.      * and R2 points to a program stack and map->key_size bytes were
  213.      * initialized
  214.      */
  215. -   struct bpf_map *map = (struct bpf_map *) (unsigned long) r1;
  216. -   void *key = (void *) (unsigned long) r2;
  217. +   struct bpf_map *map = r1;
  218. +   void *key = r2;
  219.     void *value;
  220.  
  221.     WARN_ON_ONCE(!rcu_read_lock_held());
  222. @@ -51,9 +51,9 @@ struct bpf_func_proto bpf_map_lookup_ele
  223.  
  224.  static u64 bpf_map_update_elem(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5)
  225.  {
  226. -   struct bpf_map *map = (struct bpf_map *) (unsigned long) r1;
  227. -   void *key = (void *) (unsigned long) r2;
  228. -   void *value = (void *) (unsigned long) r3;
  229. +   struct bpf_map *map = r1;
  230. +   void *key = r2;
  231. +   void *value = r3;
  232.  
  233.     WARN_ON_ONCE(!rcu_read_lock_held());
  234.  
  235. @@ -72,8 +72,8 @@ struct bpf_func_proto bpf_map_update_ele
  236.  
  237.  static u64 bpf_map_delete_elem(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5)
  238.  {
  239. -   struct bpf_map *map = (struct bpf_map *) (unsigned long) r1;
  240. -   void *key = (void *) (unsigned long) r2;
  241. +   struct bpf_map *map = r1;
  242. +   void *key = r2;
  243.  
  244.     WARN_ON_ONCE(!rcu_read_lock_held());
  245.  
  246. diff -u -p a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
  247. --- a/drivers/net/hyperv/netvsc_drv.c
  248. +++ b/drivers/net/hyperv/netvsc_drv.c
  249. @@ -232,8 +232,7 @@ static u16 netvsc_select_queue(struct ne
  250.  static void netvsc_xmit_completion(void *context)
  251.  {
  252.     struct hv_netvsc_packet *packet = (struct hv_netvsc_packet *)context;
  253. -   struct sk_buff *skb = (struct sk_buff *)
  254. -       (unsigned long)packet->send_completion_tid;
  255. +   struct sk_buff *skb =packet->send_completion_tid;
  256.     u32 index = packet->send_buf_index;
  257.  
  258.     kfree(packet);
  259. diff -u -p a/drivers/net/ethernet/neterion/vxge/vxge-config.c b/drivers/net/ethernet/neterion/vxge/vxge-config.c
  260. --- a/drivers/net/ethernet/neterion/vxge/vxge-config.c
  261. +++ b/drivers/net/ethernet/neterion/vxge/vxge-config.c
  262. @@ -2125,7 +2125,7 @@ __vxge_hw_ring_mempool_item_alloc(struct
  263.         uld_priv = ((u8 *)rxdblock_priv + ring->rxd_priv_size * i);
  264.  
  265.         /* pre-format Host_Control */
  266. -       rxdp->host_control = (u64)(size_t)uld_priv;
  267. +       rxdp->host_control = uld_priv;
  268.     }
  269.  
  270.     __vxge_hw_ring_block_memblock_idx_set(item, memblock_index);
  271. @@ -3425,7 +3425,7 @@ __vxge_hw_fifo_mempool_item_alloc(
  272.  
  273.     vxge_assert(txdp);
  274.  
  275. -   txdp->host_control = (u64) (size_t)
  276. +   txdp->host_control =
  277.     __vxge_hw_mempool_item_priv(mempoolh, memblock_index, txdp,
  278.                     &memblock_item_idx);
  279.  
  280. diff -u -p a/drivers/net/ethernet/sun/sunhme.c b/drivers/net/ethernet/sun/sunhme.c
  281. --- a/drivers/net/ethernet/sun/sunhme.c
  282. +++ b/drivers/net/ethernet/sun/sunhme.c
  283. @@ -267,14 +267,14 @@ static u32 pci_hme_read_desc32(hme32 *p)
  284.  #define hme_read32(__hp, __reg) \
  285.     sbus_readl(__reg)
  286.  #define hme_write_rxd(__hp, __rxd, __flags, __addr) \
  287. -do {   (__rxd)->rx_addr = (__force hme32)(u32)(__addr); \
  288. +do {   (__rxd)->rx_addr = (__addr); \
  289.     wmb(); \
  290. -   (__rxd)->rx_flags = (__force hme32)(u32)(__flags); \
  291. +   (__rxd)->rx_flags = (__flags); \
  292.  } while(0)
  293.  #define hme_write_txd(__hp, __txd, __flags, __addr) \
  294. -do {   (__txd)->tx_addr = (__force hme32)(u32)(__addr); \
  295. +do {   (__txd)->tx_addr = (__addr); \
  296.     wmb(); \
  297. -   (__txd)->tx_flags = (__force hme32)(u32)(__flags); \
  298. +   (__txd)->tx_flags = (__flags); \
  299.  } while(0)
  300.  #define hme_read_desc32(__hp, __p) ((__force u32)(hme32)*(__p))
  301.  #define hme_dma_map(__hp, __ptr, __size, __dir) \
  302. diff -u -p a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
  303. --- a/drivers/net/wireless/mwl8k.c
  304. +++ b/drivers/net/wireless/mwl8k.c
  305. @@ -5213,7 +5213,7 @@ static void mwl8k_configure_filter(struc
  306.                    u64 multicast)
  307.  {
  308.     struct mwl8k_priv *priv = hw->priv;
  309. -   struct mwl8k_cmd_pkt *cmd = (void *)(unsigned long)multicast;
  310. +   struct mwl8k_cmd_pkt *cmd = multicast;
  311.  
  312.     /*
  313.      * AP firmware doesn't allow fine-grained control over
  314. diff -u -p a/drivers/macintosh/smu.c b/drivers/macintosh/smu.c
  315. --- a/drivers/macintosh/smu.c
  316. +++ b/drivers/macintosh/smu.c
  317. @@ -828,7 +828,7 @@ int smu_queue_i2c(struct smu_i2c_cmd *cm
  318.     cmd->scmd.misc = cmd;
  319.     cmd->scmd.reply_buf = cmd->pdata;
  320.     cmd->scmd.reply_len = sizeof(cmd->pdata);
  321. -   cmd->scmd.data_buf = (u8 *)(char *)&cmd->info;
  322. +   cmd->scmd.data_buf = &cmd->info;
  323.     cmd->scmd.status = 1;
  324.     cmd->stage = 0;
  325.     cmd->pdata[0] = 0xff;
  326. diff -u -p a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
  327. --- a/drivers/staging/slicoss/slicoss.c
  328. +++ b/drivers/staging/slicoss/slicoss.c
  329. @@ -965,7 +965,7 @@ static void slic_link_upr_complete(struc
  330.     if ((isr & ISR_UPCERR) || (isr & ISR_UPCBSY)) {
  331.         struct slic_shmem *pshmem;
  332.  
  333. -       pshmem = (struct slic_shmem *)(unsigned long)
  334. +       pshmem =
  335.              adapter->phys_shmem;
  336.  #if BITS_PER_LONG == 64
  337.         slic_upr_queue_request(adapter,
  338. @@ -1517,7 +1517,7 @@ retry_rcvqfill:
  339.  #endif
  340.         skb = alloc_skb(SLIC_RCVQ_RCVBUFSIZE, GFP_ATOMIC);
  341.         if (skb) {
  342. -           paddr = (void *)(unsigned long)
  343. +           paddr =
  344.                 pci_map_single(adapter->pcidev,
  345.                            skb->data,
  346.                            SLIC_RCVQ_RCVBUFSIZE,
  347. @@ -1676,7 +1676,7 @@ static u32 slic_rcvqueue_reinsert(struct
  348.     struct slic_rcvbuf *rcvbuf = (struct slic_rcvbuf *)skb->head;
  349.     struct device *dev;
  350.  
  351. -   paddr = (void *)(unsigned long)
  352. +   paddr =
  353.         pci_map_single(adapter->pcidev, skb->head,
  354.                    SLIC_RCVQ_RCVBUFSIZE, PCI_DMA_FROMDEVICE);
  355.     rcvbuf->status = 0;
  356. @@ -1736,7 +1736,7 @@ static void slic_link_event_handler(stru
  357.         return;
  358.     }
  359.  
  360. -   pshmem = (struct slic_shmem *)(unsigned long)adapter->phys_shmem;
  361. +   pshmem = adapter->phys_shmem;
  362.  
  363.  #if BITS_PER_LONG == 64
  364.     status = slic_upr_request(adapter,
  365. @@ -1763,7 +1763,7 @@ static void slic_init_cleanup(struct ada
  366.                     sizeof(struct slic_shmem),
  367.                     adapter->pshmem, adapter->phys_shmem);
  368.         adapter->pshmem = NULL;
  369. -       adapter->phys_shmem = (dma_addr_t)(unsigned long)NULL;
  370. +       adapter->phys_shmem = NULL;
  371.     }
  372.  
  373.     if (adapter->pingtimerset) {
  374. @@ -2339,7 +2339,7 @@ static int slic_if_init(struct adapter *
  375.     mdelay(1);
  376.  
  377.     if (!adapter->isp_initialized) {
  378. -       pshmem = (struct slic_shmem *)(unsigned long)
  379. +       pshmem =
  380.              adapter->phys_shmem;
  381.  
  382.         spin_lock_irqsave(&adapter->bit64reglock.lock,
  383. @@ -2731,7 +2731,7 @@ static int slic_card_init(struct sliccar
  384.  
  385.         slic_reg32_write(&slic_regs->slic_icr, ICR_INT_OFF, FLUSH);
  386.         mdelay(1);
  387. -       pshmem = (struct slic_shmem *)(unsigned long)
  388. +       pshmem =
  389.              adapter->phys_shmem;
  390.  
  391.         spin_lock_irqsave(&adapter->bit64reglock.lock,
  392. diff -u -p a/drivers/staging/lustre/lustre/obdclass/lustre_handles.c b/drivers/staging/lustre/lustre/obdclass/lustre_handles.c
  393. --- a/drivers/staging/lustre/lustre/obdclass/lustre_handles.c
  394. +++ b/drivers/staging/lustre/lustre/obdclass/lustre_handles.c
  395. @@ -181,7 +181,7 @@ EXPORT_SYMBOL(class_handle2object);
  396.  void class_handle_free_cb(struct rcu_head *rcu)
  397.  {
  398.     struct portals_handle *h = RCU2HANDLE(rcu);
  399. -   void *ptr = (void *)(unsigned long)h->h_cookie;
  400. +   void *ptr = h->h_cookie;
  401.  
  402.     if (h->h_ops->hop_free != NULL)
  403.         h->h_ops->hop_free(ptr, h->h_size);
  404. diff -u -p a/drivers/platform/goldfish/goldfish_pipe.c b/drivers/platform/goldfish/goldfish_pipe.c
  405. --- a/drivers/platform/goldfish/goldfish_pipe.c
  406. +++ b/drivers/platform/goldfish/goldfish_pipe.c
  407. @@ -294,7 +294,7 @@ static ssize_t goldfish_pipe_read_write(
  408.     if (mutex_lock_interruptible(&pipe->lock))
  409.         return -ERESTARTSYS;
  410.  
  411. -   address = (unsigned long)(void *)buffer;
  412. +   address = buffer;
  413.     address_end = address + bufflen;
  414.  
  415.     while (address < address_end) {
  416. @@ -470,7 +470,7 @@ static irqreturn_t goldfish_pipe_interru
  417.  
  418.         /* Convert channel to struct pipe pointer + read wake flags */
  419.         wakes = readl(dev->base + PIPE_REG_WAKES);
  420. -       pipe  = (struct goldfish_pipe *)(ptrdiff_t)channel;
  421. +       pipe  = channel;
  422.  
  423.         /* Did the emulator just closed a pipe? */
  424.         if (wakes & PIPE_WAKE_CLOSED) {
  425. diff -u -p a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
  426. --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
  427. +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c
  428. @@ -1094,7 +1094,6 @@ int vmw_fence_event_ioctl(struct drm_dev
  429.     struct vmw_fence_obj *fence = NULL;
  430.     struct vmw_fpriv *vmw_fp = vmw_fpriv(file_priv);
  431.     struct drm_vmw_fence_rep __user *user_fence_rep =
  432. -       (struct drm_vmw_fence_rep __user *)(unsigned long)
  433.         arg->fence_rep;
  434.     uint32_t handle;
  435.     int ret;
  436. diff -u -p a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c
  437. --- a/drivers/gpu/drm/drm_ioctl.c
  438. +++ b/drivers/gpu/drm/drm_ioctl.c
  439. @@ -196,7 +196,7 @@ static int drm_getmap(struct drm_device
  440.     map->size = r_list->map->size;
  441.     map->type = r_list->map->type;
  442.     map->flags = r_list->map->flags;
  443. -   map->handle = (void *)(unsigned long) r_list->user_token;
  444. +   map->handle = r_list->user_token;
  445.  
  446.  #ifdef CONFIG_X86
  447.     /*
  448. diff -u -p a/drivers/gpu/drm/armada/armada_gem.c b/drivers/gpu/drm/armada/armada_gem.c
  449. --- a/drivers/gpu/drm/armada/armada_gem.c
  450. +++ b/drivers/gpu/drm/armada/armada_gem.c
  451. @@ -380,7 +380,7 @@ int armada_gem_pwrite_ioctl(struct drm_d
  452.     if (args->size == 0)
  453.         return 0;
  454.  
  455. -   ptr = (char __user *)(uintptr_t)args->ptr;
  456. +   ptr = args->ptr;
  457.  
  458.     if (!access_ok(VERIFY_READ, ptr, args->size))
  459.         return -EFAULT;
  460. diff -u -p a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
  461. --- a/drivers/gpu/drm/i915/i915_sysfs.c
  462. +++ b/drivers/gpu/drm/i915/i915_sysfs.c
  463. @@ -178,7 +178,7 @@ i915_l3_read(struct file *filp, struct k
  464.     struct drm_minor *dminor = dev_to_drm_minor(dev);
  465.     struct drm_device *drm_dev = dminor->dev;
  466.     struct drm_i915_private *dev_priv = drm_dev->dev_private;
  467. -   int slice = (int)(uintptr_t)attr->private;
  468. +   int slice = attr->private;
  469.     int ret;
  470.  
  471.     count = round_down(count, 4);
  472. @@ -216,7 +216,7 @@ i915_l3_write(struct file *filp, struct
  473.     struct drm_i915_private *dev_priv = drm_dev->dev_private;
  474.     struct intel_context *ctx;
  475.     u32 *temp = NULL; /* Just here to make handling failures easy */
  476. -   int slice = (int)(uintptr_t)attr->private;
  477. +   int slice = attr->private;
  478.     int ret;
  479.  
  480.     if (!HAS_HW_CONTEXTS(drm_dev))
  481. diff -u -p a/drivers/gpu/drm/radeon/r600_cp.c b/drivers/gpu/drm/radeon/r600_cp.c
  482. --- a/drivers/gpu/drm/radeon/r600_cp.c
  483. +++ b/drivers/gpu/drm/radeon/r600_cp.c
  484. @@ -2105,11 +2105,11 @@ int r600_do_init_cp(struct drm_device *d
  485.     } else
  486.  #endif
  487.     {
  488. -       dev_priv->cp_ring->handle = (void *)(unsigned long)dev_priv->cp_ring->offset;
  489. +       dev_priv->cp_ring->handle = dev_priv->cp_ring->offset;
  490.         dev_priv->ring_rptr->handle =
  491. -           (void *)(unsigned long)dev_priv->ring_rptr->offset;
  492. +           dev_priv->ring_rptr->offset;
  493.         dev->agp_buffer_map->handle =
  494. -           (void *)(unsigned long)dev->agp_buffer_map->offset;
  495. +           dev->agp_buffer_map->offset;
  496.  
  497.         DRM_DEBUG("dev_priv->cp_ring->handle %p\n",
  498.               dev_priv->cp_ring->handle);
  499. diff -u -p a/drivers/gpu/drm/qxl/qxl_ioctl.c b/drivers/gpu/drm/qxl/qxl_ioctl.c
  500. --- a/drivers/gpu/drm/qxl/qxl_ioctl.c
  501. +++ b/drivers/gpu/drm/qxl/qxl_ioctl.c
  502. @@ -295,7 +295,7 @@ static int qxl_execbuffer_ioctl(struct d
  503.     for (cmd_num = 0; cmd_num < execbuffer->commands_num; ++cmd_num) {
  504.  
  505.         struct drm_qxl_command *commands =
  506. -           (struct drm_qxl_command *)(uintptr_t)execbuffer->commands;
  507. +           execbuffer->commands;
  508.  
  509.         if (copy_from_user(&user_cmd, &commands[cmd_num],
  510.                        sizeof(user_cmd)))
  511. diff -u -p a/drivers/s390/cio/device_pgid.c b/drivers/s390/cio/device_pgid.c
  512. --- a/drivers/s390/cio/device_pgid.c
  513. +++ b/drivers/s390/cio/device_pgid.c
  514. @@ -138,7 +138,7 @@ static void spid_build_cp(struct ccw_dev
  515.  
  516.     pgid->inf.fc    = fn;
  517.     cp->cmd_code    = CCW_CMD_SET_PGID;
  518. -   cp->cda     = (u32) (addr_t) pgid;
  519. +   cp->cda     = pgid;
  520.     cp->count   = sizeof(*pgid);
  521.     cp->flags   = CCW_FLAG_SLI;
  522.     req->cp     = cp;
  523. @@ -438,7 +438,7 @@ static void snid_build_cp(struct ccw_dev
  524.  
  525.     /* Channel program setup. */
  526.     cp->cmd_code    = CCW_CMD_SENSE_PGID;
  527. -   cp->cda     = (u32) (addr_t) &cdev->private->pgid[i];
  528. +   cp->cda     = &cdev->private->pgid[i];
  529.     cp->count   = sizeof(struct pgid);
  530.     cp->flags   = CCW_FLAG_SLI;
  531.     req->cp     = cp;
  532. @@ -622,11 +622,11 @@ static void stlck_build_cp(struct ccw_de
  533.     struct ccw1 *cp = cdev->private->iccws;
  534.  
  535.     cp[0].cmd_code = CCW_CMD_STLCK;
  536. -   cp[0].cda = (u32) (addr_t) buf1;
  537. +   cp[0].cda = buf1;
  538.     cp[0].count = 32;
  539.     cp[0].flags = CCW_FLAG_CC;
  540.     cp[1].cmd_code = CCW_CMD_RELEASE;
  541. -   cp[1].cda = (u32) (addr_t) buf2;
  542. +   cp[1].cda = buf2;
  543.     cp[1].count = 32;
  544.     cp[1].flags = 0;
  545.     req->cp = cp;
  546. diff -u -p a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c
  547. --- a/drivers/s390/cio/chsc.c
  548. +++ b/drivers/s390/cio/chsc.c
  549. @@ -747,8 +747,8 @@ int __chsc_do_secm(struct channel_subsys
  550.     secm_area->request.code = 0x0016;
  551.  
  552.     secm_area->key = PAGE_DEFAULT_KEY >> 4;
  553. -   secm_area->cub_addr1 = (u64)(unsigned long)css->cub_addr1;
  554. -   secm_area->cub_addr2 = (u64)(unsigned long)css->cub_addr2;
  555. +   secm_area->cub_addr1 = css->cub_addr1;
  556. +   secm_area->cub_addr2 = css->cub_addr2;
  557.  
  558.     secm_area->operation_code = enable ? 0 : 1;
  559.  
  560. diff -u -p a/drivers/s390/block/dasd_eer.c b/drivers/s390/block/dasd_eer.c
  561. --- a/drivers/s390/block/dasd_eer.c
  562. +++ b/drivers/s390/block/dasd_eer.c
  563. @@ -479,7 +479,7 @@ int dasd_eer_enable(struct dasd_device *
  564.     ccw->cmd_code = DASD_ECKD_CCW_SNSS;
  565.     ccw->count = SNSS_DATA_SIZE;
  566.     ccw->flags = 0;
  567. -   ccw->cda = (__u32)(addr_t) cqr->data;
  568. +   ccw->cda = cqr->data;
  569.  
  570.     cqr->buildclk = get_tod_clock();
  571.     cqr->status = DASD_CQR_FILLED;
  572. diff -u -p a/drivers/s390/block/dasd_3990_erp.c b/drivers/s390/block/dasd_3990_erp.c
  573. --- a/drivers/s390/block/dasd_3990_erp.c
  574. +++ b/drivers/s390/block/dasd_3990_erp.c
  575. @@ -219,7 +219,7 @@ dasd_3990_erp_DCTL(struct dasd_ccw_req *
  576.     memset(ccw, 0, sizeof(struct ccw1));
  577.     ccw->cmd_code = CCW_CMD_DCTL;
  578.     ccw->count = 4;
  579. -   ccw->cda = (__u32)(addr_t) DCTL_data;
  580. +   ccw->cda = DCTL_data;
  581.     dctl_cqr->flags = erp->flags;
  582.     dctl_cqr->function = dasd_3990_erp_DCTL;
  583.     dctl_cqr->refers = erp;
  584. @@ -1695,7 +1695,7 @@ dasd_3990_erp_action_1B_32(struct dasd_c
  585.     ccw->cmd_code = DASD_ECKD_CCW_DEFINE_EXTENT;
  586.     ccw->flags = CCW_FLAG_CC;
  587.     ccw->count = 16;
  588. -   ccw->cda = (__u32)(addr_t) DE_data;
  589. +   ccw->cda = DE_data;
  590.  
  591.     /* create LO ccw */
  592.     ccw++;
  593. @@ -1703,7 +1703,7 @@ dasd_3990_erp_action_1B_32(struct dasd_c
  594.     ccw->cmd_code = DASD_ECKD_CCW_LOCATE_RECORD;
  595.     ccw->flags = CCW_FLAG_CC;
  596.     ccw->count = 16;
  597. -   ccw->cda = (__u32)(addr_t) LO_data;
  598. +   ccw->cda = LO_data;
  599.  
  600.     /* TIC to the failed ccw */
  601.     ccw++;
  602. diff -u -p a/drivers/acpi/acpica/exregion.c b/drivers/acpi/acpica/exregion.c
  603. --- a/drivers/acpi/acpica/exregion.c
  604. +++ b/drivers/acpi/acpica/exregion.c
  605. @@ -390,7 +390,7 @@ acpi_ex_pci_config_space_handler(u32 fun
  606.      *
  607.      */
  608.     pci_id = (struct acpi_pci_id *)region_context;
  609. -   pci_register = (u16) (u32) address;
  610. +   pci_register = address;
  611.  
  612.     ACPI_DEBUG_PRINT((ACPI_DB_INFO,
  613.               "Pci-Config %u (%u) Seg(%04x) Bus(%04x) Dev(%04x) Func(%04x) Reg(%04x)\n",
  614. diff -u -p a/drivers/acpi/acpica/nsaccess.c b/drivers/acpi/acpica/nsaccess.c
  615. --- a/drivers/acpi/acpica/nsaccess.c
  616. +++ b/drivers/acpi/acpica/nsaccess.c
  617. @@ -491,7 +491,7 @@ acpi_ns_lookup(union acpi_generic_state
  618.             /* Extract segment count, point to first name segment */
  619.  
  620.             path++;
  621. -           num_segments = (u32) (u8) * path;
  622. +           num_segments = * path;
  623.             path++;
  624.  
  625.             ACPI_DEBUG_PRINT((ACPI_DB_NAMES,
  626. diff -u -p a/drivers/infiniband/hw/amso1100/c2_ae.c b/drivers/infiniband/hw/amso1100/c2_ae.c
  627. --- a/drivers/infiniband/hw/amso1100/c2_ae.c
  628. +++ b/drivers/infiniband/hw/amso1100/c2_ae.c
  629. @@ -171,7 +171,7 @@ void c2_ae_event(struct c2_dev *c2dev, u
  630.     event_id = c2_wr_get_id(wr);
  631.     resource_indicator = be32_to_cpu(wr->ae.ae_generic.resource_type);
  632.     resource_user_context =
  633. -       (void *) (unsigned long) wr->ae.ae_generic.user_context;
  634. +       wr->ae.ae_generic.user_context;
  635.  
  636.     status = cm_event.status = c2_convert_cm_status(c2_wr_get_result(wr));
  637.  
  638. @@ -282,7 +282,7 @@ void c2_ae_event(struct c2_dev *c2dev, u
  639.             break;
  640.         }
  641.         cm_event.event = IW_CM_EVENT_CONNECT_REQUEST;
  642. -       cm_event.provider_data = (void*)(unsigned long)req->cr_handle;
  643. +       cm_event.provider_data = req->cr_handle;
  644.         laddr->sin_addr.s_addr = req->laddr;
  645.         raddr->sin_addr.s_addr = req->raddr;
  646.         laddr->sin_port = req->lport;
  647. diff -u -p a/drivers/infiniband/hw/cxgb4/mem.c b/drivers/infiniband/hw/cxgb4/mem.c
  648. --- a/drivers/infiniband/hw/cxgb4/mem.c
  649. +++ b/drivers/infiniband/hw/cxgb4/mem.c
  650. @@ -144,7 +144,7 @@ static int _c4iw_write_mem_inline(struct
  651.         if (i == (num_wqe-1)) {
  652.             req->wr.wr_hi = cpu_to_be32(FW_WR_OP_V(FW_ULPTX_WR) |
  653.                             FW_WR_COMPL_F);
  654. -           req->wr.wr_lo = (__force __be64)(unsigned long) &wr_wait;
  655. +           req->wr.wr_lo = &wr_wait;
  656.         } else
  657.             req->wr.wr_hi = cpu_to_be32(FW_WR_OP_V(FW_ULPTX_WR));
  658.         req->wr.wr_mid = cpu_to_be32(
  659. diff -u -p a/drivers/infiniband/hw/ipath/ipath_srq.c b/drivers/infiniband/hw/ipath/ipath_srq.c
  660. --- a/drivers/infiniband/hw/ipath/ipath_srq.c
  661. +++ b/drivers/infiniband/hw/ipath/ipath_srq.c
  662. @@ -252,7 +252,7 @@ int ipath_modify_srq(struct ib_srq *ibsr
  663.             if (ret)
  664.                 goto bail_free;
  665.             udata->outbuf =
  666. -               (void __user *) (unsigned long) offset_addr;
  667. +               offset_addr;
  668.             ret = ib_copy_to_udata(udata, &offset,
  669.                            sizeof(offset));
  670.             if (ret)
  671. diff -u -p a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
  672. --- a/drivers/infiniband/hw/mlx5/qp.c
  673. +++ b/drivers/infiniband/hw/mlx5/qp.c
  674. @@ -2106,7 +2106,7 @@ static int set_data_inl_seg(struct mlx5_
  675.     seg = wqe;
  676.     wqe += sizeof(*seg);
  677.     for (i = 0; i < wr->num_sge; i++) {
  678. -       addr = (void *)(unsigned long)(wr->sg_list[i].addr);
  679. +       addr = (wr->sg_list[i].addr);
  680.         len  = wr->sg_list[i].length;
  681.         inl += len;
  682.  
  683. diff -u -p a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
  684. --- a/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
  685. +++ b/drivers/infiniband/hw/ocrdma/ocrdma_verbs.c
  686. @@ -2144,7 +2144,7 @@ static int ocrdma_build_fr(struct ocrdma
  687.     fast_reg->num_sges = wr->wr.fast_reg.page_list_len;
  688.     fast_reg->size_sge =
  689.         get_encoded_page_size(1 << wr->wr.fast_reg.page_shift);
  690. -   mr = (struct ocrdma_mr *) (unsigned long)
  691. +   mr =
  692.         dev->stag_arr[(hdr->lkey >> 8) & (OCRDMA_MAX_STAG - 1)];
  693.     build_frmr_pbes(wr, mr->hwmr.pbl_table, &mr->hwmr);
  694.     return 0;
  695. diff -u -p a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c
  696. --- a/drivers/infiniband/core/ucma.c
  697. +++ b/drivers/infiniband/core/ucma.c
  698. @@ -882,7 +882,7 @@ static ssize_t ucma_query(struct ucma_fi
  699.     if (copy_from_user(&cmd, inbuf, sizeof(cmd)))
  700.         return -EFAULT;
  701.  
  702. -   response = (void __user *)(unsigned long) cmd.response;
  703. +   response = cmd.response;
  704.     ctx = ucma_get_ctx(file, cmd.id);
  705.     if (IS_ERR(ctx))
  706.         return PTR_ERR(ctx);
  707. diff -u -p a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c
  708. --- a/drivers/infiniband/core/uverbs_cmd.c
  709. +++ b/drivers/infiniband/core/uverbs_cmd.c
  710. @@ -1514,7 +1514,7 @@ ssize_t ib_uverbs_poll_cq(struct ib_uver
  711.         return -EINVAL;
  712.  
  713.     /* we copy a struct ib_uverbs_poll_cq_resp to user space */
  714. -   header_ptr = (void __user *)(unsigned long) cmd.response;
  715. +   header_ptr = cmd.response;
  716.     data_ptr = header_ptr + sizeof resp;
  717.  
  718.     memset(&resp, 0, sizeof resp);
  719. diff -u -p a/drivers/isdn/hardware/mISDN/hfcpci.c b/drivers/isdn/hardware/mISDN/hfcpci.c
  720. --- a/drivers/isdn/hardware/mISDN/hfcpci.c
  721. +++ b/drivers/isdn/hardware/mISDN/hfcpci.c
  722. @@ -2013,7 +2013,7 @@ setup_hw(struct hfc_pci *hc)
  723.         return 1;
  724.     }
  725.     hc->hw.pci_io =
  726. -       (char __iomem *)(unsigned long)hc->pdev->resource[1].start;
  727. +       hc->pdev->resource[1].start;
  728.  
  729.     if (!hc->hw.pci_io) {
  730.         printk(KERN_WARNING "HFC-PCI: No IO-Mem for PCI card found\n");
  731. diff -u -p a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c
  732. --- a/drivers/isdn/hisax/avma1_cs.c
  733. +++ b/drivers/isdn/hisax/avma1_cs.c
  734. @@ -128,7 +128,7 @@ static int avma1cs_config(struct pcmcia_
  735.         avma1cs_release(link);
  736.         return -ENODEV;
  737.     }
  738. -   link->priv = (void *) (unsigned long) i;
  739. +   link->priv = i;
  740.  
  741.     return 0;
  742.  } /* avma1cs_config */
  743. diff -u -p a/drivers/video/fbdev/core/fbmem.c b/drivers/video/fbdev/core/fbmem.c
  744. --- a/drivers/video/fbdev/core/fbmem.c
  745. +++ b/drivers/video/fbdev/core/fbmem.c
  746. @@ -1303,7 +1303,7 @@ static int do_fscreeninfo_to_user(struct
  747.  
  748.     err = copy_to_user(&fix32->id, &fix->id, sizeof(fix32->id));
  749.  
  750. -   data = (__u32) (unsigned long) fix->smem_start;
  751. +   data = fix->smem_start;
  752.     err |= put_user(data, &fix32->smem_start);
  753.  
  754.     err |= put_user(fix->smem_len, &fix32->smem_len);
  755. @@ -1315,7 +1315,7 @@ static int do_fscreeninfo_to_user(struct
  756.     err |= put_user(fix->ywrapstep, &fix32->ywrapstep);
  757.     err |= put_user(fix->line_length, &fix32->line_length);
  758.  
  759. -   data = (__u32) (unsigned long) fix->mmio_start;
  760. +   data = fix->mmio_start;
  761.     err |= put_user(data, &fix32->mmio_start);
  762.  
  763.     err |= put_user(fix->mmio_len, &fix32->mmio_len);
  764. diff -u -p a/drivers/media/firewire/firedtv-dvb.c b/drivers/media/firewire/firedtv-dvb.c
  765. --- a/drivers/media/firewire/firedtv-dvb.c
  766. +++ b/drivers/media/firewire/firedtv-dvb.c
  767. @@ -95,7 +95,7 @@ int fdtv_start_feed(struct dvb_demux_fee
  768.         goto out;
  769.     }
  770.  
  771. -   dvbdmxfeed->priv = (typeof(dvbdmxfeed->priv))(unsigned long)c;
  772. +   dvbdmxfeed->priv = c;
  773.     fdtv->channel_pid[c] = dvbdmxfeed->pid;
  774.     collect_channels(fdtv, &pidc, pids);
  775.  
  776. diff -u -p a/drivers/cpuidle/coupled.c b/drivers/cpuidle/coupled.c
  777. --- a/drivers/cpuidle/coupled.c
  778. +++ b/drivers/cpuidle/coupled.c
  779. @@ -664,7 +664,7 @@ have_coupled:
  780.  
  781.     csd = &per_cpu(cpuidle_coupled_poke_cb, dev->cpu);
  782.     csd->func = cpuidle_coupled_handle_poke;
  783. -   csd->info = (void *)(unsigned long)dev->cpu;
  784. +   csd->info = dev->cpu;
  785.  
  786.     return 0;
  787.  }
  788. diff -u -p a/drivers/misc/vmw_vmci/vmci_host.c b/drivers/misc/vmw_vmci/vmci_host.c
  789. --- a/drivers/misc/vmw_vmci/vmci_host.c
  790. +++ b/drivers/misc/vmw_vmci/vmci_host.c
  791. @@ -430,7 +430,7 @@ static int vmci_host_do_receive_datagram
  792.                              &size, &dg);
  793.  
  794.     if (recv_info.result >= VMCI_SUCCESS) {
  795. -       void __user *ubuf = (void __user *)(uintptr_t)recv_info.addr;
  796. +       void __user *ubuf = recv_info.addr;
  797.         retval = copy_to_user(ubuf, dg, VMCI_DG_SIZE(dg));
  798.         kfree(dg);
  799.         if (retval != 0)
  800. @@ -725,7 +725,7 @@ static int vmci_host_do_ctx_get_cpt_stat
  801.     get_info.result = vmci_ctx_get_chkpt_state(cid, get_info.cpt_type,
  802.                         &get_info.buf_size, &cpt_buf);
  803.     if (get_info.result == VMCI_SUCCESS && get_info.buf_size) {
  804. -       void __user *ubuf = (void __user *)(uintptr_t)get_info.cpt_buf;
  805. +       void __user *ubuf = get_info.cpt_buf;
  806.         retval = copy_to_user(ubuf, cpt_buf, get_info.buf_size);
  807.         kfree(cpt_buf);
  808.  
  809. @@ -900,11 +900,11 @@ static int vmci_host_do_recv_notificatio
  810.     if (info.result != VMCI_SUCCESS)
  811.         return copy_to_user(uptr, &info, sizeof(info)) ? -EFAULT : 0;
  812.  
  813. -   ubuf = (void __user *)(uintptr_t)info.db_handle_buf_uva;
  814. +   ubuf = info.db_handle_buf_uva;
  815.     info.result = drv_cp_harray_to_user(ubuf, &info.db_handle_buf_size,
  816.                         db_handle_array, &retval);
  817.     if (info.result == VMCI_SUCCESS && !retval) {
  818. -       ubuf = (void __user *)(uintptr_t)info.qp_handle_buf_uva;
  819. +       ubuf = info.qp_handle_buf_uva;
  820.         info.result = drv_cp_harray_to_user(ubuf,
  821.                             &info.qp_handle_buf_size,
  822.                             qp_handle_array, &retval);
  823. diff -u -p a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
  824. --- a/drivers/tty/serial/serial_core.c
  825. +++ b/drivers/tty/serial/serial_core.c
  826. @@ -691,7 +691,7 @@ static void do_uart_get_info(struct tty_
  827.     retinfo->hub6       = uport->hub6;
  828.     retinfo->io_type         = uport->iotype;
  829.     retinfo->iomem_reg_shift = uport->regshift;
  830. -   retinfo->iomem_base      = (void *)(unsigned long)uport->mapbase;
  831. +   retinfo->iomem_base      = uport->mapbase;
  832.  }
  833.  
  834.  static void uart_get_info(struct tty_port *port,
  835. diff -u -p a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
  836. --- a/drivers/tty/serial/sh-sci.c
  837. +++ b/drivers/tty/serial/sh-sci.c
  838. @@ -2063,7 +2063,7 @@ static int sci_remap_port(struct uart_po
  839.          * need to do any remapping, just cast the cookie
  840.          * directly.
  841.          */
  842. -       port->membase = (void __iomem *)(uintptr_t)port->mapbase;
  843. +       port->membase = port->mapbase;
  844.     }
  845.  
  846.     return 0;
  847. diff -u -p a/drivers/gpio/gpio-ge.c b/drivers/gpio/gpio-ge.c
  848. --- a/drivers/gpio/gpio-ge.c
  849. +++ b/drivers/gpio/gpio-ge.c
  850. @@ -84,7 +84,7 @@ static int __init gef_gpio_probe(struct
  851.     }
  852.  
  853.     bgc->gc.base = -1;
  854. -   bgc->gc.ngpio = (u16)(uintptr_t)of_id->data;
  855. +   bgc->gc.ngpio = of_id->data;
  856.     bgc->gc.of_gpio_n_cells = 2;
  857.     bgc->gc.of_node = pdev->dev.of_node;
  858.  
  859. diff -u -p a/drivers/usb/host/sl811-hcd.c b/drivers/usb/host/sl811-hcd.c
  860. --- a/drivers/usb/host/sl811-hcd.c
  861. +++ b/drivers/usb/host/sl811-hcd.c
  862. @@ -1663,8 +1663,8 @@ sl811h_probe(struct platform_device *dev
  863.          * to avoid compiler warning, assuming that ->start
  864.          * is always 32-bit for this case
  865.          */
  866. -       addr_reg = (void __iomem *) (unsigned long) addr->start;
  867. -       data_reg = (void __iomem *) (unsigned long) data->start;
  868. +       addr_reg = addr->start;
  869. +       data_reg = data->start;
  870.     } else {
  871.         addr_reg = ioremap(addr->start, 1);
  872.         if (addr_reg == NULL) {
  873. diff -u -p a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
  874. --- a/drivers/scsi/qla2xxx/qla_iocb.c
  875. +++ b/drivers/scsi/qla2xxx/qla_iocb.c
  876. @@ -390,7 +390,7 @@ qla2x00_start_scsi(srb_t *sp)
  877.     req->current_outstanding_cmd = handle;
  878.     req->outstanding_cmds[handle] = sp;
  879.     sp->handle = handle;
  880. -   cmd->host_scribble = (unsigned char *)(unsigned long)handle;
  881. +   cmd->host_scribble = handle;
  882.     req->cnt -= req_cnt;
  883.  
  884.     cmd_pkt = (cmd_entry_t *)req->ring_ptr;
  885. @@ -1516,7 +1516,7 @@ qla24xx_start_scsi(srb_t *sp)
  886.     req->current_outstanding_cmd = handle;
  887.     req->outstanding_cmds[handle] = sp;
  888.     sp->handle = handle;
  889. -   cmd->host_scribble = (unsigned char *)(unsigned long)handle;
  890. +   cmd->host_scribble = handle;
  891.     req->cnt -= req_cnt;
  892.  
  893.     cmd_pkt = (struct cmd_type_7 *)req->ring_ptr;
  894. @@ -1722,7 +1722,7 @@ qla24xx_dif_start_scsi(srb_t *sp)
  895.     req->current_outstanding_cmd = handle;
  896.     req->outstanding_cmds[handle] = sp;
  897.     sp->handle = handle;
  898. -   cmd->host_scribble = (unsigned char *)(unsigned long)handle;
  899. +   cmd->host_scribble = handle;
  900.     req->cnt -= req_cnt;
  901.  
  902.     /* Fill-in common area */
  903. @@ -2518,7 +2518,7 @@ sufficient_dsds:
  904.     req->current_outstanding_cmd = handle;
  905.     req->outstanding_cmds[handle] = sp;
  906.     sp->handle = handle;
  907. -   cmd->host_scribble = (unsigned char *)(unsigned long)handle;
  908. +   cmd->host_scribble = handle;
  909.     req->cnt -= req_cnt;
  910.     wmb();
  911.  
  912. diff -u -p a/drivers/scsi/megaraid/megaraid_mm.c b/drivers/scsi/megaraid/megaraid_mm.c
  913. --- a/drivers/scsi/megaraid/megaraid_mm.c
  914. +++ b/drivers/scsi/megaraid/megaraid_mm.c
  915. @@ -825,7 +825,7 @@ kioc_to_mimd(uioc_t *kioc, mimd_t __user
  916.  
  917.         case MEGAIOC_QADAPINFO:
  918.  
  919. -           hinfo = (mraid_hba_info_t *)(unsigned long)
  920. +           hinfo =
  921.                     kioc->buf_vaddr;
  922.  
  923.             hinfo_to_cinfo(hinfo, &cinfo);
  924. @@ -842,7 +842,7 @@ kioc_to_mimd(uioc_t *kioc, mimd_t __user
  925.         return 0;
  926.     }
  927.  
  928. -   mbox64 = (mbox64_t *)(unsigned long)kioc->cmdbuf;
  929. +   mbox64 = kioc->cmdbuf;
  930.  
  931.     if (kioc->user_pthru) {
  932.  
  933. @@ -965,7 +965,7 @@ mraid_mm_register_adp(mraid_mmadp_t *lld
  934.     for (i = 0; i < lld_adp->max_kioc; i++) {
  935.  
  936.         kioc        = adapter->kioc_list + i;
  937. -       kioc->cmdbuf    = (uint64_t)(unsigned long)(mbox_list + i);
  938. +       kioc->cmdbuf    = (mbox_list + i);
  939.         kioc->pthru32   = pci_pool_alloc(adapter->pthru_dma_pool,
  940.                         GFP_KERNEL, &kioc->pthru32_h);
  941.  
  942. diff -u -p a/drivers/scsi/initio.c b/drivers/scsi/initio.c
  943. --- a/drivers/scsi/initio.c
  944. +++ b/drivers/scsi/initio.c
  945. @@ -2583,7 +2583,7 @@ static void initio_build_scb(struct init
  946.                   SENSE_SIZE, DMA_FROM_DEVICE);
  947.     cblk->senseptr = (u32)dma_addr;
  948.     cblk->senselen = SENSE_SIZE;
  949. -   cmnd->SCp.ptr = (char *)(unsigned long)dma_addr;
  950. +   cmnd->SCp.ptr = dma_addr;
  951.     cblk->cdblen = cmnd->cmd_len;
  952.  
  953.     /* Clear the returned status */
  954. diff -u -p a/drivers/scsi/hptiop.c b/drivers/scsi/hptiop.c
  955. --- a/drivers/scsi/hptiop.c
  956. +++ b/drivers/scsi/hptiop.c
  957. @@ -819,7 +819,7 @@ void hptiop_iop_request_callback_itl(str
  958.     BUG_ON(readl(&req->type) != IOP_REQUEST_TYPE_IOCTL_COMMAND);
  959.  
  960.     p = (struct hpt_iop_request_ioctl_command __iomem *)req;
  961. -   arg = (struct hpt_ioctl_k *)(unsigned long)
  962. +   arg =
  963.         (readl(&req->context) |
  964.             ((u64)readl(&req->context_hi32)<<32));
  965.  
  966. diff -u -p a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
  967. --- a/drivers/scsi/qla4xxx/ql4_mbx.c
  968. +++ b/drivers/scsi/qla4xxx/ql4_mbx.c
  969. @@ -1187,7 +1187,7 @@ int qla4xxx_abort_task(struct scsi_qla_h
  970.     memset(&mbox_sts, 0, sizeof(mbox_sts));
  971.  
  972.     spin_lock_irqsave(&ha->hardware_lock, flags);
  973. -   index = (unsigned long)(unsigned char *)cmd->host_scribble;
  974. +   index = cmd->host_scribble;
  975.     spin_unlock_irqrestore(&ha->hardware_lock, flags);
  976.  
  977.     /* Firmware already posted completion on response queue */
  978. diff -u -p a/drivers/scsi/aic94xx/aic94xx_dev.c b/drivers/scsi/aic94xx/aic94xx_dev.c
  979. --- a/drivers/scsi/aic94xx/aic94xx_dev.c
  980. +++ b/drivers/scsi/aic94xx/aic94xx_dev.c
  981. @@ -82,7 +82,7 @@ static void asd_free_ddb(struct asd_ha_s
  982.  static void asd_set_ddb_type(struct domain_device *dev)
  983.  {
  984.     struct asd_ha_struct *asd_ha = dev->port->ha->lldd_ha;
  985. -   int ddb = (int) (unsigned long) dev->lldd_dev;
  986. +   int ddb = dev->lldd_dev;
  987.  
  988.     if (dev->dev_type == SAS_SATA_PM_PORT)
  989.         asd_ddbsite_write_byte(asd_ha,ddb, DDB_TYPE, DDB_TYPE_PM_PORT);
  990. @@ -113,7 +113,7 @@ void asd_set_dmamode(struct domain_devic
  991.  {
  992.     struct asd_ha_struct *asd_ha = dev->port->ha->lldd_ha;
  993.     struct ata_device *ata_dev = sas_to_ata_dev(dev);
  994. -   int ddb = (int) (unsigned long) dev->lldd_dev;
  995. +   int ddb = dev->lldd_dev;
  996.     u32 qdepth = 0;
  997.  
  998.     if (dev->dev_type == SAS_SATA_DEV || dev->dev_type == SAS_SATA_PM_PORT) {
  999. @@ -137,7 +137,7 @@ void asd_set_dmamode(struct domain_devic
  1000.  static int asd_init_sata(struct domain_device *dev)
  1001.  {
  1002.     struct asd_ha_struct *asd_ha = dev->port->ha->lldd_ha;
  1003. -   int ddb = (int) (unsigned long) dev->lldd_dev;
  1004. +   int ddb = dev->lldd_dev;
  1005.  
  1006.     asd_ddbsite_write_word(asd_ha, ddb, ATA_CMD_SCBPTR, 0xFFFF);
  1007.     if (dev->dev_type == SAS_SATA_DEV || dev->dev_type == SAS_SATA_PM ||
  1008. @@ -161,7 +161,7 @@ static int asd_init_target_ddb(struct do
  1009.     if (ddb < 0)
  1010.         return ddb;
  1011.  
  1012. -   dev->lldd_dev = (void *) (unsigned long) ddb;
  1013. +   dev->lldd_dev = ddb;
  1014.  
  1015.     asd_ddbsite_write_byte(asd_ha, ddb, 0, DDB_TP_CONN_TYPE);
  1016.     asd_ddbsite_write_byte(asd_ha, ddb, 1, 0);
  1017. @@ -278,7 +278,7 @@ static int asd_init_sata_pm_port_ddb(str
  1018.     asd_ddbsite_write_word(asd_ha, ddb, ATA_CMD_SCBPTR, 0xFFFF);
  1019.     asd_init_sata(dev);
  1020.  
  1021. -   parent_ddb = (int) (unsigned long) dev->parent->lldd_dev;
  1022. +   parent_ddb = dev->parent->lldd_dev;
  1023.     asd_ddbsite_write_word(asd_ha, ddb, PARENT_DDB, parent_ddb);
  1024.     pmtable_ddb = asd_ddbsite_read_word(asd_ha, parent_ddb, SISTER_DDB);
  1025.     asd_ddbsite_write_word(asd_ha, pmtable_ddb, dev->sata_dev.port_no,ddb);
  1026. @@ -352,7 +352,7 @@ void asd_dev_gone(struct domain_device *
  1027.     struct asd_ha_struct *asd_ha = dev->port->ha->lldd_ha;
  1028.  
  1029.     spin_lock_irqsave(&asd_ha->hw_prof.ddb_lock, flags);
  1030. -   ddb = (int) (unsigned long) dev->lldd_dev;
  1031. +   ddb = dev->lldd_dev;
  1032.     sister_ddb = asd_ddbsite_read_word(asd_ha, ddb, SISTER_DDB);
  1033.  
  1034.     if (sister_ddb != 0xFFFF)
  1035. diff -u -p a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c
  1036. --- a/drivers/scsi/megaraid.c
  1037. +++ b/drivers/scsi/megaraid.c
  1038. @@ -3207,7 +3207,7 @@ megadev_ioctl(struct file *filep, unsign
  1039.             /*
  1040.              * The user passthru structure
  1041.              */
  1042. -           upthru = (mega_passthru __user *)(unsigned long)MBOX(uioc)->xferaddr;
  1043. +           upthru = MBOX(uioc)->xferaddr;
  1044.  
  1045.             /*
  1046.              * Copy in the user passthru here.
  1047. diff -u -p a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c
  1048. --- a/drivers/ata/pata_amd.c
  1049. +++ b/drivers/ata/pata_amd.c
  1050. @@ -567,7 +567,7 @@ static int amd_init_one(struct pci_dev *
  1051.         u32 udma;
  1052.  
  1053.         pci_read_config_dword(pdev, 0x60, &udma);
  1054. -       hpriv = (void *)(unsigned long)udma;
  1055. +       hpriv = udma;
  1056.     }
  1057.  
  1058.     /* And fire it up */
  1059. diff -u -p a/mm/mempool.c b/mm/mempool.c
  1060. --- a/mm/mempool.c
  1061. +++ b/mm/mempool.c
  1062. @@ -366,14 +366,14 @@ EXPORT_SYMBOL(mempool_kfree);
  1063.   */
  1064.  void *mempool_alloc_pages(gfp_t gfp_mask, void *pool_data)
  1065.  {
  1066. -   int order = (int)(long)pool_data;
  1067. +   int order = pool_data;
  1068.     return alloc_pages(gfp_mask, order);
  1069.  }
  1070.  EXPORT_SYMBOL(mempool_alloc_pages);
  1071.  
  1072.  void mempool_free_pages(void *element, void *pool_data)
  1073.  {
  1074. -   int order = (int)(long)pool_data;
  1075. +   int order = pool_data;
  1076.     __free_pages(element, order);
  1077.  }
  1078.  EXPORT_SYMBOL(mempool_free_pages);
  1079. diff -u -p a/sound/oss/mpu401.c b/sound/oss/mpu401.c
  1080. --- a/sound/oss/mpu401.c
  1081. +++ b/sound/oss/mpu401.c
  1082. @@ -437,7 +437,7 @@ static void mpu401_input_loop(struct mpu
  1083.  static irqreturn_t mpuintr(int irq, void *dev_id)
  1084.  {
  1085.     struct mpu_config *devc;
  1086. -   int dev = (int)(unsigned long) dev_id;
  1087. +   int dev = dev_id;
  1088.     int handled = 0;
  1089.  
  1090.     devc = &dev_conf[dev];
  1091. diff -u -p a/sound/oss/sb_common.c b/sound/oss/sb_common.c
  1092. --- a/sound/oss/sb_common.c
  1093. +++ b/sound/oss/sb_common.c
  1094. @@ -1225,7 +1225,7 @@ int probe_sbmpu(struct address_info *hw_
  1095.         attach_mpu401(hw_config, owner);
  1096.         if (last_sb->irq == -hw_config->irq)
  1097.             last_sb->midi_irq_cookie =
  1098. -               (void *)(long) hw_config->slots[1];
  1099. +               hw_config->slots[1];
  1100.         return 1;
  1101.     }
  1102.  #endif
  1103. diff -u -p a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
  1104. --- a/sound/core/pcm_lib.c
  1105. +++ b/sound/core/pcm_lib.c
  1106. @@ -1485,7 +1485,7 @@ EXPORT_SYMBOL(snd_pcm_hw_constraint_pow2
  1107.  static int snd_pcm_hw_rule_noresample_func(struct snd_pcm_hw_params *params,
  1108.                        struct snd_pcm_hw_rule *rule)
  1109.  {
  1110. -   unsigned int base_rate = (unsigned int)(uintptr_t)rule->private;
  1111. +   unsigned int base_rate = rule->private;
  1112.     struct snd_interval *rate;
  1113.  
  1114.     rate = hw_param_interval(params, SNDRV_PCM_HW_PARAM_RATE);
  1115. diff -u -p a/sound/pci/oxygen/oxygen_pcm.c b/sound/pci/oxygen/oxygen_pcm.c
  1116. --- a/sound/pci/oxygen/oxygen_pcm.c
  1117. +++ b/sound/pci/oxygen/oxygen_pcm.c
  1118. @@ -136,7 +136,7 @@ static int oxygen_open(struct snd_pcm_su
  1119.     struct snd_pcm_runtime *runtime = substream->runtime;
  1120.     int err;
  1121.  
  1122. -   runtime->private_data = (void *)(uintptr_t)channel;
  1123. +   runtime->private_data = channel;
  1124.     if (channel == PCM_B && chip->has_ac97_1 &&
  1125.         (chip->model.device_config & CAPTURE_2_FROM_AC97_1))
  1126.         runtime->hw = oxygen_ac97_hardware;
  1127. diff -u -p a/arch/arm/common/mcpm_entry.c b/arch/arm/common/mcpm_entry.c
  1128. --- a/arch/arm/common/mcpm_entry.c
  1129. +++ b/arch/arm/common/mcpm_entry.c
  1130. @@ -101,7 +101,7 @@ void mcpm_cpu_power_down(void)
  1131.      * had happened as described above.
  1132.      */
  1133.  
  1134. -   phys_reset = (phys_reset_t)(unsigned long)virt_to_phys(cpu_reset);
  1135. +   phys_reset = virt_to_phys(cpu_reset);
  1136.     phys_reset(virt_to_phys(mcpm_entry_point));
  1137.  
  1138.     /* should never get here */
  1139. @@ -134,7 +134,7 @@ void mcpm_cpu_suspend(u64 expected_resid
  1140.     /* Very similar to mcpm_cpu_power_down() */
  1141.     setup_mm_for_reboot();
  1142.     platform_ops->suspend(expected_residency);
  1143. -   phys_reset = (phys_reset_t)(unsigned long)virt_to_phys(cpu_reset);
  1144. +   phys_reset = virt_to_phys(cpu_reset);
  1145.     phys_reset(virt_to_phys(mcpm_entry_point));
  1146.     BUG();
  1147.  }
  1148. @@ -167,7 +167,7 @@ static int __init nocache_trampoline(uns
  1149.     __mcpm_outbound_leave_critical(cluster, CLUSTER_DOWN);
  1150.     __mcpm_cpu_down(cpu, cluster);
  1151.  
  1152. -   phys_reset = (phys_reset_t)(unsigned long)virt_to_phys(cpu_reset);
  1153. +   phys_reset = virt_to_phys(cpu_reset);
  1154.     phys_reset(virt_to_phys(mcpm_entry_point));
  1155.     BUG();
  1156.  }
  1157. diff -u -p a/arch/mn10300/kernel/mn10300-serial.c b/arch/mn10300/kernel/mn10300-serial.c
  1158. --- a/arch/mn10300/kernel/mn10300-serial.c
  1159. +++ b/arch/mn10300/kernel/mn10300-serial.c
  1160. @@ -1476,7 +1476,7 @@ static int mn10300_serial_verify_port(st
  1161.  {
  1162.     struct mn10300_serial_port *port =
  1163.         container_of(_port, struct mn10300_serial_port, uart);
  1164. -   void *mapbase = (void *) (unsigned long) port->uart.mapbase;
  1165. +   void *mapbase = port->uart.mapbase;
  1166.  
  1167.     _enter("%s", port->name);
  1168.  
  1169. diff -u -p a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
  1170. --- a/arch/sparc/mm/init_64.c
  1171. +++ b/arch/sparc/mm/init_64.c
  1172. @@ -1790,7 +1790,7 @@ static void patch_one_ktsb_phys(unsigned
  1173.     low_bits = (pa >> 0) & 0xffffffff;
  1174.  
  1175.     while (start < end) {
  1176. -       unsigned int *ia = (unsigned int *)(unsigned long)*start;
  1177. +       unsigned int *ia = *start;
  1178.  
  1179.         ia[0] = (ia[0] & ~0x3fffff) | (high_bits >> 10);
  1180.         __asm__ __volatile__("flush %0" : : "r" (ia));
  1181. diff -u -p a/arch/s390/kernel/kprobes.c b/arch/s390/kernel/kprobes.c
  1182. --- a/arch/s390/kernel/kprobes.c
  1183. +++ b/arch/s390/kernel/kprobes.c
  1184. @@ -87,8 +87,8 @@ static void copy_instruction(struct kpro
  1185.      * Therefore the new displacement will always fit.
  1186.      */
  1187.     disp = *(s32 *)&p->ainsn.insn[1];
  1188. -   addr = (u64)(unsigned long)p->addr;
  1189. -   new_addr = (u64)(unsigned long)p->ainsn.insn;
  1190. +   addr = p->addr;
  1191. +   new_addr = p->ainsn.insn;
  1192.     new_disp = ((addr + (disp * 2)) - new_addr) / 2;
  1193.     *(s32 *)&p->ainsn.insn[1] = new_disp;
  1194.  }
  1195. diff -u -p a/arch/s390/boot/compressed/misc.c b/arch/s390/boot/compressed/misc.c
  1196. --- a/arch/s390/boot/compressed/misc.c
  1197. +++ b/arch/s390/boot/compressed/misc.c
  1198. @@ -131,7 +131,7 @@ static void check_ipl_parmblock(void *st
  1199.  {
  1200.     void *src, *dst;
  1201.  
  1202. -   src = (void *)(unsigned long) S390_lowcore.ipl_parmblock_ptr;
  1203. +   src = S390_lowcore.ipl_parmblock_ptr;
  1204.     if (src + PAGE_SIZE <= start || src >= start + size)
  1205.         return;
  1206.     dst = (void *) IPL_PARMBLOCK_ORIGIN;
  1207. diff -u -p a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c
  1208. --- a/arch/mips/kernel/vpe.c
  1209. +++ b/arch/mips/kernel/vpe.c
  1210. @@ -241,7 +241,7 @@ static int apply_r_mips_gprel16(struct m
  1211.     } else {
  1212.         /* .sbss + gp(relative) + offset */
  1213.         /* kludge! */
  1214. -       rel =  (int)(short)((int)v + gp_offs +
  1215. +       rel =  ((int)v + gp_offs +
  1216.                     (int)(short)(*location & 0xffff) - gp_addr);
  1217.     }
  1218.  
  1219. diff -u -p a/arch/mips/txx9/generic/setup.c b/arch/mips/txx9/generic/setup.c
  1220. --- a/arch/mips/txx9/generic/setup.c
  1221. +++ b/arch/mips/txx9/generic/setup.c
  1222. @@ -179,7 +179,7 @@ static void __init prom_init_cmdline(voi
  1223.     arcs_cmdline[0] = '\0';
  1224.  
  1225.     for (i = 1; i < argc; i++) {
  1226. -       char *str = (char *)(long)argv32[i];
  1227. +       char *str = argv32[i];
  1228.         if (i != 1)
  1229.             strcat(arcs_cmdline, " ");
  1230.         if (strchr(str, ' ')) {
  1231. diff -u -p a/arch/mips/dec/prom/cmdline.c b/arch/mips/dec/prom/cmdline.c
  1232. --- a/arch/mips/dec/prom/cmdline.c
  1233. +++ b/arch/mips/dec/prom/cmdline.c
  1234. @@ -27,7 +27,7 @@ void __init prom_init_cmdline(s32 argc,
  1235.     else
  1236.         start_arg = 2;
  1237.     for (i = start_arg; i < argc; i++) {
  1238. -       arg = (void *)(long)(argv[i]);
  1239. +       arg = (argv[i]);
  1240.         strcat(arcs_cmdline, arg);
  1241.         if (i < (argc - 1))
  1242.             strcat(arcs_cmdline, " ");
  1243. diff -u -p a/arch/parisc/kernel/drivers.c b/arch/parisc/kernel/drivers.c
  1244. --- a/arch/parisc/kernel/drivers.c
  1245. +++ b/arch/parisc/kernel/drivers.c
  1246. @@ -796,7 +796,7 @@ void walk_lower_bus(struct parisc_device
  1247.         return;
  1248.  
  1249.     if (dev->id.hw_type == HPHW_IOA) {
  1250. -       io_io_low = (unsigned long)(signed int)(READ_IO_IO_LOW(dev) << 16);
  1251. +       io_io_low = (READ_IO_IO_LOW(dev) << 16);
  1252.         io_io_high = io_io_low + MAX_NATIVE_DEVICES * NATIVE_DEVICE_OFFSET;
  1253.     } else {
  1254.         io_io_low = (READ_IO_IO_LOW(dev) + ~FLEX_MASK) & FLEX_MASK;
  1255. diff -u -p a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c
  1256. --- a/arch/arm64/kvm/guest.c
  1257. +++ b/arch/arm64/kvm/guest.c
  1258. @@ -54,7 +54,7 @@ static int get_core_reg(struct kvm_vcpu
  1259.      * array. Hence below, nr_regs is the number of entries, and
  1260.      * off the index in the "array".
  1261.      */
  1262. -   __u32 __user *uaddr = (__u32 __user *)(unsigned long)reg->addr;
  1263. +   __u32 __user *uaddr = reg->addr;
  1264.     struct kvm_regs *regs = vcpu_gp_regs(vcpu);
  1265.     int nr_regs = sizeof(*regs) / sizeof(__u32);
  1266.     u32 off;
  1267. @@ -73,7 +73,7 @@ static int get_core_reg(struct kvm_vcpu
  1268.  
  1269.  static int set_core_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
  1270.  {
  1271. -   __u32 __user *uaddr = (__u32 __user *)(unsigned long)reg->addr;
  1272. +   __u32 __user *uaddr = reg->addr;
  1273.     struct kvm_regs *regs = vcpu_gp_regs(vcpu);
  1274.     int nr_regs = sizeof(*regs) / sizeof(__u32);
  1275.     __uint128_t tmp;
  1276. @@ -167,7 +167,7 @@ static int copy_timer_indices(struct kvm
  1277.  
  1278.  static int set_timer_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
  1279.  {
  1280. -   void __user *uaddr = (void __user *)(long)reg->addr;
  1281. +   void __user *uaddr = reg->addr;
  1282.     u64 val;
  1283.     int ret;
  1284.  
  1285. @@ -180,7 +180,7 @@ static int set_timer_reg(struct kvm_vcpu
  1286.  
  1287.  static int get_timer_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
  1288.  {
  1289. -   void __user *uaddr = (void __user *)(long)reg->addr;
  1290. +   void __user *uaddr = reg->addr;
  1291.     u64 val;
  1292.  
  1293.     val = kvm_arm_timer_get_reg(vcpu, reg->id);
  1294. diff -u -p a/arch/um/os-Linux/elf_aux.c b/arch/um/os-Linux/elf_aux.c
  1295. --- a/arch/um/os-Linux/elf_aux.c
  1296. +++ b/arch/um/os-Linux/elf_aux.c
  1297. @@ -52,7 +52,7 @@ __init void scan_elf_aux( char **envp)
  1298.                                   * all that's left.
  1299.                                   */
  1300.                 elf_aux_platform =
  1301. -                   (char *) (long) auxv->a_un.a_val;
  1302. +                   auxv->a_un.a_val;
  1303.                 break;
  1304.             case AT_PAGESZ:
  1305.                 page_size = auxv->a_un.a_val;
  1306. diff -u -p a/arch/x86/mm/mpx.c b/arch/x86/mm/mpx.c
  1307. --- a/arch/x86/mm/mpx.c
  1308. +++ b/arch/x86/mm/mpx.c
  1309. @@ -319,8 +319,8 @@ siginfo_t *mpx_generate_siginfo(struct p
  1310.      * complains when casting from integers to different-size
  1311.      * pointers.
  1312.      */
  1313. -   info->si_lower = (void __user *)(unsigned long)bndreg->lower_bound;
  1314. -   info->si_upper = (void __user *)(unsigned long)~bndreg->upper_bound;
  1315. +   info->si_lower = bndreg->lower_bound;
  1316. +   info->si_upper = ~bndreg->upper_bound;
  1317.     info->si_addr_lsb = 0;
  1318.     info->si_signo = SIGSEGV;
  1319.     info->si_errno = 0;
  1320. diff -u -p a/arch/powerpc/kernel/jump_label.c b/arch/powerpc/kernel/jump_label.c
  1321. --- a/arch/powerpc/kernel/jump_label.c
  1322. +++ b/arch/powerpc/kernel/jump_label.c
  1323. @@ -15,7 +15,7 @@
  1324.  void arch_jump_label_transform(struct jump_entry *entry,
  1325.                    enum jump_label_type type)
  1326.  {
  1327. -   u32 *addr = (u32 *)(unsigned long)entry->code;
  1328. +   u32 *addr = entry->code;
  1329.  
  1330.     if (type == JUMP_LABEL_ENABLE)
  1331.         patch_branch(addr, entry->target, 0);
  1332. diff -u -p a/net/9p/trans_rdma.c b/net/9p/trans_rdma.c
  1333. --- a/net/9p/trans_rdma.c
  1334. +++ b/net/9p/trans_rdma.c
  1335. @@ -341,7 +341,7 @@ static void cq_comp_handler(struct ib_cq
  1336.  
  1337.     ib_req_notify_cq(rdma->cq, IB_CQ_NEXT_COMP);
  1338.     while ((ret = ib_poll_cq(cq, 1, &wc)) > 0) {
  1339. -       struct p9_rdma_context *c = (void *) (unsigned long) wc.wr_id;
  1340. +       struct p9_rdma_context *c = wc.wr_id;
  1341.  
  1342.         switch (c->wc_op) {
  1343.         case IB_WC_RECV:
  1344. diff -u -p a/net/sunrpc/xprtrdma/verbs.c b/net/sunrpc/xprtrdma/verbs.c
  1345. --- a/net/sunrpc/xprtrdma/verbs.c
  1346. +++ b/net/sunrpc/xprtrdma/verbs.c
  1347. @@ -217,7 +217,7 @@ rpcrdma_sendcq_process_wc(struct ib_wc *
  1348.     } else {
  1349.         struct rpcrdma_mw *r;
  1350.  
  1351. -       r = (struct rpcrdma_mw *)(unsigned long)wc->wr_id;
  1352. +       r = wc->wr_id;
  1353.         r->r.frmr.fr_state = FRMR_IS_STALE;
  1354.         pr_err("RPC:       %s: frmr %p (stale): %s\n",
  1355.                __func__, r, COMPLETION_MSG(wc->status));
  1356. @@ -283,7 +283,7 @@ static void
  1357.  rpcrdma_recvcq_process_wc(struct ib_wc *wc, struct list_head *sched_list)
  1358.  {
  1359.     struct rpcrdma_rep *rep =
  1360. -           (struct rpcrdma_rep *)(unsigned long)wc->wr_id;
  1361. +           wc->wr_id;
  1362.  
  1363.     /* WARNING: Only wr_id and status are reliable at this point */
  1364.     if (wc->status != IB_WC_SUCCESS)
  1365. @@ -1526,7 +1526,7 @@ rpcrdma_retry_local_inv(struct rpcrdma_m
  1366.     r->r.frmr.fr_state = FRMR_IS_INVALID;
  1367.  
  1368.     memset(&invalidate_wr, 0, sizeof(invalidate_wr));
  1369. -   invalidate_wr.wr_id = (unsigned long)(void *)r;
  1370. +   invalidate_wr.wr_id = r;
  1371.     invalidate_wr.opcode = IB_WR_LOCAL_INV;
  1372.     invalidate_wr.ex.invalidate_rkey = r->r.frmr.fr_mr->rkey;
  1373.     DECR_CQCOUNT(&r_xprt->rx_ep);
  1374. @@ -1933,7 +1933,7 @@ rpcrdma_register_frmr_external(struct rp
  1375.     frmr->fr_state = FRMR_IS_VALID;
  1376.  
  1377.     memset(&fastreg_wr, 0, sizeof(fastreg_wr));
  1378. -   fastreg_wr.wr_id = (unsigned long)(void *)mw;
  1379. +   fastreg_wr.wr_id = mw;
  1380.     fastreg_wr.opcode = IB_WR_FAST_REG_MR;
  1381.     fastreg_wr.wr.fast_reg.iova_start = seg1->mr_dma;
  1382.     fastreg_wr.wr.fast_reg.page_list = frmr->fr_pgl;
  1383. @@ -1987,7 +1987,7 @@ rpcrdma_deregister_frmr_external(struct
  1384.     seg1->rl_mw->r.frmr.fr_state = FRMR_IS_INVALID;
  1385.  
  1386.     memset(&invalidate_wr, 0, sizeof invalidate_wr);
  1387. -   invalidate_wr.wr_id = (unsigned long)(void *)seg1->rl_mw;
  1388. +   invalidate_wr.wr_id = seg1->rl_mw;
  1389.     invalidate_wr.opcode = IB_WR_LOCAL_INV;
  1390.     invalidate_wr.ex.invalidate_rkey = seg1->rl_mw->r.frmr.fr_mr->rkey;
  1391.     DECR_CQCOUNT(&r_xprt->rx_ep);
  1392. @@ -2198,7 +2198,7 @@ rpcrdma_ep_post_recv(struct rpcrdma_ia *
  1393.     int rc;
  1394.  
  1395.     recv_wr.next = NULL;
  1396. -   recv_wr.wr_id = (u64) (unsigned long) rep;
  1397. +   recv_wr.wr_id = rep;
  1398.     recv_wr.sg_list = &rep->rr_rdmabuf->rg_iov;
  1399.     recv_wr.num_sge = 1;
  1400.  
  1401. diff -u -p a/net/core/sock_diag.c b/net/core/sock_diag.c
  1402. --- a/net/core/sock_diag.c
  1403. +++ b/net/core/sock_diag.c
  1404. @@ -27,7 +27,7 @@ EXPORT_SYMBOL_GPL(sock_diag_check_cookie
  1405.  
  1406.  void sock_diag_save_cookie(void *sk, __u32 *cookie)
  1407.  {
  1408. -   cookie[0] = (u32)(unsigned long)sk;
  1409. +   cookie[0] = sk;
  1410.     cookie[1] = (u32)(((unsigned long)sk >> 31) >> 1);
  1411.  }
  1412.  EXPORT_SYMBOL_GPL(sock_diag_save_cookie);
  1413. diff -u -p a/fs/proc/base.c b/fs/proc/base.c
  1414. --- a/fs/proc/base.c
  1415. +++ b/fs/proc/base.c
  1416. @@ -1757,7 +1757,7 @@ static int
  1417.  proc_map_files_instantiate(struct inode *dir, struct dentry *dentry,
  1418.                struct task_struct *task, const void *ptr)
  1419.  {
  1420. -   fmode_t mode = (fmode_t)(unsigned long)ptr;
  1421. +   fmode_t mode = ptr;
  1422.     struct proc_inode *ei;
  1423.     struct inode *inode;
  1424.  
  1425. diff -u -p a/fs/afs/dir.c b/fs/afs/dir.c
  1426. --- a/fs/afs/dir.c
  1427. +++ b/fs/afs/dir.c
  1428. @@ -548,7 +548,7 @@ static struct dentry *afs_lookup(struct
  1429.         _leave(" = %d [do]", ret);
  1430.         return ERR_PTR(ret);
  1431.     }
  1432. -   dentry->d_fsdata = (void *)(unsigned long) vnode->status.data_version;
  1433. +   dentry->d_fsdata = vnode->status.data_version;
  1434.  
  1435.     /* instantiate the dentry */
  1436.     inode = afs_iget(dir->i_sb, key, &fid, NULL, NULL);
  1437. @@ -612,7 +612,7 @@ static int afs_d_revalidate(struct dentr
  1438.         goto out_bad;
  1439.     }
  1440.  
  1441. -   dir_version = (void *) (unsigned long) dir->status.data_version;
  1442. +   dir_version = dir->status.data_version;
  1443.     if (dentry->d_fsdata == dir_version)
  1444.         goto out_valid; /* the dir contents are unchanged */
  1445.  
  1446. diff -u -p a/fs/affs/namei.c b/fs/affs/namei.c
  1447. --- a/fs/affs/namei.c
  1448. +++ b/fs/affs/namei.c
  1449. @@ -230,7 +230,7 @@ affs_lookup(struct inode *dir, struct de
  1450.         u32 ino = bh->b_blocknr;
  1451.  
  1452.         /* store the real header ino in d_fsdata for faster lookups */
  1453. -       dentry->d_fsdata = (void *)(long)ino;
  1454. +       dentry->d_fsdata = ino;
  1455.         switch (be32_to_cpu(AFFS_TAIL(sb, bh)->stype)) {
  1456.         //link to dirs disabled
  1457.         //case ST_LINKDIR:
  1458. diff -u -p a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c
  1459. --- a/fs/reiserfs/inode.c
  1460. +++ b/fs/reiserfs/inode.c
  1461. @@ -2770,7 +2770,7 @@ static int reiserfs_write_begin(struct f
  1462.     if (flags & AOP_FLAG_CONT_EXPAND &&
  1463.         (pos & (inode->i_sb->s_blocksize - 1)) == 0) {
  1464.         pos ++;
  1465. -       *fsdata = (void *)(unsigned long)flags;
  1466. +       *fsdata = flags;
  1467.     }
  1468.  
  1469.     index = pos >> PAGE_CACHE_SHIFT;
  1470. diff -u -p a/fs/btrfs/send.c b/fs/btrfs/send.c
  1471. --- a/fs/btrfs/send.c
  1472. +++ b/fs/btrfs/send.c
  1473. @@ -1164,7 +1164,7 @@ struct backref_ctx {
  1474.  
  1475.  static int __clone_root_cmp_bsearch(const void *key, const void *elt)
  1476.  {
  1477. -   u64 root = (u64)(uintptr_t)key;
  1478. +   u64 root = key;
  1479.     struct clone_root *cr = (struct clone_root *)elt;
  1480.  
  1481.     if (root < cr->root->objectid)
  1482. diff -u -p a/fs/fuse/file.c b/fs/fuse/file.c
  1483. --- a/fs/fuse/file.c
  1484. +++ b/fs/fuse/file.c
  1485. @@ -2389,7 +2389,7 @@ static int fuse_copy_ioctl_iovec(struct
  1486.             fiov[i].len != (unsigned long) fiov[i].len)
  1487.             return -EIO;
  1488.  
  1489. -       dst[i].iov_base = (void __user *) (unsigned long) fiov[i].base;
  1490. +       dst[i].iov_base = fiov[i].base;
  1491.         dst[i].iov_len = (size_t) fiov[i].len;
  1492.  
  1493.  #ifdef CONFIG_COMPAT
  1494. diff -u -p a/fs/ocfs2/ioctl.c b/fs/ocfs2/ioctl.c
  1495. --- a/fs/ocfs2/ioctl.c
  1496. +++ b/fs/ocfs2/ioctl.c
  1497. @@ -781,12 +781,12 @@ static int ocfs2_get_request_ptr(struct
  1498.          * pointer bp stores the base address of a pointers array,
  1499.          * which collects all addresses of separate request.
  1500.          */
  1501. -       bp = (u64 __user *)(unsigned long)compat_ptr(info->oi_requests);
  1502. +       bp = compat_ptr(info->oi_requests);
  1503.  #else
  1504.         BUG();
  1505.  #endif
  1506.     } else
  1507. -       bp = (u64 __user *)(unsigned long)(info->oi_requests);
  1508. +       bp = (info->oi_requests);
  1509.  
  1510.     if (o2info_from_user(*req_addr, bp + idx))
  1511.         goto bail;
  1512. @@ -826,7 +826,7 @@ static int ocfs2_info_handle(struct inod
  1513.         if (status)
  1514.             break;
  1515.  
  1516. -       reqp = (struct ocfs2_info_request __user *)(unsigned long)req_addr;
  1517. +       reqp = req_addr;
  1518.         if (!reqp) {
  1519.             status = -EINVAL;
  1520.             goto bail;
  1521. @@ -913,8 +913,8 @@ long ocfs2_ioctl(struct file *filp, unsi
  1522.     case OCFS2_IOC_REFLINK:
  1523.         if (copy_from_user(&args, argp, sizeof(args)))
  1524.             return -EFAULT;
  1525. -       old_path = (const char __user *)(unsigned long)args.old_path;
  1526. -       new_path = (const char __user *)(unsigned long)args.new_path;
  1527. +       old_path = args.old_path;
  1528. +       new_path = args.new_path;
  1529.         preserve = (args.preserve != 0);
  1530.  
  1531.         return ocfs2_reflink_ioctl(inode, old_path, new_path, preserve);
  1532. diff -u -p a/virt/kvm/arm/vgic.c b/virt/kvm/arm/vgic.c
  1533. --- a/virt/kvm/arm/vgic.c
  1534. +++ b/virt/kvm/arm/vgic.c
  1535. @@ -1762,7 +1762,7 @@ int vgic_set_common_attr(struct kvm_devi
  1536.  
  1537.     switch (attr->group) {
  1538.     case KVM_DEV_ARM_VGIC_GRP_ADDR: {
  1539. -       u64 __user *uaddr = (u64 __user *)(long)attr->addr;
  1540. +       u64 __user *uaddr = attr->addr;
  1541.         u64 addr;
  1542.         unsigned long type = (unsigned long)attr->attr;
  1543.  
  1544. @@ -1773,7 +1773,7 @@ int vgic_set_common_attr(struct kvm_devi
  1545.         return (r == -ENODEV) ? -ENXIO : r;
  1546.     }
  1547.     case KVM_DEV_ARM_VGIC_GRP_NR_IRQS: {
  1548. -       u32 __user *uaddr = (u32 __user *)(long)attr->addr;
  1549. +       u32 __user *uaddr = attr->addr;
  1550.         u32 val;
  1551.         int ret = 0;
  1552.  
  1553. @@ -1821,7 +1821,7 @@ int vgic_get_common_attr(struct kvm_devi
  1554.  
  1555.     switch (attr->group) {
  1556.     case KVM_DEV_ARM_VGIC_GRP_ADDR: {
  1557. -       u64 __user *uaddr = (u64 __user *)(long)attr->addr;
  1558. +       u64 __user *uaddr = attr->addr;
  1559.         u64 addr;
  1560.         unsigned long type = (unsigned long)attr->attr;
  1561.  
  1562. @@ -1834,7 +1834,7 @@ int vgic_get_common_attr(struct kvm_devi
  1563.         break;
  1564.     }
  1565.     case KVM_DEV_ARM_VGIC_GRP_NR_IRQS: {
  1566. -       u32 __user *uaddr = (u32 __user *)(long)attr->addr;
  1567. +       u32 __user *uaddr = attr->addr;
  1568.  
  1569.         r = put_user(dev->kvm->arch.vgic.nr_irqs, uaddr);
  1570.         break;
  1571. diff -u -p a/scripts/dtc/libfdt/fdt_rw.c b/scripts/dtc/libfdt/fdt_rw.c
  1572. --- a/scripts/dtc/libfdt/fdt_rw.c
  1573. +++ b/scripts/dtc/libfdt/fdt_rw.c
  1574. @@ -256,7 +256,7 @@ int fdt_set_name(void *fdt, int nodeoffs
  1575.  
  1576.     FDT_RW_CHECK_HEADER(fdt);
  1577.  
  1578. -   namep = (char *)(uintptr_t)fdt_get_name(fdt, nodeoffset, &oldlen);
  1579. +   namep = fdt_get_name(fdt, nodeoffset, &oldlen);
  1580.     if (!namep)
  1581.         return oldlen;
  1582.  
  1583. @@ -460,7 +460,7 @@ int fdt_open_into(const void *fdt, void
  1584.     /* But if that overlaps with the old tree... */
  1585.     if (((tmp + newsize) > fdtstart) && (tmp < fdtend)) {
  1586.         /* Try right after the old tree instead */
  1587. -       tmp = (char *)(uintptr_t)fdtend;
  1588. +       tmp = fdtend;
  1589.         if ((tmp + newsize) > ((char *)buf + bufsize))
  1590.             return -FDT_ERR_NOSPACE;
  1591.     }
  1592. diff -u -p a/scripts/mod/modpost.c b/scripts/mod/modpost.c
  1593. --- a/scripts/mod/modpost.c
  1594. +++ b/scripts/mod/modpost.c
  1595. @@ -1499,7 +1499,7 @@ static int addend_arm_rel(struct elf_inf
  1596.     switch (r_typ) {
  1597.     case R_ARM_ABS32:
  1598.         /* From ARM ABI: (S + A) | T */
  1599. -       r->r_addend = (int)(long)
  1600. +       r->r_addend =
  1601.                   (elf->symtab_start + ELF_R_SYM(r->r_info));
  1602.         break;
  1603.     case R_ARM_PC24:
  1604. @@ -1509,7 +1509,7 @@ static int addend_arm_rel(struct elf_inf
  1605.     case R_ARM_THM_JUMP24:
  1606.     case R_ARM_THM_JUMP19:
  1607.         /* From ARM ABI: ((S + A) | T) - P */
  1608. -       r->r_addend = (int)(long)(elf->hdr +
  1609. +       r->r_addend = (elf->hdr +
  1610.                   sechdr->sh_offset +
  1611.                   (r->r_offset - sechdr->sh_addr));
  1612.         break;
  1613. diff -u -p a/kernel/cpu.c b/kernel/cpu.c
  1614. --- a/kernel/cpu.c
  1615. +++ b/kernel/cpu.c
  1616. @@ -347,7 +347,7 @@ static int __ref take_cpu_down(void *_pa
  1617.  static int __ref _cpu_down(unsigned int cpu, int tasks_frozen)
  1618.  {
  1619.     int err, nr_calls = 0;
  1620. -   void *hcpu = (void *)(long)cpu;
  1621. +   void *hcpu = cpu;
  1622.     unsigned long mod = tasks_frozen ? CPU_TASKS_FROZEN : 0;
  1623.     struct take_cpu_down_param tcd_param = {
  1624.         .mod = mod,
  1625. @@ -450,7 +450,7 @@ EXPORT_SYMBOL(cpu_down);
  1626.  static int _cpu_up(unsigned int cpu, int tasks_frozen)
  1627.  {
  1628.     int ret, nr_calls = 0;
  1629. -   void *hcpu = (void *)(long)cpu;
  1630. +   void *hcpu = cpu;
  1631.     unsigned long mod = tasks_frozen ? CPU_TASKS_FROZEN : 0;
  1632.     struct task_struct *idle;
  1633.  
  1634. diff -u -p a/kernel/smp.c b/kernel/smp.c
  1635. --- a/kernel/smp.c
  1636. +++ b/kernel/smp.c
  1637. @@ -88,7 +88,7 @@ static struct notifier_block hotplug_cfd
  1638.  
  1639.  void __init call_function_init(void)
  1640.  {
  1641. -   void *cpu = (void *)(long)smp_processor_id();
  1642. +   void *cpu = smp_processor_id();
  1643.     int i;
  1644.  
  1645.     for_each_possible_cpu(i)
  1646. diff -u -p a/kernel/irq/proc.c b/kernel/irq/proc.c
  1647. --- a/kernel/irq/proc.c
  1648. +++ b/kernel/irq/proc.c
  1649. @@ -91,7 +91,7 @@ static int irq_affinity_list_proc_show(s
  1650.  static ssize_t write_irq_affinity(int type, struct file *file,
  1651.         const char __user *buffer, size_t count, loff_t *pos)
  1652.  {
  1653. -   unsigned int irq = (int)(long)PDE_DATA(file_inode(file));
  1654. +   unsigned int irq = PDE_DATA(file_inode(file));
  1655.     cpumask_var_t new_value;
  1656.     int err;
  1657.  
  1658. diff -u -p a/drivers/net/wireless/iwlwifi/mvm/tx.c b/drivers/net/wireless/iwlwifi/mvm/tx.c
  1659. --- a/drivers/net/wireless/iwlwifi/mvm/tx.c
  1660. +++ b/drivers/net/wireless/iwlwifi/mvm/tx.c
  1661. @@ -685,7 +685,7 @@ static void iwl_mvm_rx_tx_cmd_single(str
  1662.             le16_to_cpu(tx_resp->wireless_media_time);
  1663.         BUILD_BUG_ON(ARRAY_SIZE(info->status.status_driver_data) < 1);
  1664.         info->status.status_driver_data[0] =
  1665. -               (void *)(uintptr_t)tx_resp->reduced_tpc;
  1666. +               tx_resp->reduced_tpc;
  1667.  
  1668.         ieee80211_tx_status(mvm->hw, skb);
  1669.     }
  1670. @@ -908,7 +908,7 @@ static void iwl_mvm_tx_info_from_ba_noti
  1671.     /* TODO: not accounted if the whole A-MPDU failed */
  1672.     info->status.tx_time = tid_data->tx_time;
  1673.     info->status.status_driver_data[0] =
  1674. -       (void *)(uintptr_t)tid_data->reduced_tpc;
  1675. +       tid_data->reduced_tpc;
  1676.  }
  1677.  
  1678.  int iwl_mvm_rx_ba_notif(struct iwl_mvm *mvm, struct iwl_rx_cmd_buffer *rxb,
  1679. diff -u -p a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c
  1680. --- a/drivers/net/wireless/ti/wlcore/main.c
  1681. +++ b/drivers/net/wireless/ti/wlcore/main.c
  1682. @@ -3186,7 +3186,7 @@ static void wl1271_op_configure_filter(s
  1683.                        unsigned int changed,
  1684.                        unsigned int *total, u64 multicast)
  1685.  {
  1686. -   struct wl1271_filter_params *fp = (void *)(unsigned long)multicast;
  1687. +   struct wl1271_filter_params *fp = multicast;
  1688.     struct wl1271 *wl = hw->priv;
  1689.     struct wl12xx_vif *wlvif;
  1690.  
  1691. diff -u -p a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
  1692. --- a/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
  1693. +++ b/drivers/staging/ft1000/ft1000-usb/ft1000_hw.c
  1694. @@ -1272,7 +1272,7 @@ static int ft1000_proc_drvmsg(struct ft1
  1695.         *pmsg++ = 0;
  1696.         *pmsg++ = htons(info->DSPInfoBlklen + 20 + info->DSPInfoBlklen);
  1697.         ppseudo_hdr =
  1698. -           (struct pseudo_hdr *)(u16 *)&info->DSPInfoBlk[2];
  1699. +           &info->DSPInfoBlk[2];
  1700.         ppseudo_hdr->length = htons(info->DSPInfoBlklen + 4
  1701.                         + info->DSPInfoBlklen);
  1702.         ppseudo_hdr->source = 0x10;
  1703. diff -u -p a/drivers/gpu/drm/nouveau/nvif/notify.c b/drivers/gpu/drm/nouveau/nvif/notify.c
  1704. --- a/drivers/gpu/drm/nouveau/nvif/notify.c
  1705. +++ b/drivers/gpu/drm/nouveau/nvif/notify.c
  1706. @@ -120,7 +120,7 @@ nvif_notify(const void *header, u32 leng
  1707.     if (length == sizeof(args->v0) && args->v0.version == 0) {
  1708.         if (WARN_ON(args->v0.route))
  1709.             return NVIF_NOTIFY_DROP;
  1710. -       notify = (void *)(unsigned long)args->v0.token;
  1711. +       notify = args->v0.token;
  1712.     }
  1713.  
  1714.     if (!WARN_ON(notify == NULL)) {
  1715. @@ -200,7 +200,7 @@ nvif_notify_init(struct nvif_object *obj
  1716.     args->req.version = 0;
  1717.     args->req.reply = notify->size;
  1718.     args->req.route = 0;
  1719. -   args->req.token = (unsigned long)(void *)notify;
  1720. +   args->req.token = notify;
  1721.  
  1722.     memcpy(args->req.data, data, size);
  1723.     ret = nvif_object_ioctl(object, args, sizeof(*args) + size, NULL);
  1724. diff -u -p a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
  1725. --- a/drivers/gpu/drm/drm_crtc.c
  1726. +++ b/drivers/gpu/drm/drm_crtc.c
  1727. @@ -1834,7 +1834,7 @@ int drm_mode_getresources(struct drm_dev
  1728.     /* FBs */
  1729.     if (card_res->count_fbs >= fb_count) {
  1730.         copied = 0;
  1731. -       fb_id = (uint32_t __user *)(unsigned long)card_res->fb_id_ptr;
  1732. +       fb_id = card_res->fb_id_ptr;
  1733.         list_for_each_entry(fb, &file_priv->fbs, filp_head) {
  1734.             if (put_user(fb->base.id, fb_id + copied)) {
  1735.                 mutex_unlock(&file_priv->fbs_lock);
  1736. @@ -1876,7 +1876,7 @@ int drm_mode_getresources(struct drm_dev
  1737.     /* CRTCs */
  1738.     if (card_res->count_crtcs >= crtc_count) {
  1739.         copied = 0;
  1740. -       crtc_id = (uint32_t __user *)(unsigned long)card_res->crtc_id_ptr;
  1741. +       crtc_id = card_res->crtc_id_ptr;
  1742.         if (!mode_group) {
  1743.             list_for_each_entry(crtc, &dev->mode_config.crtc_list,
  1744.                         head) {
  1745. @@ -1903,7 +1903,7 @@ int drm_mode_getresources(struct drm_dev
  1746.     /* Encoders */
  1747.     if (card_res->count_encoders >= encoder_count) {
  1748.         copied = 0;
  1749. -       encoder_id = (uint32_t __user *)(unsigned long)card_res->encoder_id_ptr;
  1750. +       encoder_id = card_res->encoder_id_ptr;
  1751.         if (!mode_group) {
  1752.             list_for_each_entry(encoder,
  1753.                         &dev->mode_config.encoder_list,
  1754. @@ -1934,7 +1934,7 @@ int drm_mode_getresources(struct drm_dev
  1755.     /* Connectors */
  1756.     if (card_res->count_connectors >= connector_count) {
  1757.         copied = 0;
  1758. -       connector_id = (uint32_t __user *)(unsigned long)card_res->connector_id_ptr;
  1759. +       connector_id = card_res->connector_id_ptr;
  1760.         if (!mode_group) {
  1761.             list_for_each_entry(connector,
  1762.                         &dev->mode_config.connector_list,
  1763. @@ -2160,7 +2160,7 @@ int drm_mode_getconnector(struct drm_dev
  1764.      */
  1765.     if ((out_resp->count_modes >= mode_count) && mode_count) {
  1766.         copied = 0;
  1767. -       mode_ptr = (struct drm_mode_modeinfo __user *)(unsigned long)out_resp->modes_ptr;
  1768. +       mode_ptr = out_resp->modes_ptr;
  1769.         list_for_each_entry(mode, &connector->modes, head) {
  1770.             if (!drm_mode_expose_to_userspace(mode, file_priv))
  1771.                 continue;
  1772. @@ -2185,7 +2185,7 @@ int drm_mode_getconnector(struct drm_dev
  1773.  
  1774.     if ((out_resp->count_encoders >= encoders_count) && encoders_count) {
  1775.         copied = 0;
  1776. -       encoder_ptr = (uint32_t __user *)(unsigned long)(out_resp->encoders_ptr);
  1777. +       encoder_ptr = (out_resp->encoders_ptr);
  1778.         for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++) {
  1779.             if (connector->encoder_ids[i] != 0) {
  1780.                 if (put_user(connector->encoder_ids[i],
  1781. @@ -2319,7 +2319,7 @@ int drm_mode_getplane_res(struct drm_dev
  1782.      */
  1783.     if (num_planes &&
  1784.         (plane_resp->count_planes >= num_planes)) {
  1785. -       plane_ptr = (uint32_t __user *)(unsigned long)plane_resp->plane_id_ptr;
  1786. +       plane_ptr = plane_resp->plane_id_ptr;
  1787.  
  1788.         /* Plane lists are invariant, no locking needed. */
  1789.         list_for_each_entry(plane, &config->plane_list, head) {
  1790. @@ -2390,7 +2390,7 @@ int drm_mode_getplane(struct drm_device
  1791.      */
  1792.     if (plane->format_count &&
  1793.         (plane_resp->count_format_types >= plane->format_count)) {
  1794. -       format_ptr = (uint32_t __user *)(unsigned long)plane_resp->format_type_ptr;
  1795. +       format_ptr = plane_resp->format_type_ptr;
  1796.         if (copy_to_user(format_ptr,
  1797.                  plane->format_types,
  1798.                  sizeof(uint32_t) * plane->format_count)) {
  1799. @@ -2813,7 +2813,7 @@ int drm_mode_setcrtc(struct drm_device *
  1800.         }
  1801.  
  1802.         for (i = 0; i < crtc_req->count_connectors; i++) {
  1803. -           set_connectors_ptr = (uint32_t __user *)(unsigned long)crtc_req->set_connectors_ptr;
  1804. +           set_connectors_ptr = crtc_req->set_connectors_ptr;
  1805.             if (get_user(out_id, &set_connectors_ptr[i])) {
  1806.                 ret = -EFAULT;
  1807.                 goto out;
  1808. @@ -3481,7 +3481,7 @@ int drm_mode_dirtyfb_ioctl(struct drm_de
  1809.         return -ENOENT;
  1810.  
  1811.     num_clips = r->num_clips;
  1812. -   clips_ptr = (struct drm_clip_rect __user *)(unsigned long)r->clips_ptr;
  1813. +   clips_ptr = r->clips_ptr;
  1814.  
  1815.     if (!num_clips != !clips_ptr) {
  1816.         ret = -EINVAL;
  1817. @@ -4096,7 +4096,7 @@ int drm_mode_getproperty_ioctl(struct dr
  1818.     out_resp->flags = property->flags;
  1819.  
  1820.     if ((out_resp->count_values >= value_count) && value_count) {
  1821. -       values_ptr = (uint64_t __user *)(unsigned long)out_resp->values_ptr;
  1822. +       values_ptr = out_resp->values_ptr;
  1823.         for (i = 0; i < value_count; i++) {
  1824.             if (copy_to_user(values_ptr + i, &property->values[i], sizeof(uint64_t))) {
  1825.                 ret = -EFAULT;
  1826. @@ -4110,7 +4110,7 @@ int drm_mode_getproperty_ioctl(struct dr
  1827.             drm_property_type_is(property, DRM_MODE_PROP_BITMASK)) {
  1828.         if ((out_resp->count_enum_blobs >= enum_count) && enum_count) {
  1829.             copied = 0;
  1830. -           enum_ptr = (struct drm_mode_property_enum __user *)(unsigned long)out_resp->enum_blob_ptr;
  1831. +           enum_ptr = out_resp->enum_blob_ptr;
  1832.             list_for_each_entry(prop_enum, &property->enum_list, head) {
  1833.  
  1834.                 if (copy_to_user(&enum_ptr[copied].value, &prop_enum->value, sizeof(uint64_t))) {
  1835. @@ -4213,7 +4213,7 @@ int drm_mode_getblob_ioctl(struct drm_de
  1836.     }
  1837.  
  1838.     if (out_resp->length == blob->length) {
  1839. -       blob_ptr = (void __user *)(unsigned long)out_resp->data;
  1840. +       blob_ptr = out_resp->data;
  1841.         if (copy_to_user(blob_ptr, blob->data, blob->length)) {
  1842.             ret = -EFAULT;
  1843.             goto done;
  1844. diff -u -p a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c
  1845. --- a/drivers/gpu/drm/drm_bufs.c
  1846. +++ b/drivers/gpu/drm/drm_bufs.c
  1847. @@ -403,7 +403,7 @@ int drm_legacy_addmap_ioctl(struct drm_d
  1848.         return err;
  1849.  
  1850.     /* avoid a warning on 64-bit, this casting isn't very nice, but the API is set so too late */
  1851. -   map->handle = (void *)(unsigned long)maplist->user_token;
  1852. +   map->handle = maplist->user_token;
  1853.  
  1854.     /*
  1855.      * It appears that there are no users of this value whatsoever --
  1856. diff -u -p a/drivers/s390/cio/eadm_sch.c b/drivers/s390/cio/eadm_sch.c
  1857. --- a/drivers/s390/cio/eadm_sch.c
  1858. +++ b/drivers/s390/cio/eadm_sch.c
  1859. @@ -68,7 +68,7 @@ static int eadm_subchannel_start(struct
  1860.  
  1861.     orb_init(orb);
  1862.     orb->eadm.aob = (u32)__pa(aob);
  1863. -   orb->eadm.intparm = (u32)(addr_t)sch;
  1864. +   orb->eadm.intparm = sch;
  1865.     orb->eadm.key = PAGE_DEFAULT_KEY >> 4;
  1866.  
  1867.     EADM_LOG(6, "start");
  1868. diff -u -p a/drivers/s390/block/dasd_fba.c b/drivers/s390/block/dasd_fba.c
  1869. --- a/drivers/s390/block/dasd_fba.c
  1870. +++ b/drivers/s390/block/dasd_fba.c
  1871. @@ -353,11 +353,11 @@ static struct dasd_ccw_req *dasd_fba_bui
  1872.             ccw->cmd_code = cmd;
  1873.             ccw->count = block->bp_block;
  1874.             if (idal_is_needed(dst, blksize)) {
  1875. -               ccw->cda = (__u32)(addr_t) idaws;
  1876. +               ccw->cda = idaws;
  1877.                 ccw->flags = CCW_FLAG_IDA;
  1878.                 idaws = idal_create_words(idaws, dst, blksize);
  1879.             } else {
  1880. -               ccw->cda = (__u32)(addr_t) dst;
  1881. +               ccw->cda = dst;
  1882.                 ccw->flags = 0;
  1883.             }
  1884.             ccw++;
  1885. diff -u -p a/drivers/s390/block/dasd_alias.c b/drivers/s390/block/dasd_alias.c
  1886. --- a/drivers/s390/block/dasd_alias.c
  1887. +++ b/drivers/s390/block/dasd_alias.c
  1888. @@ -438,7 +438,7 @@ static int read_unit_address_configurati
  1889.     ccw->cmd_code = DASD_ECKD_CCW_PSF;
  1890.     ccw->count = sizeof(struct dasd_psf_prssd_data);
  1891.     ccw->flags |= CCW_FLAG_CC;
  1892. -   ccw->cda = (__u32)(addr_t) prssdp;
  1893. +   ccw->cda = prssdp;
  1894.  
  1895.     /* Read Subsystem Data - feature codes */
  1896.     memset(lcu->uac, 0, sizeof(*(lcu->uac)));
  1897. @@ -446,7 +446,7 @@ static int read_unit_address_configurati
  1898.     ccw++;
  1899.     ccw->cmd_code = DASD_ECKD_CCW_RSSD;
  1900.     ccw->count = sizeof(*(lcu->uac));
  1901. -   ccw->cda = (__u32)(addr_t) lcu->uac;
  1902. +   ccw->cda = lcu->uac;
  1903.  
  1904.     cqr->buildclk = get_tod_clock();
  1905.     cqr->status = DASD_CQR_FILLED;
  1906. @@ -724,7 +724,7 @@ static int reset_summary_unit_check(stru
  1907.     ccw->cmd_code = DASD_ECKD_CCW_RSCK;
  1908.     ccw->flags = 0 ;
  1909.     ccw->count = 16;
  1910. -   ccw->cda = (__u32)(addr_t) cqr->data;
  1911. +   ccw->cda = cqr->data;
  1912.     ((char *)cqr->data)[0] = reason;
  1913.  
  1914.     clear_bit(DASD_CQR_FLAGS_USE_ERP, &cqr->flags);
  1915. diff -u -p a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
  1916. --- a/drivers/s390/block/dasd_eckd.c
  1917. +++ b/drivers/s390/block/dasd_eckd.c
  1918. @@ -862,7 +862,7 @@ static void dasd_eckd_fill_rcd_cqr(struc
  1919.     ccw = cqr->cpaddr;
  1920.     ccw->cmd_code = DASD_ECKD_CCW_RCD;
  1921.     ccw->flags = 0;
  1922. -   ccw->cda = (__u32)(addr_t)rcd_buffer;
  1923. +   ccw->cda = rcd_buffer;
  1924.     ccw->count = DASD_ECKD_RCD_DATA_SIZE;
  1925.     cqr->magic = DASD_ECKD_MAGIC;
  1926.  
  1927. @@ -1470,7 +1470,7 @@ static int dasd_eckd_read_features(struc
  1928.     ccw->cmd_code = DASD_ECKD_CCW_PSF;
  1929.     ccw->count = sizeof(struct dasd_psf_prssd_data);
  1930.     ccw->flags |= CCW_FLAG_CC;
  1931. -   ccw->cda = (__u32)(addr_t) prssdp;
  1932. +   ccw->cda = prssdp;
  1933.  
  1934.     /* Read Subsystem Data - feature codes */
  1935.     features = (struct dasd_rssd_features *) (prssdp + 1);
  1936. @@ -1479,7 +1479,7 @@ static int dasd_eckd_read_features(struc
  1937.     ccw++;
  1938.     ccw->cmd_code = DASD_ECKD_CCW_RSSD;
  1939.     ccw->count = sizeof(struct dasd_rssd_features);
  1940. -   ccw->cda = (__u32)(addr_t) features;
  1941. +   ccw->cda = features;
  1942.  
  1943.     cqr->buildclk = get_tod_clock();
  1944.     cqr->status = DASD_CQR_FILLED;
  1945. @@ -1525,7 +1525,7 @@ static struct dasd_ccw_req *dasd_eckd_bu
  1946.     }
  1947.     ccw = cqr->cpaddr;
  1948.     ccw->cmd_code = DASD_ECKD_CCW_PSF;
  1949. -   ccw->cda = (__u32)(addr_t)psf_ssc_data;
  1950. +   ccw->cda = psf_ssc_data;
  1951.     ccw->count = 66;
  1952.  
  1953.     cqr->startdev = device;
  1954. @@ -1859,7 +1859,7 @@ dasd_eckd_analysis_ccw(struct dasd_devic
  1955.         ccw->cmd_code = DASD_ECKD_CCW_READ_COUNT;
  1956.         ccw->flags = 0;
  1957.         ccw->count = 8;
  1958. -       ccw->cda = (__u32)(addr_t) count_data;
  1959. +       ccw->cda = count_data;
  1960.         ccw++;
  1961.         count_data++;
  1962.     }
  1963. @@ -1873,7 +1873,7 @@ dasd_eckd_analysis_ccw(struct dasd_devic
  1964.     ccw->cmd_code = DASD_ECKD_CCW_READ_COUNT;
  1965.     ccw->flags = 0;
  1966.     ccw->count = 8;
  1967. -   ccw->cda = (__u32)(addr_t) count_data;
  1968. +   ccw->cda = count_data;
  1969.  
  1970.     cqr->block = NULL;
  1971.     cqr->startdev = device;
  1972. @@ -2284,7 +2284,7 @@ dasd_eckd_build_format(struct dasd_devic
  1973.             ccw->cmd_code = DASD_ECKD_CCW_WRITE_RECORD_ZERO;
  1974.             ccw->flags = CCW_FLAG_SLI;
  1975.             ccw->count = 8;
  1976. -           ccw->cda = (__u32)(addr_t) ect;
  1977. +           ccw->cda = ect;
  1978.             ccw++;
  1979.         }
  1980.         if ((intensity & ~0x08) & 0x04) {   /* erase track */
  1981. @@ -2299,7 +2299,7 @@ dasd_eckd_build_format(struct dasd_devic
  1982.             ccw->cmd_code = DASD_ECKD_CCW_WRITE_CKD;
  1983.             ccw->flags = CCW_FLAG_SLI;
  1984.             ccw->count = 8;
  1985. -           ccw->cda = (__u32)(addr_t) ect;
  1986. +           ccw->cda = ect;
  1987.         } else {        /* write remaining records */
  1988.             for (i = 0; i < rpt; i++) {
  1989.                 ect = (struct eckd_count *) data;
  1990. @@ -2334,7 +2334,7 @@ dasd_eckd_build_format(struct dasd_devic
  1991.                         DASD_ECKD_CCW_WRITE_CKD_MT;
  1992.                 ccw->flags = CCW_FLAG_SLI;
  1993.                 ccw->count = 8;
  1994. -                   ccw->cda = (__u32)(addr_t) ect;
  1995. +                   ccw->cda = ect;
  1996.                     ccw++;
  1997.             }
  1998.         }
  1999. @@ -2730,11 +2730,11 @@ static struct dasd_ccw_req *dasd_eckd_bu
  2000.             ccw->cmd_code = rcmd;
  2001.             ccw->count = count;
  2002.             if (idal_is_needed(dst, blksize)) {
  2003. -               ccw->cda = (__u32)(addr_t) idaws;
  2004. +               ccw->cda = idaws;
  2005.                 ccw->flags = CCW_FLAG_IDA;
  2006.                 idaws = idal_create_words(idaws, dst, blksize);
  2007.             } else {
  2008. -               ccw->cda = (__u32)(addr_t) dst;
  2009. +               ccw->cda = dst;
  2010.                 ccw->flags = 0;
  2011.             }
  2012.             ccw++;
  2013. @@ -2864,7 +2864,7 @@ static struct dasd_ccw_req *dasd_eckd_bu
  2014.                 ccw[-1].flags |= CCW_FLAG_CC;
  2015.                 ccw->cmd_code = cmd;
  2016.                 ccw->count = len_to_track_end;
  2017. -               ccw->cda = (__u32)(addr_t)idaws;
  2018. +               ccw->cda = idaws;
  2019.                 ccw->flags = CCW_FLAG_IDA;
  2020.                 ccw++;
  2021.                 recid += count;
  2022. @@ -3408,7 +3408,7 @@ static struct dasd_ccw_req *dasd_raw_bui
  2023.         ccw->count = 57326;
  2024.         /* 64k map to one track */
  2025.         len_to_track_end = 65536 - start_padding_sectors * 512;
  2026. -       ccw->cda = (__u32)(addr_t)idaws;
  2027. +       ccw->cda = idaws;
  2028.         ccw->flags |= CCW_FLAG_IDA;
  2029.         ccw->flags |= CCW_FLAG_SLI;
  2030.         ccw++;
  2031. @@ -3427,7 +3427,7 @@ static struct dasd_ccw_req *dasd_raw_bui
  2032.             ccw->count = 57326;
  2033.             /* 64k map to one track */
  2034.             len_to_track_end = 65536;
  2035. -           ccw->cda = (__u32)(addr_t)idaws;
  2036. +           ccw->cda = idaws;
  2037.             ccw->flags |= CCW_FLAG_IDA;
  2038.             ccw->flags |= CCW_FLAG_SLI;
  2039.             ccw++;
  2040. @@ -3640,7 +3640,7 @@ dasd_eckd_release(struct dasd_device *de
  2041.     ccw->cmd_code = DASD_ECKD_CCW_RELEASE;
  2042.     ccw->flags |= CCW_FLAG_SLI;
  2043.     ccw->count = 32;
  2044. -   ccw->cda = (__u32)(addr_t) cqr->data;
  2045. +   ccw->cda = cqr->data;
  2046.     cqr->startdev = device;
  2047.     cqr->memdev = device;
  2048.     clear_bit(DASD_CQR_FLAGS_USE_ERP, &cqr->flags);
  2049. @@ -3695,7 +3695,7 @@ dasd_eckd_reserve(struct dasd_device *de
  2050.     ccw->cmd_code = DASD_ECKD_CCW_RESERVE;
  2051.     ccw->flags |= CCW_FLAG_SLI;
  2052.     ccw->count = 32;
  2053. -   ccw->cda = (__u32)(addr_t) cqr->data;
  2054. +   ccw->cda = cqr->data;
  2055.     cqr->startdev = device;
  2056.     cqr->memdev = device;
  2057.     clear_bit(DASD_CQR_FLAGS_USE_ERP, &cqr->flags);
  2058. @@ -3749,7 +3749,7 @@ dasd_eckd_steal_lock(struct dasd_device
  2059.     ccw->cmd_code = DASD_ECKD_CCW_SLCK;
  2060.     ccw->flags |= CCW_FLAG_SLI;
  2061.     ccw->count = 32;
  2062. -   ccw->cda = (__u32)(addr_t) cqr->data;
  2063. +   ccw->cda = cqr->data;
  2064.     cqr->startdev = device;
  2065.     cqr->memdev = device;
  2066.     clear_bit(DASD_CQR_FLAGS_USE_ERP, &cqr->flags);
  2067. @@ -3809,7 +3809,7 @@ static int dasd_eckd_snid(struct dasd_de
  2068.     ccw->cmd_code = DASD_ECKD_CCW_SNID;
  2069.     ccw->flags |= CCW_FLAG_SLI;
  2070.     ccw->count = 12;
  2071. -   ccw->cda = (__u32)(addr_t) cqr->data;
  2072. +   ccw->cda = cqr->data;
  2073.     cqr->startdev = device;
  2074.     cqr->memdev = device;
  2075.     clear_bit(DASD_CQR_FLAGS_USE_ERP, &cqr->flags);
  2076. @@ -3876,7 +3876,7 @@ dasd_eckd_performance(struct dasd_device
  2077.     ccw->cmd_code = DASD_ECKD_CCW_PSF;
  2078.     ccw->count = sizeof(struct dasd_psf_prssd_data);
  2079.     ccw->flags |= CCW_FLAG_CC;
  2080. -   ccw->cda = (__u32)(addr_t) prssdp;
  2081. +   ccw->cda = prssdp;
  2082.  
  2083.     /* Read Subsystem Data - Performance Statistics */
  2084.     stats = (struct dasd_rssd_perf_stats_t *) (prssdp + 1);
  2085. @@ -3885,7 +3885,7 @@ dasd_eckd_performance(struct dasd_device
  2086.     ccw++;
  2087.     ccw->cmd_code = DASD_ECKD_CCW_RSSD;
  2088.     ccw->count = sizeof(struct dasd_rssd_perf_stats_t);
  2089. -   ccw->cda = (__u32)(addr_t) stats;
  2090. +   ccw->cda = stats;
  2091.  
  2092.     cqr->buildclk = get_tod_clock();
  2093.     cqr->status = DASD_CQR_FILLED;
  2094. @@ -4023,7 +4023,7 @@ static int dasd_symm_io(struct dasd_devi
  2095.     ccw->cmd_code = DASD_ECKD_CCW_PSF;
  2096.     ccw->count = usrparm.psf_data_len;
  2097.     ccw->flags |= CCW_FLAG_CC;
  2098. -   ccw->cda = (__u32)(addr_t) psf_data;
  2099. +   ccw->cda = psf_data;
  2100.  
  2101.     ccw++;
  2102.  
  2103. @@ -4031,7 +4031,7 @@ static int dasd_symm_io(struct dasd_devi
  2104.     ccw->cmd_code = DASD_ECKD_CCW_RSSD;
  2105.     ccw->count = usrparm.rssd_result_len;
  2106.     ccw->flags = CCW_FLAG_SLI ;
  2107. -   ccw->cda = (__u32)(addr_t) rssd_result;
  2108. +   ccw->cda = rssd_result;
  2109.  
  2110.     rc = dasd_sleep_on(cqr);
  2111.     if (rc)
  2112. @@ -4218,7 +4218,7 @@ static void dasd_eckd_dump_sense_ccw(str
  2113.         /* scsw->cda is either valid or zero  */
  2114.         len = 0;
  2115.         from = ++to;
  2116. -       fail = (struct ccw1 *)(addr_t)
  2117. +       fail =
  2118.                 irb->scsw.cmd.cpa; /* failing CCW */
  2119.         if (from <  fail - 2) {
  2120.             from = fail - 2;     /* there is a gap - print header */
  2121. @@ -4549,7 +4549,7 @@ static int dasd_eckd_read_message_buffer
  2122.     ccw->count = sizeof(struct dasd_psf_prssd_data);
  2123.     ccw->flags |= CCW_FLAG_CC;
  2124.     ccw->flags |= CCW_FLAG_SLI;
  2125. -   ccw->cda = (__u32)(addr_t) prssdp;
  2126. +   ccw->cda = prssdp;
  2127.  
  2128.     /* Read Subsystem Data - message buffer */
  2129.     message_buf = (struct dasd_rssd_messages *) (prssdp + 1);
  2130. @@ -4559,7 +4559,7 @@ static int dasd_eckd_read_message_buffer
  2131.     ccw->cmd_code = DASD_ECKD_CCW_RSSD;
  2132.     ccw->count = sizeof(struct dasd_rssd_messages);
  2133.     ccw->flags |= CCW_FLAG_SLI;
  2134. -   ccw->cda = (__u32)(addr_t) message_buf;
  2135. +   ccw->cda = message_buf;
  2136.  
  2137.     cqr->buildclk = get_tod_clock();
  2138.     cqr->status = DASD_CQR_FILLED;
  2139. @@ -4613,7 +4613,7 @@ dasd_eckd_psf_cuir_response(struct dasd_
  2140.  
  2141.     ccw = cqr->cpaddr;
  2142.     ccw->cmd_code = DASD_ECKD_CCW_PSF;
  2143. -   ccw->cda = (__u32)(addr_t)psf_cuir;
  2144. +   ccw->cda = psf_cuir;
  2145.     ccw->count = sizeof(struct dasd_psf_cuir_response);
  2146.  
  2147.     cqr->startdev = device;
  2148. diff -u -p a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
  2149. --- a/drivers/mtd/mtdchar.c
  2150. +++ b/drivers/mtd/mtdchar.c
  2151. @@ -547,8 +547,8 @@ static int mtdchar_write_ioctl(struct mt
  2152.     if (copy_from_user(&req, argp, sizeof(req)))
  2153.         return -EFAULT;
  2154.  
  2155. -   usr_data = (const void __user *)(uintptr_t)req.usr_data;
  2156. -   usr_oob = (const void __user *)(uintptr_t)req.usr_oob;
  2157. +   usr_data = req.usr_data;
  2158. +   usr_oob = req.usr_oob;
  2159.     if (!access_ok(VERIFY_READ, usr_data, req.len) ||
  2160.         !access_ok(VERIFY_READ, usr_oob, req.ooblen))
  2161.         return -EFAULT;
  2162. diff -u -p a/drivers/mtd/maps/gpio-addr-flash.c b/drivers/mtd/maps/gpio-addr-flash.c
  2163. --- a/drivers/mtd/maps/gpio-addr-flash.c
  2164. +++ b/drivers/mtd/maps/gpio-addr-flash.c
  2165. @@ -226,7 +226,7 @@ static int gpio_flash_probe(struct platf
  2166.      * away their pointer types here to the known types (gpios->xxx).
  2167.      */
  2168.     state->gpio_count     = gpios->end;
  2169. -   state->gpio_addrs     = (void *)(unsigned long)gpios->start;
  2170. +   state->gpio_addrs     = gpios->start;
  2171.     state->gpio_values    = (void *)(state + 1);
  2172.     state->win_size       = resource_size(memory);
  2173.     memset(state->gpio_values, 0xff, arr_size);
  2174. diff -u -p a/drivers/infiniband/hw/amso1100/c2_cm.c b/drivers/infiniband/hw/amso1100/c2_cm.c
  2175. --- a/drivers/infiniband/hw/amso1100/c2_cm.c
  2176. +++ b/drivers/infiniband/hw/amso1100/c2_cm.c
  2177. @@ -159,12 +159,12 @@ int c2_llp_service_create(struct iw_cm_i
  2178.      * Build the WR
  2179.      */
  2180.     c2_wr_set_id(&wr, CCWR_EP_LISTEN_CREATE);
  2181. -   wr.hdr.context = (u64) (unsigned long) vq_req;
  2182. +   wr.hdr.context = vq_req;
  2183.     wr.rnic_handle = c2dev->adapter_handle;
  2184.     wr.local_addr = laddr->sin_addr.s_addr;
  2185.     wr.local_port = laddr->sin_port;
  2186.     wr.backlog = cpu_to_be32(backlog);
  2187. -   wr.user_context = (u64) (unsigned long) cm_id;
  2188. +   wr.user_context = cm_id;
  2189.  
  2190.     /*
  2191.      * Reference the request struct.  Dereferenced in the int handler.
  2192. @@ -191,7 +191,7 @@ int c2_llp_service_create(struct iw_cm_i
  2193.      * Process reply
  2194.      */
  2195.     reply =
  2196. -       (struct c2wr_ep_listen_create_rep *) (unsigned long) vq_req->reply_msg;
  2197. +       vq_req->reply_msg;
  2198.     if (!reply) {
  2199.         err = -ENOMEM;
  2200.         goto bail1;
  2201. @@ -203,7 +203,7 @@ int c2_llp_service_create(struct iw_cm_i
  2202.     /*
  2203.      * Keep the adapter handle. Used in subsequent destroy
  2204.      */
  2205. -   cm_id->provider_data = (void*)(unsigned long) reply->ep_handle;
  2206. +   cm_id->provider_data = reply->ep_handle;
  2207.  
  2208.     /*
  2209.      * free vq stuff
  2210. @@ -247,7 +247,7 @@ int c2_llp_service_destroy(struct iw_cm_
  2211.     c2_wr_set_id(&wr, CCWR_EP_LISTEN_DESTROY);
  2212.     wr.hdr.context = (unsigned long) vq_req;
  2213.     wr.rnic_handle = c2dev->adapter_handle;
  2214. -   wr.ep_handle = (u32)(unsigned long)cm_id->provider_data;
  2215. +   wr.ep_handle = cm_id->provider_data;
  2216.  
  2217.     /*
  2218.      * reference the request struct.  dereferenced in the int handler.
  2219. @@ -273,7 +273,7 @@ int c2_llp_service_destroy(struct iw_cm_
  2220.     /*
  2221.      * Process reply
  2222.      */
  2223. -   reply=(struct c2wr_ep_listen_destroy_rep *)(unsigned long)vq_req->reply_msg;
  2224. +   reply=vq_req->reply_msg;
  2225.     if (!reply) {
  2226.         err = -ENOMEM;
  2227.         goto bail0;
  2228. @@ -328,7 +328,7 @@ int c2_llp_accept(struct iw_cm_id *cm_id
  2229.     c2_wr_set_id(wr, CCWR_CR_ACCEPT);
  2230.     wr->hdr.context = (unsigned long) vq_req;
  2231.     wr->rnic_handle = c2dev->adapter_handle;
  2232. -   wr->ep_handle = (u32) (unsigned long) cm_id->provider_data;
  2233. +   wr->ep_handle = cm_id->provider_data;
  2234.     wr->qp_handle = qp->adapter_handle;
  2235.  
  2236.     /* Replace the cr_handle with the QP after accept */
  2237. @@ -367,7 +367,7 @@ int c2_llp_accept(struct iw_cm_id *cm_id
  2238.         goto bail1;
  2239.  
  2240.     /* Check that reply is present */
  2241. -   reply = (struct c2wr_cr_accept_rep *) (unsigned long) vq_req->reply_msg;
  2242. +   reply = vq_req->reply_msg;
  2243.     if (!reply) {
  2244.         err = -ENOMEM;
  2245.         goto bail1;
  2246. @@ -417,7 +417,7 @@ int c2_llp_reject(struct iw_cm_id *cm_id
  2247.     c2_wr_set_id(&wr, CCWR_CR_REJECT);
  2248.     wr.hdr.context = (unsigned long) vq_req;
  2249.     wr.rnic_handle = c2dev->adapter_handle;
  2250. -   wr.ep_handle = (u32) (unsigned long) cm_id->provider_data;
  2251. +   wr.ep_handle = cm_id->provider_data;
  2252.  
  2253.     /*
  2254.      * reference the request struct.  dereferenced in the int handler.
  2255. @@ -443,7 +443,7 @@ int c2_llp_reject(struct iw_cm_id *cm_id
  2256.     /*
  2257.      * Process reply
  2258.      */
  2259. -   reply = (struct c2wr_cr_reject_rep *) (unsigned long)
  2260. +   reply =
  2261.         vq_req->reply_msg;
  2262.     if (!reply) {
  2263.         err = -ENOMEM;
  2264. diff -u -p a/drivers/infiniband/hw/amso1100/c2_cq.c b/drivers/infiniband/hw/amso1100/c2_cq.c
  2265. --- a/drivers/infiniband/hw/amso1100/c2_cq.c
  2266. +++ b/drivers/infiniband/hw/amso1100/c2_cq.c
  2267. @@ -146,7 +146,7 @@ static inline int c2_poll_one(struct c2_
  2268.      * try pulling the next message
  2269.      */
  2270.     while ((qp =
  2271. -       (struct c2_qp *) (unsigned long) ce->qp_user_context) == NULL) {
  2272. +       ce->qp_user_context) == NULL) {
  2273.         c2_mq_free(&cq->mq);
  2274.         ce = c2_mq_consume(&cq->mq);
  2275.         if (!ce)
  2276. @@ -325,7 +325,7 @@ int c2_init_cq(struct c2_dev *c2dev, int
  2277.     wr.depth = cpu_to_be32(cq->mq.q_size);
  2278.     wr.shared_ht = cpu_to_be64(cq->mq.shared_dma);
  2279.     wr.msg_pool = cpu_to_be64(cq->mq.host_dma);
  2280. -   wr.user_context = (u64) (unsigned long) (cq);
  2281. +   wr.user_context = (cq);
  2282.  
  2283.     vq_req_get(c2dev, vq_req);
  2284.  
  2285. @@ -339,7 +339,7 @@ int c2_init_cq(struct c2_dev *c2dev, int
  2286.     if (err)
  2287.         goto bail2;
  2288.  
  2289. -   reply = (struct c2wr_cq_create_rep *) (unsigned long) (vq_req->reply_msg);
  2290. +   reply = (vq_req->reply_msg);
  2291.     if (!reply) {
  2292.         err = -ENOMEM;
  2293.         goto bail2;
  2294. @@ -426,7 +426,7 @@ void c2_free_cq(struct c2_dev *c2dev, st
  2295.     if (err)
  2296.         goto bail1;
  2297.  
  2298. -   reply = (struct c2wr_cq_destroy_rep *) (unsigned long) (vq_req->reply_msg);
  2299. +   reply = (vq_req->reply_msg);
  2300.     if (reply)
  2301.         vq_repbuf_free(c2dev, reply);
  2302.        bail1:
  2303. diff -u -p a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
  2304. --- a/drivers/infiniband/hw/nes/nes_cm.c
  2305. +++ b/drivers/infiniband/hw/nes/nes_cm.c
  2306. @@ -3281,7 +3281,7 @@ int nes_accept(struct iw_cm_id *cm_id, s
  2307.         nespd = nesqp->nespd;
  2308.         ibphysbuf.addr = nesqp->ietf_frame_pbase + mpa_frame_offset;
  2309.         ibphysbuf.size = buff_len;
  2310. -       tagged_offset = (u64)(unsigned long)*start_buff;
  2311. +       tagged_offset = *start_buff;
  2312.         ibmr = nesibdev->ibdev.reg_phys_mr((struct ib_pd *)nespd,
  2313.                            &ibphysbuf, 1,
  2314.                            IB_ACCESS_LOCAL_WRITE,
  2315. diff -u -p a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
  2316. --- a/drivers/infiniband/core/cm.c
  2317. +++ b/drivers/infiniband/core/cm.c
  2318. @@ -1166,7 +1166,7 @@ int ib_send_cm_req(struct ib_cm_id *cm_i
  2319.     cm_format_req(req_msg, cm_id_priv, param);
  2320.     cm_id_priv->tid = req_msg->hdr.tid;
  2321.     cm_id_priv->msg->timeout_ms = cm_id_priv->timeout_ms;
  2322. -   cm_id_priv->msg->context[1] = (void *) (unsigned long) IB_CM_REQ_SENT;
  2323. +   cm_id_priv->msg->context[1] = IB_CM_REQ_SENT;
  2324.  
  2325.     cm_id_priv->local_qpn = cm_req_get_local_qpn(req_msg);
  2326.     cm_id_priv->rq_psn = cm_req_get_starting_psn(req_msg);
  2327. @@ -1666,7 +1666,7 @@ int ib_send_cm_rep(struct ib_cm_id *cm_i
  2328.     rep_msg = (struct cm_rep_msg *) msg->mad;
  2329.     cm_format_rep(rep_msg, cm_id_priv, param);
  2330.     msg->timeout_ms = cm_id_priv->timeout_ms;
  2331. -   msg->context[1] = (void *) (unsigned long) IB_CM_REP_SENT;
  2332. +   msg->context[1] = IB_CM_REP_SENT;
  2333.  
  2334.     ret = ib_post_send_mad(msg, NULL);
  2335.     if (ret) {
  2336. @@ -2021,7 +2021,7 @@ int ib_send_cm_dreq(struct ib_cm_id *cm_
  2337.     cm_format_dreq((struct cm_dreq_msg *) msg->mad, cm_id_priv,
  2338.                private_data, private_data_len);
  2339.     msg->timeout_ms = cm_id_priv->timeout_ms;
  2340. -   msg->context[1] = (void *) (unsigned long) IB_CM_DREQ_SENT;
  2341. +   msg->context[1] = IB_CM_DREQ_SENT;
  2342.  
  2343.     ret = ib_post_send_mad(msg, NULL);
  2344.     if (ret) {
  2345. @@ -2557,7 +2557,7 @@ static int cm_mra_handler(struct cm_work
  2346.         goto out;
  2347.     }
  2348.  
  2349. -   cm_id_priv->msg->context[1] = (void *) (unsigned long)
  2350. +   cm_id_priv->msg->context[1] =
  2351.                       cm_id_priv->id.state;
  2352.     ret = atomic_inc_and_test(&cm_id_priv->work_count);
  2353.     if (!ret)
  2354. @@ -2642,7 +2642,7 @@ int ib_send_cm_lap(struct ib_cm_id *cm_i
  2355.     cm_format_lap((struct cm_lap_msg *) msg->mad, cm_id_priv,
  2356.               alternate_path, private_data, private_data_len);
  2357.     msg->timeout_ms = cm_id_priv->timeout_ms;
  2358. -   msg->context[1] = (void *) (unsigned long) IB_CM_ESTABLISHED;
  2359. +   msg->context[1] = IB_CM_ESTABLISHED;
  2360.  
  2361.     ret = ib_post_send_mad(msg, NULL);
  2362.     if (ret) {
  2363. @@ -2947,7 +2947,7 @@ int ib_send_cm_sidr_req(struct ib_cm_id
  2364.     cm_format_sidr_req((struct cm_sidr_req_msg *) msg->mad, cm_id_priv,
  2365.                param);
  2366.     msg->timeout_ms = cm_id_priv->timeout_ms;
  2367. -   msg->context[1] = (void *) (unsigned long) IB_CM_SIDR_REQ_SENT;
  2368. +   msg->context[1] = IB_CM_SIDR_REQ_SENT;
  2369.  
  2370.     spin_lock_irqsave(&cm_id_priv->lock, flags);
  2371.     if (cm_id->state == IB_CM_IDLE)
  2372. @@ -3165,7 +3165,7 @@ static void cm_process_send_error(struct
  2373.  
  2374.     /* Discard old sends or ones without a response. */
  2375.     spin_lock_irq(&cm_id_priv->lock);
  2376. -   state = (enum ib_cm_state) (unsigned long) msg->context[1];
  2377. +   state = msg->context[1];
  2378.     if (msg != cm_id_priv->msg || state != cm_id_priv->id.state)
  2379.         goto discard;
  2380.  
  2381. diff -u -p a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
  2382. --- a/drivers/infiniband/ulp/srp/ib_srp.c
  2383. +++ b/drivers/infiniband/ulp/srp/ib_srp.c
  2384. @@ -1852,7 +1852,7 @@ static void srp_handle_recv(struct srp_r
  2385.  {
  2386.     struct srp_target_port *target = ch->target;
  2387.     struct ib_device *dev = target->srp_host->srp_dev->dev;
  2388. -   struct srp_iu *iu = (struct srp_iu *) (uintptr_t) wc->wr_id;
  2389. +   struct srp_iu *iu = wc->wr_id;
  2390.     int res;
  2391.     u8 opcode;
  2392.  
  2393. @@ -1971,7 +1971,7 @@ static void srp_send_completion(struct i
  2394.  
  2395.     while (ib_poll_cq(cq, 1, &wc) > 0) {
  2396.         if (likely(wc.status == IB_WC_SUCCESS)) {
  2397. -           iu = (struct srp_iu *) (uintptr_t) wc.wr_id;
  2398. +           iu = wc.wr_id;
  2399.             list_add(&iu->list, &ch->free_tx);
  2400.         } else {
  2401.             srp_handle_qp_err(wc.wr_id, wc.status, true, ch);
  2402. diff -u -p a/drivers/isdn/sc/interrupt.c b/drivers/isdn/sc/interrupt.c
  2403. --- a/drivers/isdn/sc/interrupt.c
  2404. +++ b/drivers/isdn/sc/interrupt.c
  2405. @@ -29,7 +29,7 @@ irqreturn_t interrupt_handler(int dummy,
  2406.  
  2407.     RspMessage rcvmsg;
  2408.     int channel;
  2409. -   int card = (int)(unsigned long) card_inst;
  2410. +   int card = card_inst;
  2411.  
  2412.     if (!IS_VALID_CARD(card)) {
  2413.         pr_debug("Invalid param: %d is not a valid card id\n", card);
  2414. diff -u -p a/drivers/isdn/mISDN/layer2.c b/drivers/isdn/mISDN/layer2.c
  2415. --- a/drivers/isdn/mISDN/layer2.c
  2416. +++ b/drivers/isdn/mISDN/layer2.c
  2417. @@ -1356,7 +1356,7 @@ l2_got_tei(struct FsmInst *fi, int event
  2418.     struct layer2   *l2 = fi->userdata;
  2419.     u_int       info;
  2420.  
  2421. -   l2->tei = (signed char)(long)arg;
  2422. +   l2->tei = arg;
  2423.     set_channel_address(&l2->ch, l2->sapi, l2->tei);
  2424.     info = DL_INFO_L2_CONNECT;
  2425.     l2up_create(l2, DL_INFORMATION_IND, sizeof(info), &info);
  2426. diff -u -p a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c
  2427. --- a/drivers/isdn/hisax/hfc_pci.c
  2428. +++ b/drivers/isdn/hisax/hfc_pci.c
  2429. @@ -1693,7 +1693,7 @@ setup_hfcpci(struct IsdnCard *card)
  2430.         printk(KERN_WARNING "HFC-PCI: No IRQ for PCI card found\n");
  2431.         return (0);
  2432.     }
  2433. -   cs->hw.hfcpci.pci_io = (char *)(unsigned long)dev_hfcpci->resource[1].start;
  2434. +   cs->hw.hfcpci.pci_io = dev_hfcpci->resource[1].start;
  2435.     printk(KERN_INFO "HiSax: HFC-PCI card manufacturer: %s card name: %s\n", id_list[i].vendor_name, id_list[i].card_name);
  2436.  
  2437.     if (!cs->hw.hfcpci.pci_io) {
  2438. diff -u -p a/drivers/media/common/saa7146/saa7146_hlp.c b/drivers/media/common/saa7146/saa7146_hlp.c
  2439. --- a/drivers/media/common/saa7146/saa7146_hlp.c
  2440. +++ b/drivers/media/common/saa7146/saa7146_hlp.c
  2441. @@ -573,7 +573,7 @@ static void saa7146_set_position(struct
  2442.        FIXME: might not work on some 64-bit platforms, but see the FIXME
  2443.        in struct v4l2_framebuffer (videodev2.h) for that.
  2444.      */
  2445. -   u32 base = (u32)(unsigned long)vv->ov_fb.base;
  2446. +   u32 base = vv->ov_fb.base;
  2447.  
  2448.     struct  saa7146_video_dma vdma1;
  2449.  
  2450. diff -u -p a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c
  2451. --- a/drivers/scsi/megaraid/megaraid_mbox.c
  2452. +++ b/drivers/scsi/megaraid/megaraid_mbox.c
  2453. @@ -3658,7 +3658,7 @@ megaraid_mbox_mm_command(adapter_t *adap
  2454.     scb->dma_direction  = PCI_DMA_NONE;
  2455.  
  2456.     ccb     = (mbox_ccb_t *)scb->ccb;
  2457. -   mbox64      = (mbox64_t *)(unsigned long)kioc->cmdbuf;
  2458. +   mbox64      = kioc->cmdbuf;
  2459.     raw_mbox    = (uint8_t *)&mbox64->mbox32;
  2460.  
  2461.     memcpy(ccb->mbox64, mbox64, sizeof(mbox64_t));
  2462. @@ -3758,7 +3758,7 @@ megaraid_mbox_mm_done(adapter_t *adapter
  2463.     unsigned long       flags;
  2464.  
  2465.     kioc            = (uioc_t *)scb->gp;
  2466. -   mbox64          = (mbox64_t *)(unsigned long)kioc->cmdbuf;
  2467. +   mbox64          = kioc->cmdbuf;
  2468.     mbox64->mbox32.status   = scb->status;
  2469.     raw_mbox        = (uint8_t *)&mbox64->mbox32;
  2470.  
  2471. @@ -3973,7 +3973,7 @@ megaraid_sysfs_get_ldmap(adapter_t *adap
  2472.  
  2473.     mbox        = &mbox64->mbox32;
  2474.     raw_mbox    = (char *)mbox;
  2475. -   uioc->cmdbuf    = (uint64_t)(unsigned long)mbox64;
  2476. +   uioc->cmdbuf    = mbox64;
  2477.     uioc->buf_vaddr = (caddr_t)adapter;
  2478.     uioc->status    = -ENODATA;
  2479.     uioc->done  = megaraid_sysfs_get_ldmap_done;
  2480. diff -u -p a/drivers/scsi/aacraid/commctrl.c b/drivers/scsi/aacraid/commctrl.c
  2481. --- a/drivers/scsi/aacraid/commctrl.c
  2482. +++ b/drivers/scsi/aacraid/commctrl.c
  2483. @@ -615,7 +615,7 @@ static int aac_send_raw_srb(struct aac_d
  2484.                 }
  2485.                 addr = (u64)upsg->sg[i].addr[0];
  2486.                 addr += ((u64)upsg->sg[i].addr[1]) << 32;
  2487. -               sg_user[i] = (void __user *)(uintptr_t)addr;
  2488. +               sg_user[i] = addr;
  2489.                 sg_list[i] = p; // save so we can clean up later
  2490.                 sg_indx = i;
  2491.  
  2492. @@ -667,7 +667,7 @@ static int aac_send_raw_srb(struct aac_d
  2493.                     rcode = -ENOMEM;
  2494.                     goto cleanup;
  2495.                 }
  2496. -               sg_user[i] = (void __user *)(uintptr_t)usg->sg[i].addr;
  2497. +               sg_user[i] = usg->sg[i].addr;
  2498.                 sg_list[i] = p; // save so we can clean up later
  2499.                 sg_indx = i;
  2500.  
  2501. @@ -754,7 +754,7 @@ static int aac_send_raw_srb(struct aac_d
  2502.                     rcode = -ENOMEM;
  2503.                     goto cleanup;
  2504.                 }
  2505. -               sg_user[i] = (void __user *)(uintptr_t)upsg->sg[i].addr;
  2506. +               sg_user[i] = upsg->sg[i].addr;
  2507.                 sg_list[i] = p; // save so we can clean up later
  2508.                 sg_indx = i;
  2509.  
  2510. diff -u -p a/drivers/scsi/fnic/fnic_scsi.c b/drivers/scsi/fnic/fnic_scsi.c
  2511. --- a/drivers/scsi/fnic/fnic_scsi.c
  2512. +++ b/drivers/scsi/fnic/fnic_scsi.c
  2513. @@ -755,7 +755,7 @@ static inline void fnic_fcpio_ack_handle
  2514.     struct vnic_wq_copy *wq;
  2515.     u16 request_out = desc->u.ack.request_out;
  2516.     unsigned long flags;
  2517. -   u64 *ox_id_tag = (u64 *)(void *)desc;
  2518. +   u64 *ox_id_tag = desc;
  2519.  
  2520.     /* mark the ack state */
  2521.     wq = &fnic->wq_copy[cq_index - fnic->raw_wq_count - fnic->rq_count];
  2522. diff -u -p a/drivers/scsi/bfa/bfad_bsg.c b/drivers/scsi/bfa/bfad_bsg.c
  2523. --- a/drivers/scsi/bfa/bfad_bsg.c
  2524. +++ b/drivers/scsi/bfa/bfad_bsg.c
  2525. @@ -3198,7 +3198,7 @@ bfad_fcxp_get_req_sgaddr_cb(void *bfad_f
  2526.     u64 addr;
  2527.  
  2528.     sge = drv_fcxp->req_sge + sgeid;
  2529. -   addr = (u64)(size_t) sge->sg_addr;
  2530. +   addr = sge->sg_addr;
  2531.     return addr;
  2532.  }
  2533.  
  2534. @@ -3220,7 +3220,7 @@ bfad_fcxp_get_rsp_sgaddr_cb(void *bfad_f
  2535.     u64 addr;
  2536.  
  2537.     sge = drv_fcxp->rsp_sge + sgeid;
  2538. -   addr = (u64)(size_t) sge->sg_addr;
  2539. +   addr = sge->sg_addr;
  2540.     return addr;
  2541.  }
  2542.  
  2543. @@ -3281,7 +3281,7 @@ bfad_fcxp_map_sg(struct bfad_s *bfad, vo
  2544.      * Setup SG table
  2545.      */
  2546.     sg_table->sg_len = buf_info->size;
  2547. -   sg_table->sg_addr = (void *)(size_t) buf_info->phys;
  2548. +   sg_table->sg_addr = buf_info->phys;
  2549.  
  2550.     *num_sgles = sge_num;
  2551.  
  2552. diff -u -p a/drivers/scsi/qla4xxx/ql4_iocb.c b/drivers/scsi/qla4xxx/ql4_iocb.c
  2553. --- a/drivers/scsi/qla4xxx/ql4_iocb.c
  2554. +++ b/drivers/scsi/qla4xxx/ql4_iocb.c
  2555. @@ -356,7 +356,7 @@ int qla4xxx_send_command_to_isp(struct s
  2556.     qla4xxx_build_scsi_iocbs(srb, cmd_entry, tot_dsds);
  2557.     wmb();
  2558.  
  2559. -   srb->cmd->host_scribble = (unsigned char *)(unsigned long)index;
  2560. +   srb->cmd->host_scribble = index;
  2561.  
  2562.     /* update counters */
  2563.     srb->state = SRB_ACTIVE_STATE;
  2564. diff -u -p a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
  2565. --- a/drivers/scsi/storvsc_drv.c
  2566. +++ b/drivers/scsi/storvsc_drv.c
  2567. @@ -1231,8 +1231,7 @@ static void storvsc_on_channel_callback(
  2568.                        &bytes_recvd, &request_id);
  2569.         if (ret == 0 && bytes_recvd > 0) {
  2570.  
  2571. -           request = (struct storvsc_cmd_request *)
  2572. -                   (unsigned long)request_id;
  2573. +           request =request_id;
  2574.  
  2575.             if ((request == &stor_device->init_request) ||
  2576.                 (request == &stor_device->reset_request)) {
  2577. diff -u -p a/drivers/scsi/fcoe/fcoe_transport.c b/drivers/scsi/fcoe/fcoe_transport.c
  2578. --- a/drivers/scsi/fcoe/fcoe_transport.c
  2579. +++ b/drivers/scsi/fcoe/fcoe_transport.c
  2580. @@ -847,7 +847,7 @@ static int fcoe_transport_create(const c
  2581.     int rc = -ENODEV;
  2582.     struct net_device *netdev = NULL;
  2583.     struct fcoe_transport *ft = NULL;
  2584. -   enum fip_state fip_mode = (enum fip_state)(long)kp->arg;
  2585. +   enum fip_state fip_mode = kp->arg;
  2586.  
  2587.     mutex_lock(&ft_mutex);
  2588.  
  2589. diff -u -p a/drivers/firmware/efi/libstub/arm-stub.c b/drivers/firmware/efi/libstub/arm-stub.c
  2590. --- a/drivers/firmware/efi/libstub/arm-stub.c
  2591. +++ b/drivers/firmware/efi/libstub/arm-stub.c
  2592. @@ -49,7 +49,7 @@ efi_status_t efi_open_volume(efi_system_
  2593.     efi_file_handle_t *fh;
  2594.     efi_guid_t fs_proto = EFI_FILE_SYSTEM_GUID;
  2595.     efi_status_t status;
  2596. -   void *handle = (void *)(unsigned long)image->device_handle;
  2597. +   void *handle = image->device_handle;
  2598.  
  2599.     status = sys_table_arg->boottime->handle_protocol(handle,
  2600.                  &fs_proto, (void **)&io);
  2601. diff -u -p a/arch/arm/kvm/coproc.c b/arch/arm/kvm/coproc.c
  2602. --- a/arch/arm/kvm/coproc.c
  2603. +++ b/arch/arm/kvm/coproc.c
  2604. @@ -1010,7 +1010,7 @@ static int vfp_set_reg(struct kvm_vcpu *
  2605.  int kvm_arm_coproc_get_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
  2606.  {
  2607.     const struct coproc_reg *r;
  2608. -   void __user *uaddr = (void __user *)(long)reg->addr;
  2609. +   void __user *uaddr = reg->addr;
  2610.     int ret;
  2611.  
  2612.     if ((reg->id & KVM_REG_ARM_COPROC_MASK) == KVM_REG_ARM_DEMUX)
  2613. @@ -1039,7 +1039,7 @@ int kvm_arm_coproc_get_reg(struct kvm_vc
  2614.  int kvm_arm_coproc_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
  2615.  {
  2616.     const struct coproc_reg *r;
  2617. -   void __user *uaddr = (void __user *)(long)reg->addr;
  2618. +   void __user *uaddr = reg->addr;
  2619.     int ret;
  2620.  
  2621.     if ((reg->id & KVM_REG_ARM_COPROC_MASK) == KVM_REG_ARM_DEMUX)
  2622. diff -u -p a/arch/sparc/kernel/jump_label.c b/arch/sparc/kernel/jump_label.c
  2623. --- a/arch/sparc/kernel/jump_label.c
  2624. +++ b/arch/sparc/kernel/jump_label.c
  2625. @@ -14,7 +14,7 @@ void arch_jump_label_transform(struct ju
  2626.                    enum jump_label_type type)
  2627.  {
  2628.     u32 val;
  2629. -   u32 *insn = (u32 *) (unsigned long) entry->code;
  2630. +   u32 *insn = entry->code;
  2631.  
  2632.     if (type == JUMP_LABEL_ENABLE) {
  2633.         s32 off = (s32)entry->target - (s32)entry->code;
  2634. diff -u -p a/arch/s390/hypfs/hypfs_sprp.c b/arch/s390/hypfs/hypfs_sprp.c
  2635. --- a/arch/s390/hypfs/hypfs_sprp.c
  2636. +++ b/arch/s390/hypfs/hypfs_sprp.c
  2637. @@ -76,7 +76,7 @@ static int __hypfs_sprp_ioctl(void __use
  2638.     if (!data)
  2639.         return -ENOMEM;
  2640.  
  2641. -   udata = (void __user *)(unsigned long) diag304.data;
  2642. +   udata = diag304.data;
  2643.     if (diag304.args[1] == DIAG304_SET_WEIGHTS ||
  2644.         diag304.args[1] == DIAG304_SET_CAPPING)
  2645.         if (copy_from_user(data, udata, PAGE_SIZE)) {
  2646. diff -u -p a/arch/s390/kernel/compat_signal.c b/arch/s390/kernel/compat_signal.c
  2647. --- a/arch/s390/kernel/compat_signal.c
  2648. +++ b/arch/s390/kernel/compat_signal.c
  2649. @@ -408,7 +408,7 @@ static int setup_frame32(struct ksignal
  2650.  
  2651.     /* Create struct sigcontext32 on the signal stack */
  2652.     memcpy(&sc.oldmask, &set->sig, _SIGMASK_COPY_SIZE32);
  2653. -   sc.sregs = (__u32)(unsigned long __force) &frame->sregs;
  2654. +   sc.sregs = &frame->sregs;
  2655.     if (__copy_to_user(&frame->sc, &sc, sizeof(frame->sc)))
  2656.         return -EFAULT;
  2657.  
  2658. diff -u -p a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
  2659. --- a/arch/s390/kernel/smp.c
  2660. +++ b/arch/s390/kernel/smp.c
  2661. @@ -939,7 +939,7 @@ void __init smp_prepare_boot_cpu(void)
  2662.  
  2663.     pcpu->state = CPU_STATE_CONFIGURED;
  2664.     pcpu->address = stap();
  2665. -   pcpu->lowcore = (struct _lowcore *)(unsigned long) store_prefix();
  2666. +   pcpu->lowcore = store_prefix();
  2667.     S390_lowcore.percpu_offset = __per_cpu_offset[0];
  2668.     smp_cpu_set_polarization(0, POLARIZATION_UNKNOWN);
  2669.     set_cpu_present(0, true);
  2670. @@ -1078,7 +1078,7 @@ static struct attribute_group cpu_online
  2671.  static int smp_cpu_notify(struct notifier_block *self, unsigned long action,
  2672.               void *hcpu)
  2673.  {
  2674. -   unsigned int cpu = (unsigned int)(long)hcpu;
  2675. +   unsigned int cpu = hcpu;
  2676.     struct device *s = &per_cpu(cpu_device, cpu)->dev;
  2677.     int err = 0;
  2678.  
  2679. diff -u -p a/arch/mips/netlogic/xlr/platform.c b/arch/mips/netlogic/xlr/platform.c
  2680. --- a/arch/mips/netlogic/xlr/platform.c
  2681. +++ b/arch/mips/netlogic/xlr/platform.c
  2682. @@ -29,7 +29,7 @@ static unsigned int nlm_xlr_uart_in(stru
  2683.     unsigned int value;
  2684.  
  2685.     /* sign extend to 64 bits, if needed */
  2686. -   uartbase = (uint64_t)(long)p->membase;
  2687. +   uartbase = p->membase;
  2688.     value = nlm_read_reg(uartbase, offset);
  2689.  
  2690.     /* See XLR/XLS errata */
  2691. @@ -46,7 +46,7 @@ static void nlm_xlr_uart_out(struct uart
  2692.     uint64_t uartbase;
  2693.  
  2694.     /* sign extend to 64 bits, if needed */
  2695. -   uartbase = (uint64_t)(long)p->membase;
  2696. +   uartbase = p->membase;
  2697.  
  2698.     /* See XLR/XLS errata */
  2699.     if (offset == UART_MSR)
  2700. diff -u -p a/arch/mips/cavium-octeon/smp.c b/arch/mips/cavium-octeon/smp.c
  2701. --- a/arch/mips/cavium-octeon/smp.c
  2702. +++ b/arch/mips/cavium-octeon/smp.c
  2703. @@ -337,7 +337,7 @@ static int octeon_update_boot_vector(uns
  2704.     }
  2705.  
  2706.     boot_vect[coreid].app_start_func_addr =
  2707. -       (uint32_t) (unsigned long) start_after_reset;
  2708. +       start_after_reset;
  2709.     boot_vect[coreid].code_addr = octeon_bootloader_entry_addr;
  2710.  
  2711.     mb();
  2712. diff -u -p a/arch/arm64/kernel/signal32.c b/arch/arm64/kernel/signal32.c
  2713. --- a/arch/arm64/kernel/signal32.c
  2714. +++ b/arch/arm64/kernel/signal32.c
  2715. @@ -544,8 +544,8 @@ int compat_setup_rt_frame(int usig, stru
  2716.  
  2717.     if (err == 0) {
  2718.         compat_setup_return(regs, &ksig->ka, frame->sig.retcode, frame, usig);
  2719. -       regs->regs[1] = (compat_ulong_t)(unsigned long)&frame->info;
  2720. -       regs->regs[2] = (compat_ulong_t)(unsigned long)&frame->sig.uc;
  2721. +       regs->regs[1] = &frame->info;
  2722. +       regs->regs[2] = &frame->sig.uc;
  2723.     }
  2724.  
  2725.     return err;
  2726. diff -u -p a/arch/x86/kernel/tboot.c b/arch/x86/kernel/tboot.c
  2727. --- a/arch/x86/kernel/tboot.c
  2728. +++ b/arch/x86/kernel/tboot.c
  2729. @@ -243,7 +243,7 @@ void tboot_shutdown(u32 shutdown_type)
  2730.  
  2731.     switch_to_tboot_pt();
  2732.  
  2733. -   shutdown = (void(*)(void))(unsigned long)tboot->shutdown_entry;
  2734. +   shutdown = tboot->shutdown_entry;
  2735.     shutdown();
  2736.  
  2737.     /* should not reach here */
  2738. diff -u -p a/arch/x86/boot/compressed/aslr.c b/arch/x86/boot/compressed/aslr.c
  2739. --- a/arch/x86/boot/compressed/aslr.c
  2740. +++ b/arch/x86/boot/compressed/aslr.c
  2741. @@ -163,7 +163,7 @@ static void mem_avoid_init(unsigned long
  2742.     cmd_line  = (u64)real_mode->ext_cmd_line_ptr << 32;
  2743.     cmd_line |= real_mode->hdr.cmd_line_ptr;
  2744.     /* Calculate size of cmd_line. */
  2745. -   ptr = (char *)(unsigned long)cmd_line;
  2746. +   ptr = cmd_line;
  2747.     for (cmd_line_size = 0; ptr[cmd_line_size++]; )
  2748.         ;
  2749.     mem_avoid[2].start = cmd_line;
  2750. @@ -190,7 +190,7 @@ static bool mem_avoid_overlap(struct mem
  2751.     }
  2752.  
  2753.     /* Avoid all entries in the setup_data linked list. */
  2754. -   ptr = (struct setup_data *)(unsigned long)real_mode->hdr.setup_data;
  2755. +   ptr = real_mode->hdr.setup_data;
  2756.     while (ptr) {
  2757.         struct mem_vector avoid;
  2758.  
  2759. @@ -200,7 +200,7 @@ static bool mem_avoid_overlap(struct mem
  2760.         if (mem_overlaps(img, &avoid))
  2761.             return true;
  2762.  
  2763. -       ptr = (struct setup_data *)(unsigned long)ptr->next;
  2764. +       ptr = ptr->next;
  2765.     }
  2766.  
  2767.     return false;
  2768. diff -u -p a/arch/sh/kernel/signal_64.c b/arch/sh/kernel/signal_64.c
  2769. --- a/arch/sh/kernel/signal_64.c
  2770. +++ b/arch/sh/kernel/signal_64.c
  2771. @@ -255,7 +255,7 @@ asmlinkage int sys_sigreturn(unsigned lo
  2772.                    unsigned long r6, unsigned long r7,
  2773.                    struct pt_regs * regs)
  2774.  {
  2775. -   struct sigframe __user *frame = (struct sigframe __user *) (long) REF_REG_SP;
  2776. +   struct sigframe __user *frame = REF_REG_SP;
  2777.     sigset_t set;
  2778.     long long ret;
  2779.  
  2780. @@ -289,7 +289,7 @@ asmlinkage int sys_rt_sigreturn(unsigned
  2781.                 unsigned long r6, unsigned long r7,
  2782.                 struct pt_regs * regs)
  2783.  {
  2784. -   struct rt_sigframe __user *frame = (struct rt_sigframe __user *) (long) REF_REG_SP;
  2785. +   struct rt_sigframe __user *frame = REF_REG_SP;
  2786.     sigset_t set;
  2787.     long long ret;
  2788.  
  2789. @@ -452,8 +452,8 @@ static int setup_frame(struct ksignal *k
  2790.             through both 2nd and 3rd arguments.
  2791.          */
  2792.  
  2793. -   regs->regs[REG_ARG2] = (unsigned long long)(unsigned long)(signed long)&frame->sc;
  2794. -   regs->regs[REG_ARG3] = (unsigned long long)(unsigned long)(signed long)&frame->sc;
  2795. +   regs->regs[REG_ARG2] = (signed long)&frame->sc;
  2796. +   regs->regs[REG_ARG3] = (signed long)&frame->sc;
  2797.  
  2798.     regs->pc = neff_sign_extend((unsigned long)ksig->ka.sa.sa_handler);
  2799.  
  2800. @@ -543,8 +543,8 @@ static int setup_rt_frame(struct ksignal
  2801.      */
  2802.     regs->regs[REG_SP] = neff_sign_extend((unsigned long)frame);
  2803.     regs->regs[REG_ARG1] = signal; /* Arg for signal handler */
  2804. -   regs->regs[REG_ARG2] = (unsigned long long)(unsigned long)(signed long)&frame->info;
  2805. -   regs->regs[REG_ARG3] = (unsigned long long)(unsigned long)(signed long)&frame->uc.uc_mcontext;
  2806. +   regs->regs[REG_ARG2] = (signed long)&frame->info;
  2807. +   regs->regs[REG_ARG3] = (signed long)&frame->uc.uc_mcontext;
  2808.     regs->pc = neff_sign_extend((unsigned long)ksig->ka.sa.sa_handler);
  2809.  
  2810.     set_fs(USER_DS);
  2811. diff -u -p a/arch/sh/kernel/traps_64.c b/arch/sh/kernel/traps_64.c
  2812. --- a/arch/sh/kernel/traps_64.c
  2813. +++ b/arch/sh/kernel/traps_64.c
  2814. @@ -138,13 +138,13 @@ static void misaligned_kernel_word_load(
  2815.  {
  2816.     unsigned short x;
  2817.     unsigned char *p, *q;
  2818. -   p = (unsigned char *) (int) address;
  2819. +   p = address;
  2820.     q = (unsigned char *) &x;
  2821.     q[0] = p[0];
  2822.     q[1] = p[1];
  2823.  
  2824.     if (do_sign_extend) {
  2825. -       *result = (__u64)(__s64) *(short *) &x;
  2826. +       *result = *(short *) &x;
  2827.     } else {
  2828.         *result = (__u64) x;
  2829.     }
  2830. @@ -154,7 +154,7 @@ static void misaligned_kernel_word_store
  2831.  {
  2832.     unsigned short x;
  2833.     unsigned char *p, *q;
  2834. -   p = (unsigned char *) (int) address;
  2835. +   p = address;
  2836.     q = (unsigned char *) &x;
  2837.  
  2838.     x = (__u16) value;
  2839. @@ -192,13 +192,13 @@ static int misaligned_load(struct pt_reg
  2840.         switch (width_shift) {
  2841.         case 1:
  2842.             if (do_sign_extend) {
  2843. -               regs->regs[destreg] = (__u64)(__s64) *(__s16 *) &buffer;
  2844. +               regs->regs[destreg] = *(__s16 *) &buffer;
  2845.             } else {
  2846.                 regs->regs[destreg] = (__u64) *(__u16 *) &buffer;
  2847.             }
  2848.             break;
  2849.         case 2:
  2850. -           regs->regs[destreg] = (__u64)(__s64) *(__s32 *) &buffer;
  2851. +           regs->regs[destreg] = *(__s32 *) &buffer;
  2852.             break;
  2853.         case 3:
  2854.             regs->regs[destreg] = buffer;
  2855. diff -u -p a/net/sunrpc/xprtrdma/rpc_rdma.c b/net/sunrpc/xprtrdma/rpc_rdma.c
  2856. --- a/net/sunrpc/xprtrdma/rpc_rdma.c
  2857. +++ b/net/sunrpc/xprtrdma/rpc_rdma.c
  2858. @@ -100,7 +100,7 @@ rpcrdma_convert_iovs(struct xdr_buf *xdr
  2859.                 return -ENOMEM;
  2860.         }
  2861.         seg[n].mr_page = ppages[p];
  2862. -       seg[n].mr_offset = (void *)(unsigned long) page_base;
  2863. +       seg[n].mr_offset = page_base;
  2864.         seg[n].mr_len = min_t(u32, PAGE_SIZE - page_base, len);
  2865.         if (seg[n].mr_len > PAGE_SIZE)
  2866.             return -EIO;
  2867. diff -u -p a/net/tipc/socket.c b/net/tipc/socket.c
  2868. --- a/net/tipc/socket.c
  2869. +++ b/net/tipc/socket.c
  2870. @@ -1492,7 +1492,7 @@ restart:
  2871.  
  2872.     /* Capture message data (if valid) & compute return value (always) */
  2873.     if (!err) {
  2874. -       u32 offset = (u32)(unsigned long)(TIPC_SKB_CB(buf)->handle);
  2875. +       u32 offset = (TIPC_SKB_CB(buf)->handle);
  2876.  
  2877.         sz -= offset;
  2878.         needed = (buf_len - sz_copied);
  2879. @@ -1508,7 +1508,7 @@ restart:
  2880.         if (sz_to_copy < sz) {
  2881.             if (!(flags & MSG_PEEK))
  2882.                 TIPC_SKB_CB(buf)->handle =
  2883. -               (void *)(unsigned long)(offset + sz_to_copy);
  2884. +               (offset + sz_to_copy);
  2885.             goto exit;
  2886.         }
  2887.     } else {
  2888. diff -u -p a/net/core/netclassid_cgroup.c b/net/core/netclassid_cgroup.c
  2889. --- a/net/core/netclassid_cgroup.c
  2890. +++ b/net/core/netclassid_cgroup.c
  2891. @@ -61,7 +61,7 @@ static int update_classid(const void *v,
  2892.     struct socket *sock = sock_from_file(file, &err);
  2893.  
  2894.     if (sock)
  2895. -       sock->sk->sk_classid = (u32)(unsigned long)v;
  2896. +       sock->sk->sk_classid = v;
  2897.  
  2898.     return 0;
  2899.  }
  2900. @@ -70,7 +70,7 @@ static void cgrp_attach(struct cgroup_su
  2901.             struct cgroup_taskset *tset)
  2902.  {
  2903.     struct cgroup_cls_state *cs = css_cls_state(css);
  2904. -   void *v = (void *)(unsigned long)cs->classid;
  2905. +   void *v = cs->classid;
  2906.     struct task_struct *p;
  2907.  
  2908.     cgroup_taskset_for_each(p, tset) {
  2909. diff -u -p a/net/can/proc.c b/net/can/proc.c
  2910. --- a/net/can/proc.c
  2911. +++ b/net/can/proc.c
  2912. @@ -351,7 +351,7 @@ static inline void can_rcvlist_proc_show
  2913.  static int can_rcvlist_proc_show(struct seq_file *m, void *v)
  2914.  {
  2915.     /* double cast to prevent GCC warning */
  2916. -   int idx = (int)(long)m->private;
  2917. +   int idx = m->private;
  2918.     struct net_device *dev;
  2919.     struct dev_rcv_lists *d;
  2920.  
  2921. diff -u -p a/security/keys/big_key.c b/security/keys/big_key.c
  2922. --- a/security/keys/big_key.c
  2923. +++ b/security/keys/big_key.c
  2924. @@ -60,7 +60,7 @@ int big_key_preparse(struct key_preparse
  2925.     /* Set an arbitrary quota */
  2926.     prep->quotalen = 16;
  2927.  
  2928. -   prep->type_data[1] = (void *)(unsigned long)datalen;
  2929. +   prep->type_data[1] = datalen;
  2930.  
  2931.     if (datalen > BIG_KEY_FILE_THRESHOLD) {
  2932.         /* Create a shmem file to store the data in.  This will permit the data
  2933. diff -u -p a/fs/dlm/plock.c b/fs/dlm/plock.c
  2934. --- a/fs/dlm/plock.c
  2935. +++ b/fs/dlm/plock.c
  2936. @@ -95,7 +95,7 @@ static void do_unlock_close(struct dlm_l
  2937.     if (fl->fl_lmops && fl->fl_lmops->lm_grant)
  2938.         op->info.owner  = (__u64) fl->fl_pid;
  2939.     else
  2940. -       op->info.owner  = (__u64)(long) fl->fl_owner;
  2941. +       op->info.owner  = fl->fl_owner;
  2942.  
  2943.     op->info.flags |= DLM_PLOCK_FL_CLOSE;
  2944.     send_op(op);
  2945. @@ -138,7 +138,7 @@ int dlm_posix_lock(dlm_lockspace_t *lock
  2946.         xop->fl     = fl;
  2947.         xop->file   = file;
  2948.     } else {
  2949. -       op->info.owner  = (__u64)(long) fl->fl_owner;
  2950. +       op->info.owner  = fl->fl_owner;
  2951.         xop->callback   = NULL;
  2952.     }
  2953.  
  2954. @@ -281,7 +281,7 @@ int dlm_posix_unlock(dlm_lockspace_t *lo
  2955.     if (fl->fl_lmops && fl->fl_lmops->lm_grant)
  2956.         op->info.owner  = (__u64) fl->fl_pid;
  2957.     else
  2958. -       op->info.owner  = (__u64)(long) fl->fl_owner;
  2959. +       op->info.owner  = fl->fl_owner;
  2960.  
  2961.     if (fl->fl_flags & FL_CLOSE) {
  2962.         op->info.flags |= DLM_PLOCK_FL_CLOSE;
  2963. @@ -342,7 +342,7 @@ int dlm_posix_get(dlm_lockspace_t *locks
  2964.     if (fl->fl_lmops && fl->fl_lmops->lm_grant)
  2965.         op->info.owner  = (__u64) fl->fl_pid;
  2966.     else
  2967. -       op->info.owner  = (__u64)(long) fl->fl_owner;
  2968. +       op->info.owner  = fl->fl_owner;
  2969.  
  2970.     send_op(op);
  2971.     wait_event(recv_wq, (op->done != 0));
  2972. diff -u -p a/fs/affs/dir.c b/fs/affs/dir.c
  2973. --- a/fs/affs/dir.c
  2974. +++ b/fs/affs/dir.c
  2975. @@ -78,7 +78,7 @@ affs_readdir(struct file *file, struct d
  2976.     /* If the directory hasn't changed since the last call to readdir(),
  2977.      * we can jump directly to where we left off.
  2978.      */
  2979. -   ino = (u32)(long)file->private_data;
  2980. +   ino = file->private_data;
  2981.     if (ino && file->f_version == inode->i_version) {
  2982.         pr_debug("readdir() left off=%d\n", ino);
  2983.         goto inside;
  2984. @@ -130,7 +130,7 @@ inside:
  2985.     }
  2986.  done:
  2987.     file->f_version = inode->i_version;
  2988. -   file->private_data = (void *)(long)ino;
  2989. +   file->private_data = ino;
  2990.     affs_brelse(fh_bh);
  2991.  
  2992.  out_brelse_dir:
  2993. diff -u -p a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c
  2994. --- a/fs/nilfs2/ioctl.c
  2995. +++ b/fs/nilfs2/ioctl.c
  2996. @@ -64,7 +64,7 @@ static int nilfs_ioctl_wrap_copy(struct
  2997.                            void *, size_t, size_t))
  2998.  {
  2999.     void *buf;
  3000. -   void __user *base = (void __user *)(unsigned long)argv->v_base;
  3001. +   void __user *base = argv->v_base;
  3002.     size_t maxmembs, total, n;
  3003.     ssize_t nr;
  3004.     int ret, i;
  3005. @@ -932,7 +932,7 @@ static int nilfs_ioctl_clean_segments(st
  3006.             goto out_free;
  3007.  
  3008.         len = argv[n].v_size * argv[n].v_nmembs;
  3009. -       base = (void __user *)(unsigned long)argv[n].v_base;
  3010. +       base = argv[n].v_base;
  3011.         if (len == 0) {
  3012.             kbufs[n] = NULL;
  3013.             continue;
  3014. @@ -1265,7 +1265,7 @@ static int nilfs_ioctl_set_suinfo(struct
  3015.         goto out;
  3016.     }
  3017.  
  3018. -   base = (void __user *)(unsigned long)argv.v_base;
  3019. +   base = argv.v_base;
  3020.     kbuf = vmalloc(len);
  3021.     if (!kbuf) {
  3022.         ret = -ENOMEM;
  3023. diff -u -p a/fs/btrfs/backref.c b/fs/btrfs/backref.c
  3024. --- a/fs/btrfs/backref.c
  3025. +++ b/fs/btrfs/backref.c
  3026. @@ -441,8 +441,7 @@ static int __resolve_indirect_refs(struc
  3027.             }
  3028.             memcpy(new_ref, ref, sizeof(*ref));
  3029.             new_ref->parent = node->val;
  3030. -           new_ref->inode_list = (struct extent_inode_elem *)
  3031. -                           (uintptr_t)node->aux;
  3032. +           new_ref->inode_list =node->aux;
  3033.             list_add(&new_ref->list, &ref->list);
  3034.         }
  3035.         ulist_reinit(parents);
  3036. @@ -1096,7 +1095,7 @@ static void free_leaf_list(struct ulist
  3037.     while ((node = ulist_next(blocks, &uiter))) {
  3038.         if (!node->aux)
  3039.             continue;
  3040. -       eie = (struct extent_inode_elem *)(uintptr_t)node->aux;
  3041. +       eie = node->aux;
  3042.         free_inode_elem_list(eie);
  3043.         node->aux = 0;
  3044.     }
  3045. @@ -1871,7 +1870,7 @@ static int inode_to_path(u64 inum, u32 n
  3046.         return PTR_ERR(fspath);
  3047.  
  3048.     if (fspath > fspath_min) {
  3049. -       ipath->fspath->val[i] = (u64)(unsigned long)fspath;
  3050. +       ipath->fspath->val[i] = fspath;
  3051.         ++ipath->fspath->elem_cnt;
  3052.         ipath->fspath->bytes_left = fspath - fspath_min;
  3053.     } else {
  3054. diff -u -p a/fs/hfsplus/dir.c b/fs/hfsplus/dir.c
  3055. --- a/fs/hfsplus/dir.c
  3056. +++ b/fs/hfsplus/dir.c
  3057. @@ -22,7 +22,7 @@
  3058.  static inline void hfsplus_instantiate(struct dentry *dentry,
  3059.                        struct inode *inode, u32 cnid)
  3060.  {
  3061. -   dentry->d_fsdata = (void *)(unsigned long)cnid;
  3062. +   dentry->d_fsdata = cnid;
  3063.     d_instantiate(dentry, inode);
  3064.  }
  3065.  
  3066. @@ -66,7 +66,7 @@ again:
  3067.             goto fail;
  3068.         }
  3069.         cnid = be32_to_cpu(entry.folder.id);
  3070. -       dentry->d_fsdata = (void *)(unsigned long)cnid;
  3071. +       dentry->d_fsdata = cnid;
  3072.     } else if (type == HFSPLUS_FILE) {
  3073.         if (fd.entrylength < sizeof(struct hfsplus_cat_file)) {
  3074.             err = -EIO;
  3075. @@ -95,7 +95,7 @@ again:
  3076.                 cnid = (unsigned long)dentry->d_fsdata;
  3077.                 linkid = 0;
  3078.             } else {
  3079. -               dentry->d_fsdata = (void *)(unsigned long)cnid;
  3080. +               dentry->d_fsdata = cnid;
  3081.                 linkid =
  3082.                     be32_to_cpu(entry.file.permissions.dev);
  3083.                 str.len = sprintf(name, "iNode%d", linkid);
  3084. @@ -108,7 +108,7 @@ again:
  3085.                 goto again;
  3086.             }
  3087.         } else if (!dentry->d_fsdata)
  3088. -           dentry->d_fsdata = (void *)(unsigned long)cnid;
  3089. +           dentry->d_fsdata = cnid;
  3090.     } else {
  3091.         pr_err("invalid catalog entry type in lookup\n");
  3092.         err = -EIO;
  3093. @@ -325,7 +325,7 @@ static int hfsplus_link(struct dentry *s
  3094.         }
  3095.         HFSPLUS_I(inode)->linkid = id;
  3096.         cnid = sbi->next_cnid++;
  3097. -       src_dentry->d_fsdata = (void *)(unsigned long)cnid;
  3098. +       src_dentry->d_fsdata = cnid;
  3099.         res = hfsplus_create_cat(cnid, src_dir,
  3100.             &src_dentry->d_name, inode);
  3101.         if (res)
  3102. @@ -363,7 +363,7 @@ static int hfsplus_unlink(struct inode *
  3103.         return -EPERM;
  3104.  
  3105.     mutex_lock(&sbi->vh_mutex);
  3106. -   cnid = (u32)(unsigned long)dentry->d_fsdata;
  3107. +   cnid = dentry->d_fsdata;
  3108.     if (inode->i_ino == cnid &&
  3109.         atomic_read(&HFSPLUS_I(inode)->opencnt)) {
  3110.         str.name = name;
  3111. diff -u -p a/fs/xfs/xfs_extfree_item.c b/fs/xfs/xfs_extfree_item.c
  3112. --- a/fs/xfs/xfs_extfree_item.c
  3113. +++ b/fs/xfs/xfs_extfree_item.c
  3114. @@ -239,7 +239,7 @@ xfs_efi_init(
  3115.  
  3116.     xfs_log_item_init(mp, &efip->efi_item, XFS_LI_EFI, &xfs_efi_item_ops);
  3117.     efip->efi_format.efi_nextents = nextents;
  3118. -   efip->efi_format.efi_id = (__psint_t)(void*)efip;
  3119. +   efip->efi_format.efi_id = efip;
  3120.     atomic_set(&efip->efi_next_extent, 0);
  3121.     atomic_set(&efip->efi_refcount, 2);
  3122.  
  3123. diff -u -p a/virt/kvm/vfio.c b/virt/kvm/vfio.c
  3124. --- a/virt/kvm/vfio.c
  3125. +++ b/virt/kvm/vfio.c
  3126. @@ -115,7 +115,7 @@ static int kvm_vfio_set_group(struct kvm
  3127.     struct kvm_vfio *kv = dev->private;
  3128.     struct vfio_group *vfio_group;
  3129.     struct kvm_vfio_group *kvg;
  3130. -   int32_t __user *argp = (int32_t __user *)(unsigned long)arg;
  3131. +   int32_t __user *argp = arg;
  3132.     struct fd f;
  3133.     int32_t fd;
  3134.     int ret;
  3135. diff -u -p a/kernel/sched/core.c b/kernel/sched/core.c
  3136. --- a/kernel/sched/core.c
  3137. +++ b/kernel/sched/core.c
  3138. @@ -404,7 +404,7 @@ void hrtick_start(struct rq *rq, u64 del
  3139.  static int
  3140.  hotplug_hrtick(struct notifier_block *nfb, unsigned long action, void *hcpu)
  3141.  {
  3142. -   int cpu = (int)(long)hcpu;
  3143. +   int cpu = hcpu;
  3144.  
  3145.     switch (action) {
  3146.     case CPU_UP_CANCELED:
  3147. @@ -5354,7 +5354,7 @@ static int sched_cpu_inactive(struct not
  3148.  
  3149.  static int __init migration_init(void)
  3150.  {
  3151. -   void *cpu = (void *)(long)smp_processor_id();
  3152. +   void *cpu = smp_processor_id();
  3153.     int err;
  3154.  
  3155.     /* Initialize migration for the boot CPU */
  3156. diff -u -p a/drivers/net/ethernet/neterion/s2io.c b/drivers/net/ethernet/neterion/s2io.c
  3157. --- a/drivers/net/ethernet/neterion/s2io.c
  3158. +++ b/drivers/net/ethernet/neterion/s2io.c
  3159. @@ -2563,10 +2563,10 @@ static int fill_rx_buffers(struct s2io_n
  3160.  
  3161.             ba = &ring->ba[block_no][off];
  3162.             skb_reserve(skb, BUF0_LEN);
  3163. -           tmp = (u64)(unsigned long)skb->data;
  3164. +           tmp = skb->data;
  3165.             tmp += ALIGN_SIZE;
  3166.             tmp &= ~ALIGN_SIZE;
  3167. -           skb->data = (void *) (unsigned long)tmp;
  3168. +           skb->data = tmp;
  3169.             skb_reset_tail_pointer(skb);
  3170.  
  3171.             if (from_card_up) {
  3172. diff -u -p a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
  3173. --- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c
  3174. +++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
  3175. @@ -1604,7 +1604,7 @@ static void iwl_mvm_configure_filter(str
  3176.                      u64 multicast)
  3177.  {
  3178.     struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw);
  3179. -   struct iwl_mcast_filter_cmd *cmd = (void *)(unsigned long)multicast;
  3180. +   struct iwl_mcast_filter_cmd *cmd = multicast;
  3181.  
  3182.     mutex_lock(&mvm->mutex);
  3183.  
  3184. diff -u -p a/drivers/net/wireless/ti/wl1251/main.c b/drivers/net/wireless/ti/wl1251/main.c
  3185. --- a/drivers/net/wireless/ti/wl1251/main.c
  3186. +++ b/drivers/net/wireless/ti/wl1251/main.c
  3187. @@ -775,7 +775,7 @@ static void wl1251_op_configure_filter(s
  3188.                        unsigned int changed,
  3189.                        unsigned int *total, u64 multicast)
  3190.  {
  3191. -   struct wl1251_filter_params *fp = (void *)(unsigned long)multicast;
  3192. +   struct wl1251_filter_params *fp = multicast;
  3193.     struct wl1251 *wl = hw->priv;
  3194.     int ret;
  3195.  
  3196. diff -u -p a/drivers/regulator/pfuze100-regulator.c b/drivers/regulator/pfuze100-regulator.c
  3197. --- a/drivers/regulator/pfuze100-regulator.c
  3198. +++ b/drivers/regulator/pfuze100-regulator.c
  3199. @@ -535,7 +535,7 @@ static int pfuze100_regulator_probe(stru
  3200.             dev_err(&client->dev, "Error: No device match found\n");
  3201.             return -ENODEV;
  3202.         }
  3203. -       pfuze_chip->chip_id = (int)(long)match->data;
  3204. +       pfuze_chip->chip_id = match->data;
  3205.     } else if (id) {
  3206.         pfuze_chip->chip_id = id->driver_data;
  3207.     } else {
  3208. diff -u -p a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
  3209. --- a/drivers/vhost/vhost.c
  3210. +++ b/drivers/vhost/vhost.c
  3211. @@ -747,10 +747,10 @@ long vhost_vring_ioctl(struct vhost_dev
  3212.         }
  3213.  
  3214.         vq->log_used = !!(a.flags & (0x1 << VHOST_VRING_F_LOG));
  3215. -       vq->desc = (void __user *)(unsigned long)a.desc_user_addr;
  3216. -       vq->avail = (void __user *)(unsigned long)a.avail_user_addr;
  3217. +       vq->desc = a.desc_user_addr;
  3218. +       vq->avail = a.avail_user_addr;
  3219.         vq->log_addr = a.log_guest_addr;
  3220. -       vq->used = (void __user *)(unsigned long)a.used_user_addr;
  3221. +       vq->used = a.used_user_addr;
  3222.         break;
  3223.     case VHOST_SET_VRING_KICK:
  3224.         if (copy_from_user(&f, argp, sizeof f)) {
  3225. @@ -864,7 +864,7 @@ long vhost_dev_ioctl(struct vhost_dev *d
  3226.         }
  3227.         for (i = 0; i < d->nvqs; ++i) {
  3228.             struct vhost_virtqueue *vq;
  3229. -           void __user *base = (void __user *)(unsigned long)p;
  3230. +           void __user *base = p;
  3231.             vq = d->vqs[i];
  3232.             mutex_lock(&vq->mutex);
  3233.             /* If ring is inactive, will check when it's enabled. */
  3234. @@ -961,7 +961,7 @@ static int log_write(void __user *log_ba
  3235.         return 0;
  3236.     write_length += write_address % VHOST_PAGE_SIZE;
  3237.     for (;;) {
  3238. -       u64 base = (u64)(unsigned long)log_base;
  3239. +       u64 base = log_base;
  3240.         u64 log = base + write_page / 8;
  3241.         int bit = write_page % 8;
  3242.         if ((u64)(unsigned long)log != log)
  3243. @@ -1085,7 +1085,7 @@ static int translate_desc(struct vhost_v
  3244.         _iov = iov + ret;
  3245.         size = reg->memory_size - addr + reg->guest_phys_addr;
  3246.         _iov->iov_len = min((u64)len - s, size);
  3247. -       _iov->iov_base = (void __user *)(unsigned long)
  3248. +       _iov->iov_base =
  3249.             (reg->userspace_addr + addr - reg->guest_phys_addr);
  3250.         s += size;
  3251.         addr += size;
  3252. diff -u -p a/drivers/gpu/drm/drm_context.c b/drivers/gpu/drm/drm_context.c
  3253. --- a/drivers/gpu/drm/drm_context.c
  3254. +++ b/drivers/gpu/drm/drm_context.c
  3255. @@ -173,7 +173,7 @@ int drm_legacy_getsareactx(struct drm_de
  3256.     list_for_each_entry(_entry, &dev->maplist, head) {
  3257.         if (_entry->map == map) {
  3258.             request->handle =
  3259. -               (void *)(unsigned long)_entry->user_token;
  3260. +               _entry->user_token;
  3261.             break;
  3262.         }
  3263.     }
  3264. diff -u -p a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
  3265. --- a/drivers/gpu/drm/nouveau/nouveau_gem.c
  3266. +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
  3267. @@ -422,7 +422,7 @@ retry:
  3268.             }
  3269.         }
  3270.  
  3271. -       b->user_priv = (uint64_t)(unsigned long)nvbo;
  3272. +       b->user_priv = nvbo;
  3273.         nvbo->reserved_by = file_priv;
  3274.         nvbo->pbbo_index = i;
  3275.         if ((b->valid_domains & NOUVEAU_GEM_DOMAIN_VRAM) &&
  3276. @@ -462,7 +462,7 @@ validate_list(struct nouveau_channel *ch
  3277.  {
  3278.     struct nouveau_drm *drm = chan->drm;
  3279.     struct drm_nouveau_gem_pushbuf_bo __user *upbbo =
  3280. -               (void __force __user *)(uintptr_t)user_pbbo_ptr;
  3281. +               user_pbbo_ptr;
  3282.     struct nouveau_bo *nvbo;
  3283.     int ret, relocs = 0;
  3284.  
  3285. @@ -562,7 +562,7 @@ static inline void *
  3286.  u_memcpya(uint64_t user, unsigned nmemb, unsigned size)
  3287.  {
  3288.     void *mem;
  3289. -   void __user *userptr = (void __force __user *)(uintptr_t)user;
  3290. +   void __user *userptr = user;
  3291.  
  3292.     size *= nmemb;
  3293.  
  3294. @@ -614,7 +614,7 @@ nouveau_gem_pushbuf_reloc_apply(struct n
  3295.             ret = -EINVAL;
  3296.             break;
  3297.         }
  3298. -       nvbo = (void *)(unsigned long)bo[r->reloc_bo_index].user_priv;
  3299. +       nvbo = bo[r->reloc_bo_index].user_priv;
  3300.  
  3301.         if (unlikely(r->reloc_bo_offset + 4 >
  3302.                  nvbo->bo.mem.num_pages << PAGE_SHIFT)) {
  3303. @@ -758,7 +758,7 @@ nouveau_gem_ioctl_pushbuf(struct drm_dev
  3304.         }
  3305.  
  3306.         for (i = 0; i < req->nr_push; i++) {
  3307. -           struct nouveau_bo *nvbo = (void *)(unsigned long)
  3308. +           struct nouveau_bo *nvbo =
  3309.                 bo[push[i].bo_index].user_priv;
  3310.  
  3311.             nv50_dma_push(chan, nvbo, push[i].offset,
  3312. @@ -773,7 +773,7 @@ nouveau_gem_ioctl_pushbuf(struct drm_dev
  3313.         }
  3314.  
  3315.         for (i = 0; i < req->nr_push; i++) {
  3316. -           struct nouveau_bo *nvbo = (void *)(unsigned long)
  3317. +           struct nouveau_bo *nvbo =
  3318.                 bo[push[i].bo_index].user_priv;
  3319.  
  3320.             OUT_RING(chan, (nvbo->bo.offset + push[i].offset) | 2);
  3321. @@ -787,7 +787,7 @@ nouveau_gem_ioctl_pushbuf(struct drm_dev
  3322.         }
  3323.  
  3324.         for (i = 0; i < req->nr_push; i++) {
  3325. -           struct nouveau_bo *nvbo = (void *)(unsigned long)
  3326. +           struct nouveau_bo *nvbo =
  3327.                 bo[push[i].bo_index].user_priv;
  3328.             uint32_t cmd;
  3329.  
  3330. diff -u -p a/drivers/gpu/drm/nouveau/nouveau_usif.c b/drivers/gpu/drm/nouveau/nouveau_usif.c
  3331. --- a/drivers/gpu/drm/nouveau/nouveau_usif.c
  3332. +++ b/drivers/gpu/drm/nouveau/nouveau_usif.c
  3333. @@ -80,7 +80,7 @@ usif_notify(const void *header, u32 leng
  3334.     unsigned long flags;
  3335.  
  3336.     if (length == sizeof(rep->v0) && rep->v0.version == 0) {
  3337. -       if (WARN_ON(!(ntfy = (void *)(unsigned long)rep->v0.token)))
  3338. +       if (WARN_ON(!(ntfy = rep->v0.token)))
  3339.             return NVIF_NOTIFY_DROP;
  3340.         BUG_ON(rep->v0.route != NVDRM_NOTIFY_USIF);
  3341.     } else
  3342. @@ -147,7 +147,7 @@ usif_notify_new(struct drm_file *f, void
  3343.         ntfy->route = req->v0.route;
  3344.         ntfy->token = req->v0.token;
  3345.         req->v0.route = NVDRM_NOTIFY_USIF;
  3346. -       req->v0.token = (unsigned long)(void *)ntfy;
  3347. +       req->v0.token = ntfy;
  3348.         ret = nvif_client_ioctl(client, argv, argc);
  3349.         req->v0.token = ntfy->token;
  3350.         req->v0.route = ntfy->route;
  3351. @@ -279,7 +279,7 @@ usif_object_new(struct drm_file *f, void
  3352.         object->route = args->v0.route;
  3353.         object->token = args->v0.token;
  3354.         args->v0.route = NVDRM_OBJECT_USIF;
  3355. -       args->v0.token = (unsigned long)(void *)object;
  3356. +       args->v0.token = object;
  3357.         ret = nvif_client_ioctl(client, argv, argc);
  3358.         args->v0.token = object->token;
  3359.         args->v0.route = object->route;
  3360. @@ -340,7 +340,7 @@ usif_ioctl(struct drm_file *filp, void _
  3361.         break;
  3362.     }
  3363.     if (argv->v0.route == NVDRM_OBJECT_USIF) {
  3364. -       object = (void *)(unsigned long)argv->v0.token;
  3365. +       object = argv->v0.token;
  3366.         argv->v0.route = object->route;
  3367.         argv->v0.token = object->token;
  3368.         if (ret == 0 && argv->v0.type == NVIF_IOCTL_V0_DEL) {
  3369. diff -u -p a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
  3370. --- a/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
  3371. +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_surface.c
  3372. @@ -768,7 +768,7 @@ int vmw_surface_define_ioctl(struct drm_
  3373.         goto out_no_offsets;
  3374.     }
  3375.  
  3376. -   user_sizes = (struct drm_vmw_size __user *)(unsigned long)
  3377. +   user_sizes =
  3378.         req->size_addr;
  3379.  
  3380.     ret = copy_from_user(srf->sizes, user_sizes,
  3381. @@ -990,7 +990,7 @@ int vmw_surface_reference_ioctl(struct d
  3382.     rep->flags = srf->flags;
  3383.     rep->format = srf->format;
  3384.     memcpy(rep->mip_levels, srf->mip_levels, sizeof(srf->mip_levels));
  3385. -   user_sizes = (struct drm_vmw_size __user *)(unsigned long)
  3386. +   user_sizes =
  3387.         rep->size_addr;
  3388.  
  3389.     if (user_sizes)
  3390. diff -u -p a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
  3391. --- a/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
  3392. +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_ioctl.c
  3393. @@ -235,7 +235,7 @@ int vmw_present_ioctl(struct drm_device
  3394.     int ret;
  3395.  
  3396.     num_clips = arg->num_clips;
  3397. -   clips_ptr = (struct drm_vmw_rect *)(unsigned long)arg->clips_ptr;
  3398. +   clips_ptr = arg->clips_ptr;
  3399.  
  3400.     if (unlikely(num_clips == 0))
  3401.         return 0;
  3402. @@ -308,8 +308,7 @@ int vmw_present_readback_ioctl(struct dr
  3403.     struct drm_vmw_present_readback_arg *arg =
  3404.         (struct drm_vmw_present_readback_arg *)data;
  3405.     struct drm_vmw_fence_rep __user *user_fence_rep =
  3406. -       (struct drm_vmw_fence_rep __user *)
  3407. -       (unsigned long)arg->fence_rep;
  3408. +       arg->fence_rep;
  3409.     struct drm_vmw_rect __user *clips_ptr;
  3410.     struct drm_vmw_rect *clips = NULL;
  3411.     struct drm_framebuffer *fb;
  3412. @@ -318,7 +317,7 @@ int vmw_present_readback_ioctl(struct dr
  3413.     int ret;
  3414.  
  3415.     num_clips = arg->num_clips;
  3416. -   clips_ptr = (struct drm_vmw_rect *)(unsigned long)arg->clips_ptr;
  3417. +   clips_ptr = arg->clips_ptr;
  3418.  
  3419.     if (unlikely(num_clips == 0))
  3420.         return 0;
  3421. diff -u -p a/drivers/gpu/drm/r128/r128_cce.c b/drivers/gpu/drm/r128/r128_cce.c
  3422. --- a/drivers/gpu/drm/r128/r128_cce.c
  3423. +++ b/drivers/gpu/drm/r128/r128_cce.c
  3424. @@ -522,11 +522,11 @@ static int r128_do_init_cce(struct drm_d
  3425.  #endif
  3426.     {
  3427.         dev_priv->cce_ring->handle =
  3428. -           (void *)(unsigned long)dev_priv->cce_ring->offset;
  3429. +           dev_priv->cce_ring->offset;
  3430.         dev_priv->ring_rptr->handle =
  3431. -           (void *)(unsigned long)dev_priv->ring_rptr->offset;
  3432. +           dev_priv->ring_rptr->offset;
  3433.         dev->agp_buffer_map->handle =
  3434. -           (void *)(unsigned long)dev->agp_buffer_map->offset;
  3435. +           dev->agp_buffer_map->offset;
  3436.     }
  3437.  
  3438.  #if __OS_HAS_AGP
  3439. diff -u -p a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
  3440. --- a/drivers/gpu/drm/drm_atomic.c
  3441. +++ b/drivers/gpu/drm/drm_atomic.c
  3442. @@ -1183,10 +1183,10 @@ int drm_mode_atomic_ioctl(struct drm_dev
  3443.               void *data, struct drm_file *file_priv)
  3444.  {
  3445.     struct drm_mode_atomic *arg = data;
  3446. -   uint32_t __user *objs_ptr = (uint32_t __user *)(unsigned long)(arg->objs_ptr);
  3447. -   uint32_t __user *count_props_ptr = (uint32_t __user *)(unsigned long)(arg->count_props_ptr);
  3448. -   uint32_t __user *props_ptr = (uint32_t __user *)(unsigned long)(arg->props_ptr);
  3449. -   uint64_t __user *prop_values_ptr = (uint64_t __user *)(unsigned long)(arg->prop_values_ptr);
  3450. +   uint32_t __user *objs_ptr = (arg->objs_ptr);
  3451. +   uint32_t __user *count_props_ptr = (arg->count_props_ptr);
  3452. +   uint32_t __user *props_ptr = (arg->props_ptr);
  3453. +   uint64_t __user *prop_values_ptr = (arg->prop_values_ptr);
  3454.     unsigned int copied_objs, copied_props;
  3455.     struct drm_atomic_state *state;
  3456.     struct drm_modeset_acquire_ctx ctx;
  3457. diff -u -p a/drivers/android/binder.c b/drivers/android/binder.c
  3458. --- a/drivers/android/binder.c
  3459. +++ b/drivers/android/binder.c
  3460. @@ -1758,7 +1758,7 @@ static int binder_thread_write(struct bi
  3461.             binder_size_t *consumed)
  3462.  {
  3463.     uint32_t cmd;
  3464. -   void __user *buffer = (void __user *)(uintptr_t)binder_buffer;
  3465. +   void __user *buffer = binder_buffer;
  3466.     void __user *ptr = buffer + *consumed;
  3467.     void __user *end = buffer + size;
  3468.  
  3469. @@ -2144,7 +2144,7 @@ static int binder_thread_read(struct bin
  3470.                   binder_uintptr_t binder_buffer, size_t size,
  3471.                   binder_size_t *consumed, int non_block)
  3472.  {
  3473. -   void __user *buffer = (void __user *)(uintptr_t)binder_buffer;
  3474. +   void __user *buffer = binder_buffer;
  3475.     void __user *ptr = buffer + *consumed;
  3476.     void __user *end = buffer + size;
  3477.  
  3478. diff -u -p a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
  3479. --- a/drivers/s390/net/qeth_core_main.c
  3480. +++ b/drivers/s390/net/qeth_core_main.c
  3481. @@ -4751,7 +4751,7 @@ int qeth_query_oat_command(struct qeth_c
  3482.         if (is_compat_task())
  3483.             tmp = compat_ptr(oat_data.ptr);
  3484.         else
  3485. -           tmp = (void __user *)(unsigned long)oat_data.ptr;
  3486. +           tmp = oat_data.ptr;
  3487.  
  3488.         if (copy_to_user(tmp, priv.buffer,
  3489.             priv.response_len)) {
  3490. diff -u -p a/drivers/s390/char/vmur.c b/drivers/s390/char/vmur.c
  3491. --- a/drivers/s390/char/vmur.c
  3492. +++ b/drivers/s390/char/vmur.c
  3493. @@ -255,7 +255,7 @@ static struct ccw1 *alloc_chan_prog(cons
  3494.             free_chan_prog(cpa);
  3495.             return ERR_PTR(-ENOMEM);
  3496.         }
  3497. -       cpa[i].cda = (u32)(addr_t) kbuf;
  3498. +       cpa[i].cda = kbuf;
  3499.         if (copy_from_user(kbuf, ubuf, reclen)) {
  3500.             free_chan_prog(cpa);
  3501.             return ERR_PTR(-EFAULT);
  3502. diff -u -p a/drivers/s390/kvm/virtio_ccw.c b/drivers/s390/kvm/virtio_ccw.c
  3503. --- a/drivers/s390/kvm/virtio_ccw.c
  3504. +++ b/drivers/s390/kvm/virtio_ccw.c
  3505. @@ -338,7 +338,7 @@ static void virtio_ccw_drop_indicator(st
  3506.         thinint_area->isc = VIRTIO_AIRQ_ISC;
  3507.         ccw->cmd_code = CCW_CMD_SET_IND_ADAPTER;
  3508.         ccw->count = sizeof(*thinint_area);
  3509. -       ccw->cda = (__u32)(unsigned long) thinint_area;
  3510. +       ccw->cda = thinint_area;
  3511.     } else {
  3512.         indicatorp = kmalloc(sizeof(&vcdev->indicators),
  3513.                      GFP_DMA | GFP_KERNEL);
  3514. @@ -347,7 +347,7 @@ static void virtio_ccw_drop_indicator(st
  3515.         *indicatorp = 0;
  3516.         ccw->cmd_code = CCW_CMD_SET_IND;
  3517.         ccw->count = sizeof(vcdev->indicators);
  3518. -       ccw->cda = (__u32)(unsigned long) indicatorp;
  3519. +       ccw->cda = indicatorp;
  3520.     }
  3521.     /* Deregister indicators from host. */
  3522.     vcdev->indicators = 0;
  3523. @@ -403,7 +403,7 @@ static int virtio_ccw_read_vq_conf(struc
  3524.     ccw->cmd_code = CCW_CMD_READ_VQ_CONF;
  3525.     ccw->flags = 0;
  3526.     ccw->count = sizeof(struct vq_config_block);
  3527. -   ccw->cda = (__u32)(unsigned long)(vcdev->config_block);
  3528. +   ccw->cda = (vcdev->config_block);
  3529.     ccw_io_helper(vcdev, ccw, VIRTIO_CCW_DOING_READ_VQ_CONF);
  3530.     return vcdev->config_block->num;
  3531.  }
  3532. @@ -439,7 +439,7 @@ static void virtio_ccw_del_vq(struct vir
  3533.     }
  3534.     ccw->cmd_code = CCW_CMD_SET_VQ;
  3535.     ccw->flags = 0;
  3536. -   ccw->cda = (__u32)(unsigned long)(info->info_block);
  3537. +   ccw->cda = (info->info_block);
  3538.     ret = ccw_io_helper(vcdev, ccw,
  3539.                 VIRTIO_CCW_DOING_SET_VQ | index);
  3540.     /*
  3541. @@ -537,7 +537,7 @@ static struct virtqueue *virtio_ccw_setu
  3542.     }
  3543.     ccw->cmd_code = CCW_CMD_SET_VQ;
  3544.     ccw->flags = 0;
  3545. -   ccw->cda = (__u32)(unsigned long)(info->info_block);
  3546. +   ccw->cda = (info->info_block);
  3547.     err = ccw_io_helper(vcdev, ccw, VIRTIO_CCW_DOING_SET_VQ | i);
  3548.     if (err) {
  3549.         dev_warn(&vcdev->cdev->dev, "SET_VQ failed\n");
  3550. @@ -594,7 +594,7 @@ static int virtio_ccw_register_adapter_i
  3551.     ccw->cmd_code = CCW_CMD_SET_IND_ADAPTER;
  3552.     ccw->flags = CCW_FLAG_SLI;
  3553.     ccw->count = sizeof(*thinint_area);
  3554. -   ccw->cda = (__u32)(unsigned long)thinint_area;
  3555. +   ccw->cda = thinint_area;
  3556.     ret = ccw_io_helper(vcdev, ccw, VIRTIO_CCW_DOING_SET_IND_ADAPTER);
  3557.     if (ret) {
  3558.         if (ret == -EOPNOTSUPP) {
  3559. @@ -655,7 +655,7 @@ static int virtio_ccw_find_vqs(struct vi
  3560.         ccw->cmd_code = CCW_CMD_SET_IND;
  3561.         ccw->flags = 0;
  3562.         ccw->count = sizeof(vcdev->indicators);
  3563. -       ccw->cda = (__u32)(unsigned long) indicatorp;
  3564. +       ccw->cda = indicatorp;
  3565.         ret = ccw_io_helper(vcdev, ccw, VIRTIO_CCW_DOING_SET_IND);
  3566.         if (ret)
  3567.             goto out;
  3568. @@ -666,7 +666,7 @@ static int virtio_ccw_find_vqs(struct vi
  3569.     ccw->cmd_code = CCW_CMD_SET_CONF_IND;
  3570.     ccw->flags = 0;
  3571.     ccw->count = sizeof(vcdev->indicators2);
  3572. -   ccw->cda = (__u32)(unsigned long) indicatorp;
  3573. +   ccw->cda = indicatorp;
  3574.     ret = ccw_io_helper(vcdev, ccw, VIRTIO_CCW_DOING_SET_CONF_IND);
  3575.     if (ret)
  3576.         goto out;
  3577. @@ -724,7 +724,7 @@ static u64 virtio_ccw_get_features(struc
  3578.     ccw->cmd_code = CCW_CMD_READ_FEAT;
  3579.     ccw->flags = 0;
  3580.     ccw->count = sizeof(*features);
  3581. -   ccw->cda = (__u32)(unsigned long)features;
  3582. +   ccw->cda = features;
  3583.     ret = ccw_io_helper(vcdev, ccw, VIRTIO_CCW_DOING_READ_FEAT);
  3584.     if (ret) {
  3585.         rc = 0;
  3586. @@ -741,7 +741,7 @@ static u64 virtio_ccw_get_features(struc
  3587.     ccw->cmd_code = CCW_CMD_READ_FEAT;
  3588.     ccw->flags = 0;
  3589.     ccw->count = sizeof(*features);
  3590. -   ccw->cda = (__u32)(unsigned long)features;
  3591. +   ccw->cda = features;
  3592.     ret = ccw_io_helper(vcdev, ccw, VIRTIO_CCW_DOING_READ_FEAT);
  3593.     if (ret == 0)
  3594.         rc |= (u64)le32_to_cpu(features->features) << 32;
  3595. @@ -784,7 +784,7 @@ static int virtio_ccw_finalize_features(
  3596.     ccw->cmd_code = CCW_CMD_WRITE_FEAT;
  3597.     ccw->flags = 0;
  3598.     ccw->count = sizeof(*features);
  3599. -   ccw->cda = (__u32)(unsigned long)features;
  3600. +   ccw->cda = features;
  3601.     ret = ccw_io_helper(vcdev, ccw, VIRTIO_CCW_DOING_WRITE_FEAT);
  3602.     if (ret)
  3603.         goto out_free;
  3604. @@ -798,7 +798,7 @@ static int virtio_ccw_finalize_features(
  3605.     ccw->cmd_code = CCW_CMD_WRITE_FEAT;
  3606.     ccw->flags = 0;
  3607.     ccw->count = sizeof(*features);
  3608. -   ccw->cda = (__u32)(unsigned long)features;
  3609. +   ccw->cda = features;
  3610.     ret = ccw_io_helper(vcdev, ccw, VIRTIO_CCW_DOING_WRITE_FEAT);
  3611.  
  3612.  out_free:
  3613. @@ -828,7 +828,7 @@ static void virtio_ccw_get_config(struct
  3614.     ccw->cmd_code = CCW_CMD_READ_CONF;
  3615.     ccw->flags = 0;
  3616.     ccw->count = offset + len;
  3617. -   ccw->cda = (__u32)(unsigned long)config_area;
  3618. +   ccw->cda = config_area;
  3619.     ret = ccw_io_helper(vcdev, ccw, VIRTIO_CCW_DOING_READ_CONFIG);
  3620.     if (ret)
  3621.         goto out_free;
  3622. @@ -863,7 +863,7 @@ static void virtio_ccw_set_config(struct
  3623.     ccw->cmd_code = CCW_CMD_WRITE_CONF;
  3624.     ccw->flags = 0;
  3625.     ccw->count = offset + len;
  3626. -   ccw->cda = (__u32)(unsigned long)config_area;
  3627. +   ccw->cda = config_area;
  3628.     ccw_io_helper(vcdev, ccw, VIRTIO_CCW_DOING_WRITE_CONFIG);
  3629.  
  3630.  out_free:
  3631. @@ -894,7 +894,7 @@ static void virtio_ccw_set_status(struct
  3632.     ccw->cmd_code = CCW_CMD_WRITE_STATUS;
  3633.     ccw->flags = 0;
  3634.     ccw->count = sizeof(status);
  3635. -   ccw->cda = (__u32)(unsigned long)vcdev->status;
  3636. +   ccw->cda = vcdev->status;
  3637.     ret = ccw_io_helper(vcdev, ccw, VIRTIO_CCW_DOING_WRITE_STATUS);
  3638.     /* Write failed? We assume status is unchanged. */
  3639.     if (ret)
  3640. @@ -1134,7 +1134,7 @@ static int virtio_ccw_set_transport_rev(
  3641.     ccw->cmd_code = CCW_CMD_SET_VIRTIO_REV;
  3642.     ccw->flags = 0;
  3643.     ccw->count = sizeof(*rev);
  3644. -   ccw->cda = (__u32)(unsigned long)rev;
  3645. +   ccw->cda = rev;
  3646.  
  3647.     vcdev->revision = VIRTIO_CCW_REV_MAX;
  3648.     do {
  3649. diff -u -p a/drivers/virt/fsl_hypervisor.c b/drivers/virt/fsl_hypervisor.c
  3650. --- a/drivers/virt/fsl_hypervisor.c
  3651. +++ b/drivers/virt/fsl_hypervisor.c
  3652. @@ -343,9 +343,9 @@ static long ioctl_dtprop(struct fsl_hv_i
  3653.     if (copy_from_user(&param, p, sizeof(struct fsl_hv_ioctl_prop)))
  3654.         return -EFAULT;
  3655.  
  3656. -   upath = (char __user *)(uintptr_t)param.path;
  3657. -   upropname = (char __user *)(uintptr_t)param.propname;
  3658. -   upropval = (void __user *)(uintptr_t)param.propval;
  3659. +   upath = param.path;
  3660. +   upropname = param.propname;
  3661. +   upropval = param.propval;
  3662.  
  3663.     path = strndup_user(upath, FH_DTPROP_MAX_PATHLEN);
  3664.     if (IS_ERR(path)) {
  3665. diff -u -p a/drivers/infiniband/hw/qib/qib_srq.c b/drivers/infiniband/hw/qib/qib_srq.c
  3666. --- a/drivers/infiniband/hw/qib/qib_srq.c
  3667. +++ b/drivers/infiniband/hw/qib/qib_srq.c
  3668. @@ -248,7 +248,7 @@ int qib_modify_srq(struct ib_srq *ibsrq,
  3669.             if (ret)
  3670.                 goto bail_free;
  3671.             udata->outbuf =
  3672. -               (void __user *) (unsigned long) offset_addr;
  3673. +               offset_addr;
  3674.             ret = ib_copy_to_udata(udata, &offset,
  3675.                            sizeof(offset));
  3676.             if (ret)
  3677. diff -u -p a/drivers/infiniband/hw/amso1100/c2_qp.c b/drivers/infiniband/hw/amso1100/c2_qp.c
  3678. --- a/drivers/infiniband/hw/amso1100/c2_qp.c
  3679. +++ b/drivers/infiniband/hw/amso1100/c2_qp.c
  3680. @@ -214,7 +214,7 @@ int c2_qp_modify(struct c2_dev *c2dev, s
  3681.     if (err)
  3682.         goto bail0;
  3683.  
  3684. -   reply = (struct c2wr_qp_modify_rep *) (unsigned long) vq_req->reply_msg;
  3685. +   reply = vq_req->reply_msg;
  3686.     if (!reply) {
  3687.         err = -ENOMEM;
  3688.         goto bail0;
  3689. @@ -285,7 +285,7 @@ int c2_qp_set_read_limits(struct c2_dev
  3690.     if (err)
  3691.         goto bail0;
  3692.  
  3693. -   reply = (struct c2wr_qp_modify_rep *) (unsigned long)
  3694. +   reply =
  3695.         vq_req->reply_msg;
  3696.     if (!reply) {
  3697.         err = -ENOMEM;
  3698. @@ -359,7 +359,7 @@ static int destroy_qp(struct c2_dev *c2d
  3699.     /*
  3700.      * Process reply
  3701.      */
  3702. -   reply = (struct c2wr_qp_destroy_rep *) (unsigned long) (vq_req->reply_msg);
  3703. +   reply = (vq_req->reply_msg);
  3704.     if (!reply) {
  3705.         err = -ENOMEM;
  3706.         goto bail0;
  3707. @@ -492,7 +492,7 @@ int c2_alloc_qp(struct c2_dev *c2dev,
  3708.     }
  3709.  
  3710.     /* Process the reply */
  3711. -   reply = (struct c2wr_qp_create_rep *) (unsigned long) (vq_req->reply_msg);
  3712. +   reply = (vq_req->reply_msg);
  3713.     if (!reply) {
  3714.         err = -ENOMEM;
  3715.         goto bail3;
  3716. diff -u -p a/drivers/infiniband/hw/amso1100/c2_mm.c b/drivers/infiniband/hw/amso1100/c2_mm.c
  3717. --- a/drivers/infiniband/hw/amso1100/c2_mm.c
  3718. +++ b/drivers/infiniband/hw/amso1100/c2_mm.c
  3719. @@ -155,7 +155,7 @@ send_pbl_messages(struct c2_dev *c2dev,
  3720.     /*
  3721.      * Process reply
  3722.      */
  3723. -   reply = (struct c2wr_nsmr_pbl_rep *) (unsigned long) vq_req->reply_msg;
  3724. +   reply = vq_req->reply_msg;
  3725.     if (!reply) {
  3726.         err = -ENOMEM;
  3727.         goto bail0;
  3728. @@ -268,7 +268,7 @@ c2_nsmr_register_phys_kern(struct c2_dev
  3729.      * process reply
  3730.      */
  3731.     reply =
  3732. -       (struct c2wr_nsmr_register_rep *) (unsigned long) (vq_req->reply_msg);
  3733. +       (vq_req->reply_msg);
  3734.     if (!reply) {
  3735.         err = -ENOMEM;
  3736.         goto bail1;
  3737. @@ -333,7 +333,7 @@ int c2_stag_dealloc(struct c2_dev *c2dev
  3738.      * Build the WR
  3739.      */
  3740.     c2_wr_set_id(&wr, CCWR_STAG_DEALLOC);
  3741. -   wr.hdr.context = (u64) (unsigned long) vq_req;
  3742. +   wr.hdr.context = vq_req;
  3743.     wr.rnic_handle = c2dev->adapter_handle;
  3744.     wr.stag_index = cpu_to_be32(stag_index);
  3745.  
  3746. @@ -362,7 +362,7 @@ int c2_stag_dealloc(struct c2_dev *c2dev
  3747.     /*
  3748.      * Process reply
  3749.      */
  3750. -   reply = (struct c2wr_stag_dealloc_rep *) (unsigned long) vq_req->reply_msg;
  3751. +   reply = vq_req->reply_msg;
  3752.     if (!reply) {
  3753.         err = -ENOMEM;
  3754.         goto bail0;
  3755. diff -u -p a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
  3756. --- a/drivers/infiniband/hw/cxgb4/qp.c
  3757. +++ b/drivers/infiniband/hw/cxgb4/qp.c
  3758. @@ -373,7 +373,7 @@ static int build_immd(struct t4_sq *sq,
  3759.     for (i = 0; i < wr->num_sge; i++) {
  3760.         if ((plen + wr->sg_list[i].length) > max)
  3761.             return -EMSGSIZE;
  3762. -       srcp = (u8 *)(unsigned long)wr->sg_list[i].addr;
  3763. +       srcp = wr->sg_list[i].addr;
  3764.         plen += wr->sg_list[i].length;
  3765.         rem = wr->sg_list[i].length;
  3766.         while (rem) {
  3767. diff -u -p a/drivers/infiniband/hw/mlx5/cq.c b/drivers/infiniband/hw/mlx5/cq.c
  3768. --- a/drivers/infiniband/hw/mlx5/cq.c
  3769. +++ b/drivers/infiniband/hw/mlx5/cq.c
  3770. @@ -316,7 +316,7 @@ static void *mlx5_get_atomic_laddr(struc
  3771.     dpseg = mlx5_get_send_wqe(qp, idx) + sizeof(struct mlx5_wqe_ctrl_seg) +
  3772.         sizeof(struct mlx5_wqe_raddr_seg) +
  3773.         sizeof(struct mlx5_wqe_atomic_seg);
  3774. -   addr = (void *)(unsigned long)be64_to_cpu(dpseg->addr);
  3775. +   addr = be64_to_cpu(dpseg->addr);
  3776.     return addr;
  3777.  }
  3778.  
  3779. diff -u -p a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c
  3780. --- a/drivers/infiniband/hw/nes/nes_verbs.c
  3781. +++ b/drivers/infiniband/hw/nes/nes_verbs.c
  3782. @@ -1176,7 +1176,7 @@ static struct ib_qp *nes_create_qp(struc
  3783.             u64nesqp += ((u64)NES_SW_CONTEXT_ALIGN) - 1;
  3784.             u64temp = ((u64)NES_SW_CONTEXT_ALIGN) - 1;
  3785.             u64nesqp &= ~u64temp;
  3786. -           nesqp = (struct nes_qp *)(unsigned long)u64nesqp;
  3787. +           nesqp = u64nesqp;
  3788.             /* nes_debug(NES_DBG_QP, "nesqp=%p, allocated buffer=%p.  Rounded to closest %u\n",
  3789.                     nesqp, mem, NES_SW_CONTEXT_ALIGN); */
  3790.             nesqp->allocated_buffer = mem;
  3791. @@ -1729,7 +1729,7 @@ static struct ib_cq *nes_create_cq(struc
  3792.     }
  3793.     set_wqe_64bit_value(cqp_wqe->wqe_words, NES_CQP_CQ_WQE_PBL_LOW_IDX, u64temp);
  3794.     cqp_wqe->wqe_words[NES_CQP_CQ_WQE_CQ_CONTEXT_HIGH_IDX] = 0;
  3795. -   u64temp = (u64)(unsigned long)&nescq->hw_cq;
  3796. +   u64temp = &nescq->hw_cq;
  3797.     cqp_wqe->wqe_words[NES_CQP_CQ_WQE_CQ_CONTEXT_LOW_IDX] =
  3798.             cpu_to_le32((u32)(u64temp >> 1));
  3799.     cqp_wqe->wqe_words[NES_CQP_CQ_WQE_CQ_CONTEXT_HIGH_IDX] =
  3800. @@ -3675,7 +3675,7 @@ static int nes_poll_cq(struct ib_cq *ibc
  3801.                 ((u64)u32temp);
  3802.  
  3803.         if (u64temp) {
  3804. -           nesqp = (struct nes_qp *)(unsigned long)u64temp;
  3805. +           nesqp = u64temp;
  3806.             memset(entry, 0, sizeof *entry);
  3807.             if (cqe.cqe_words[NES_CQE_ERROR_CODE_IDX] == 0) {
  3808.                 entry->status = IB_WC_SUCCESS;
  3809. diff -u -p a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c
  3810. --- a/drivers/infiniband/core/mad.c
  3811. +++ b/drivers/infiniband/core/mad.c
  3812. @@ -1955,7 +1955,7 @@ static void ib_mad_recv_done_handler(str
  3813.     int port_num;
  3814.     int ret = IB_MAD_RESULT_SUCCESS;
  3815.  
  3816. -   mad_list = (struct ib_mad_list_head *)(unsigned long)wc->wr_id;
  3817. +   mad_list = wc->wr_id;
  3818.     qp_info = mad_list->mad_queue->qp_info;
  3819.     dequeue_mad(mad_list);
  3820.  
  3821. @@ -2209,7 +2209,7 @@ static void ib_mad_send_done_handler(str
  3822.     unsigned long flags;
  3823.     int ret;
  3824.  
  3825. -   mad_list = (struct ib_mad_list_head *)(unsigned long)wc->wr_id;
  3826. +   mad_list = wc->wr_id;
  3827.     mad_send_wr = container_of(mad_list, struct ib_mad_send_wr_private,
  3828.                    mad_list);
  3829.     send_queue = mad_list->mad_queue;
  3830. @@ -2283,7 +2283,7 @@ static void mad_error_handler(struct ib_
  3831.     int ret;
  3832.  
  3833.     /* Determine if failure was a send or receive */
  3834. -   mad_list = (struct ib_mad_list_head *)(unsigned long)wc->wr_id;
  3835. +   mad_list = wc->wr_id;
  3836.     qp_info = mad_list->mad_queue->qp_info;
  3837.     if (mad_list->mad_queue == &qp_info->recv_queue)
  3838.         /*
  3839. diff -u -p a/drivers/infiniband/ulp/isert/ib_isert.c b/drivers/infiniband/ulp/isert/ib_isert.c
  3840. --- a/drivers/infiniband/ulp/isert/ib_isert.c
  3841. +++ b/drivers/infiniband/ulp/isert/ib_isert.c
  3842. @@ -1994,7 +1994,7 @@ isert_cq_comp_err(struct isert_conn *ise
  3843.         struct isert_cmd *isert_cmd;
  3844.         struct iser_tx_desc *desc;
  3845.  
  3846. -       desc = (struct iser_tx_desc *)(uintptr_t)wc->wr_id;
  3847. +       desc = wc->wr_id;
  3848.         isert_cmd = desc->isert_cmd;
  3849.         if (!isert_cmd)
  3850.             isert_unmap_tx_desc(desc, ib_dev);
  3851. @@ -2017,10 +2017,10 @@ isert_handle_wc(struct ib_wc *wc)
  3852.     isert_conn = wc->qp->qp_context;
  3853.     if (likely(wc->status == IB_WC_SUCCESS)) {
  3854.         if (wc->opcode == IB_WC_RECV) {
  3855. -           rx_desc = (struct iser_rx_desc *)(uintptr_t)wc->wr_id;
  3856. +           rx_desc = wc->wr_id;
  3857.             isert_rx_completion(rx_desc, isert_conn, wc->byte_len);
  3858.         } else {
  3859. -           tx_desc = (struct iser_tx_desc *)(uintptr_t)wc->wr_id;
  3860. +           tx_desc = wc->wr_id;
  3861.             isert_send_completion(tx_desc, isert_conn);
  3862.         }
  3863.     } else {
  3864. diff -u -p a/drivers/sbus/char/jsflash.c b/drivers/sbus/char/jsflash.c
  3865. --- a/drivers/sbus/char/jsflash.c
  3866. +++ b/drivers/sbus/char/jsflash.c
  3867. @@ -371,7 +371,7 @@ static int jsf_ioctl_program(void __user
  3868.     togo = abuf.size;
  3869.     if ((togo & 3) || (p & 3)) return -EINVAL;
  3870.  
  3871. -   uptr = (char __user *) (unsigned long) abuf.data;
  3872. +   uptr = abuf.data;
  3873.     while (togo != 0) {
  3874.         togo -= 4;
  3875.         if (copy_from_user(&b.s[0], uptr, 4))
  3876. diff -u -p a/drivers/isdn/hardware/eicon/message.c b/drivers/isdn/hardware/eicon/message.c
  3877. --- a/drivers/isdn/hardware/eicon/message.c
  3878. +++ b/drivers/isdn/hardware/eicon/message.c
  3879. @@ -532,7 +532,7 @@ word api_put(APPL *appl, CAPI_MSG *msg)
  3880.                 if (m->header.command == _DATA_B3_R)
  3881.                 {
  3882.  
  3883. -                   m->info.data_b3_req.Data = (dword)(long)(TransmitBufferSet(appl, m->info.data_b3_req.Data));
  3884. +                   m->info.data_b3_req.Data = (TransmitBufferSet(appl, m->info.data_b3_req.Data));
  3885.  
  3886.                 }
  3887.  
  3888. @@ -3130,7 +3130,7 @@ static byte data_b3_req(dword Id, word N
  3889.                 && (((byte *)(parms[0].info)) < ((byte *)(plci->msg_in_queue)) + sizeof(plci->msg_in_queue)))
  3890.             {
  3891.  
  3892. -               data->P = (byte *)(long)(*((dword *)(parms[0].info)));
  3893. +               data->P = (*((dword *)(parms[0].info)));
  3894.  
  3895.             }
  3896.             else
  3897. diff -u -p a/drivers/video/fbdev/arkfb.c b/drivers/video/fbdev/arkfb.c
  3898. --- a/drivers/video/fbdev/arkfb.c
  3899. +++ b/drivers/video/fbdev/arkfb.c
  3900. @@ -1016,7 +1016,7 @@ static int ark_pci_probe(struct pci_dev
  3901.  
  3902.     pcibios_bus_to_resource(dev->bus, &vga_res, &bus_reg);
  3903.  
  3904. -   par->state.vgabase = (void __iomem *) (unsigned long) vga_res.start;
  3905. +   par->state.vgabase = vga_res.start;
  3906.  
  3907.     /* FIXME get memsize */
  3908.     regval = vga_rseq(par->state.vgabase, 0x10);
  3909. diff -u -p a/drivers/video/fbdev/vt8623fb.c b/drivers/video/fbdev/vt8623fb.c
  3910. --- a/drivers/video/fbdev/vt8623fb.c
  3911. +++ b/drivers/video/fbdev/vt8623fb.c
  3912. @@ -731,7 +731,7 @@ static int vt8623_pci_probe(struct pci_d
  3913.  
  3914.     pcibios_bus_to_resource(dev->bus, &vga_res, &bus_reg);
  3915.  
  3916. -   par->state.vgabase = (void __iomem *) (unsigned long) vga_res.start;
  3917. +   par->state.vgabase = vga_res.start;
  3918.  
  3919.     /* Find how many physical memory there is on card */
  3920.     memsize1 = (vga_rseq(par->state.vgabase, 0x34) + 1) >> 1;
  3921. diff -u -p a/drivers/block/floppy.c b/drivers/block/floppy.c
  3922. --- a/drivers/block/floppy.c
  3923. +++ b/drivers/block/floppy.c
  3924. @@ -4338,7 +4338,7 @@ static int __init do_floppy_init(void)
  3925.             goto out_remove_drives;
  3926.  
  3927.         /* to be cleaned up... */
  3928. -       disks[drive]->private_data = (void *)(long)drive;
  3929. +       disks[drive]->private_data = drive;
  3930.         disks[drive]->flags |= GENHD_FL_REMOVABLE;
  3931.         disks[drive]->driverfs_dev = &floppy_device[drive].dev;
  3932.         add_disk(disks[drive]);
  3933. diff -u -p a/drivers/misc/sgi-xp/xpc_sn2.c b/drivers/misc/sgi-xp/xpc_sn2.c
  3934. --- a/drivers/misc/sgi-xp/xpc_sn2.c
  3935. +++ b/drivers/misc/sgi-xp/xpc_sn2.c
  3936. @@ -304,7 +304,7 @@ xpc_check_for_sent_chctl_flags_sn2(struc
  3937.  static irqreturn_t
  3938.  xpc_handle_notify_IRQ_sn2(int irq, void *dev_id)
  3939.  {
  3940. -   short partid = (short)(u64)dev_id;
  3941. +   short partid = dev_id;
  3942.     struct xpc_partition *part = &xpc_partitions[partid];
  3943.  
  3944.     DBUG_ON(partid < 0 || partid >= XP_MAX_NPARTITIONS_SN2);
  3945. diff -u -p a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
  3946. --- a/drivers/atm/solos-pci.c
  3947. +++ b/drivers/atm/solos-pci.c
  3948. @@ -1375,7 +1375,7 @@ static int atm_init(struct solos_card *c
  3949.         card->atmdev[i]->ci_range.vpi_bits = 8;
  3950.         card->atmdev[i]->ci_range.vci_bits = 16;
  3951.         card->atmdev[i]->dev_data = card;
  3952. -       card->atmdev[i]->phy_data = (void *)(unsigned long)i;
  3953. +       card->atmdev[i]->phy_data = i;
  3954.         atm_dev_signal_change(card->atmdev[i], ATM_PHY_SIG_FOUND);
  3955.  
  3956.         skb = alloc_skb(sizeof(*header), GFP_KERNEL);
  3957. diff -u -p a/drivers/gpio/gpio-mcp23s08.c b/drivers/gpio/gpio-mcp23s08.c
  3958. --- a/drivers/gpio/gpio-mcp23s08.c
  3959. +++ b/drivers/gpio/gpio-mcp23s08.c
  3960. @@ -894,7 +894,7 @@ static int mcp23s08_probe(struct spi_dev
  3961.  
  3962.     match = of_match_device(of_match_ptr(mcp23s08_spi_of_match), &spi->dev);
  3963.     if (match) {
  3964. -       type = (int)(uintptr_t)match->data;
  3965. +       type = match->data;
  3966.         status = of_property_read_u32(spi->dev.of_node,
  3967.                 "microchip,spi-present-mask", &spi_present_mask);
  3968.         if (status) {
  3969. diff -u -p a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
  3970. --- a/drivers/scsi/qla1280.c
  3971. +++ b/drivers/scsi/qla1280.c
  3972. @@ -2847,7 +2847,7 @@ qla1280_64bit_start_scsi(struct scsi_qla
  3973.  
  3974.     ha->outstanding_cmds[cnt] = sp;
  3975.     ha->req_q_cnt -= req_cnt;
  3976. -   CMD_HANDLE(sp->cmd) = (unsigned char *)(unsigned long)(cnt + 1);
  3977. +   CMD_HANDLE(sp->cmd) = (cnt + 1);
  3978.  
  3979.     dprintk(2, "start: cmd=%p sp=%p CDB=%xm, handle %lx\n", cmd, sp,
  3980.         cmd->cmnd[0], (long)CMD_HANDLE(sp->cmd));
  3981. @@ -3120,7 +3120,7 @@ qla1280_32bit_start_scsi(struct scsi_qla
  3982.         goto out;
  3983.     }
  3984.  
  3985. -   CMD_HANDLE(sp->cmd) = (unsigned char *) (unsigned long)(cnt + 1);
  3986. +   CMD_HANDLE(sp->cmd) = (cnt + 1);
  3987.     ha->outstanding_cmds[cnt] = sp;
  3988.     ha->req_q_cnt -= req_cnt;
  3989.  
  3990. diff -u -p a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
  3991. --- a/drivers/scsi/ibmvscsi/ibmvfc.c
  3992. +++ b/drivers/scsi/ibmvscsi/ibmvfc.c
  3993. @@ -2841,7 +2841,7 @@ static int ibmvfc_slave_alloc(struct scs
  3994.         return -ENXIO;
  3995.  
  3996.     spin_lock_irqsave(shost->host_lock, flags);
  3997. -   sdev->hostdata = (void *)(unsigned long)vhost->task_set++;
  3998. +   sdev->hostdata = vhost->task_set++;
  3999.     spin_unlock_irqrestore(shost->host_lock, flags);
  4000.     return 0;
  4001.  }
  4002. @@ -2863,7 +2863,7 @@ static int ibmvfc_target_alloc(struct sc
  4003.     unsigned long flags = 0;
  4004.  
  4005.     spin_lock_irqsave(shost->host_lock, flags);
  4006. -   starget->hostdata = (void *)(unsigned long)vhost->task_set++;
  4007. +   starget->hostdata = vhost->task_set++;
  4008.     spin_unlock_irqrestore(shost->host_lock, flags);
  4009.     return 0;
  4010.  }
  4011. diff -u -p a/drivers/ata/pata_hpt3x2n.c b/drivers/ata/pata_hpt3x2n.c
  4012. --- a/drivers/ata/pata_hpt3x2n.c
  4013. +++ b/drivers/ata/pata_hpt3x2n.c
  4014. @@ -334,7 +334,7 @@ static unsigned int hpt3x2n_qc_issue(str
  4015.     if ((flags & USE_DPLL) != dpll) {
  4016.         flags &= ~USE_DPLL;
  4017.         flags |= dpll;
  4018. -       ap->host->private_data = (void *)(long)flags;
  4019. +       ap->host->private_data = flags;
  4020.  
  4021.         hpt3x2n_set_clock(ap, dpll ? 0x21 : 0x23);
  4022.     }
  4023. diff -u -p a/drivers/ata/libahci_platform.c b/drivers/ata/libahci_platform.c
  4024. --- a/drivers/ata/libahci_platform.c
  4025. +++ b/drivers/ata/libahci_platform.c
  4026. @@ -519,7 +519,7 @@ int ahci_platform_init_host(struct platf
  4027.     }
  4028.  
  4029.     /* prepare host */
  4030. -   pi.private_data = (void *)(unsigned long)hpriv->flags;
  4031. +   pi.private_data = hpriv->flags;
  4032.  
  4033.     ahci_save_initial_config(dev, hpriv);
  4034.  
  4035. diff -u -p a/drivers/i2c/busses/i2c-opal.c b/drivers/i2c/busses/i2c-opal.c
  4036. --- a/drivers/i2c/busses/i2c-opal.c
  4037. +++ b/drivers/i2c/busses/i2c-opal.c
  4038. @@ -231,7 +231,7 @@ static int i2c_opal_probe(struct platfor
  4039.         return -ENOMEM;
  4040.  
  4041.     adapter->algo = &i2c_opal_algo;
  4042. -   adapter->algo_data = (void *)(unsigned long)opal_id;
  4043. +   adapter->algo_data = opal_id;
  4044.     adapter->dev.parent = &pdev->dev;
  4045.     adapter->dev.of_node = of_node_get(pdev->dev.of_node);
  4046.     pname = of_get_property(pdev->dev.of_node, "ibm,port-name", NULL);
  4047. diff -u -p a/block/bsg.c b/block/bsg.c
  4048. --- a/block/bsg.c
  4049. +++ b/block/bsg.c
  4050. @@ -257,7 +257,7 @@ bsg_map_hdr(struct bsg_device *bd, struc
  4051.         rq->next_rq = next_rq;
  4052.         next_rq->cmd_type = rq->cmd_type;
  4053.  
  4054. -       dxferp = (void __user *)(unsigned long)hdr->din_xferp;
  4055. +       dxferp = hdr->din_xferp;
  4056.         ret =  blk_rq_map_user(q, next_rq, NULL, dxferp,
  4057.                        hdr->din_xfer_len, GFP_KERNEL);
  4058.         if (ret)
  4059. @@ -266,10 +266,10 @@ bsg_map_hdr(struct bsg_device *bd, struc
  4060.  
  4061.     if (hdr->dout_xfer_len) {
  4062.         dxfer_len = hdr->dout_xfer_len;
  4063. -       dxferp = (void __user *)(unsigned long)hdr->dout_xferp;
  4064. +       dxferp = hdr->dout_xferp;
  4065.     } else if (hdr->din_xfer_len) {
  4066.         dxfer_len = hdr->din_xfer_len;
  4067. -       dxferp = (void __user *)(unsigned long)hdr->din_xferp;
  4068. +       dxferp = hdr->din_xferp;
  4069.     } else
  4070.         dxfer_len = 0;
  4071.  
  4072. diff -u -p a/arch/arm/kernel/process.c b/arch/arm/kernel/process.c
  4073. --- a/arch/arm/kernel/process.c
  4074. +++ b/arch/arm/kernel/process.c
  4075. @@ -88,7 +88,7 @@ static void __soft_restart(void *addr)
  4076.     flush_cache_all();
  4077.  
  4078.     /* Switch to the identity mapping. */
  4079. -   phys_reset = (phys_reset_t)(unsigned long)virt_to_phys(cpu_reset);
  4080. +   phys_reset = virt_to_phys(cpu_reset);
  4081.     phys_reset((unsigned long)addr);
  4082.  
  4083.     /* Should never get here. */
  4084. diff -u -p a/arch/sparc/kernel/prom_irqtrans.c b/arch/sparc/kernel/prom_irqtrans.c
  4085. --- a/arch/sparc/kernel/prom_irqtrans.c
  4086. +++ b/arch/sparc/kernel/prom_irqtrans.c
  4087. @@ -112,7 +112,7 @@ struct sabre_irq_data {
  4088.   */
  4089.  static void sabre_wsync_handler(unsigned int ino, void *_arg1, void *_arg2)
  4090.  {
  4091. -   unsigned int phys_hi = (unsigned int) (unsigned long) _arg1;
  4092. +   unsigned int phys_hi = _arg1;
  4093.     struct sabre_irq_data *irq_data = _arg2;
  4094.     unsigned long controller_regs = irq_data->controller_regs;
  4095.     unsigned long sync_reg = controller_regs + SABRE_WRSYNC;
  4096. @@ -459,7 +459,7 @@ static unsigned int pci_sun4v_irq_build(
  4097.                     unsigned int devino,
  4098.                     void *_data)
  4099.  {
  4100. -   u32 devhandle = (u32) (unsigned long) _data;
  4101. +   u32 devhandle = _data;
  4102.  
  4103.     return sun4v_build_irq(devhandle, devino);
  4104.  }
  4105. @@ -472,7 +472,7 @@ static void __init pci_sun4v_irq_trans_i
  4106.     dp->irq_trans->irq_build = pci_sun4v_irq_build;
  4107.  
  4108.     regs = of_get_property(dp, "reg", NULL);
  4109. -   dp->irq_trans->data = (void *) (unsigned long)
  4110. +   dp->irq_trans->data =
  4111.         ((regs->phys_addr >> 32UL) & 0x0fffffff);
  4112.  }
  4113.  
  4114. @@ -709,7 +709,7 @@ static void __init sbus_irq_trans_init(s
  4115.     dp->irq_trans->irq_build = sbus_of_build_irq;
  4116.  
  4117.     regs = of_get_property(dp, "reg", NULL);
  4118. -   dp->irq_trans->data = (void *) (unsigned long) regs->phys_addr;
  4119. +   dp->irq_trans->data = regs->phys_addr;
  4120.  }
  4121.  #endif /* CONFIG_SBUS */
  4122.  
  4123. @@ -783,7 +783,7 @@ static unsigned int sun4v_vdev_irq_build
  4124.                      unsigned int devino,
  4125.                      void *_data)
  4126.  {
  4127. -   u32 devhandle = (u32) (unsigned long) _data;
  4128. +   u32 devhandle = _data;
  4129.  
  4130.     return sun4v_build_irq(devhandle, devino);
  4131.  }
  4132. @@ -796,7 +796,7 @@ static void __init sun4v_vdev_irq_trans_
  4133.     dp->irq_trans->irq_build = sun4v_vdev_irq_build;
  4134.  
  4135.     regs = of_get_property(dp, "reg", NULL);
  4136. -   dp->irq_trans->data = (void *) (unsigned long)
  4137. +   dp->irq_trans->data =
  4138.         ((regs->phys_addr >> 32UL) & 0x0fffffff);
  4139.  }
  4140.  
  4141. diff -u -p a/arch/sparc/kernel/sun4m_irq.c b/arch/sparc/kernel/sun4m_irq.c
  4142. --- a/arch/sparc/kernel/sun4m_irq.c
  4143. +++ b/arch/sparc/kernel/sun4m_irq.c
  4144. @@ -373,11 +373,9 @@ static void __init sun4m_init_timers(voi
  4145.  
  4146.     num_cpu_timers = (len / sizeof(u32)) - 1;
  4147.     for (i = 0; i < num_cpu_timers; i++) {
  4148. -       timers_percpu[i] = (void __iomem *)
  4149. -           (unsigned long) addr[i];
  4150. +       timers_percpu[i] = addr[i];
  4151.     }
  4152. -   timers_global = (void __iomem *)
  4153. -       (unsigned long) addr[num_cpu_timers];
  4154. +   timers_global = addr[num_cpu_timers];
  4155.  
  4156.     /* Every per-cpu timer works in timer mode */
  4157.     sbus_writel(0x00000000, &timers_global->timer_config);
  4158. @@ -449,11 +447,9 @@ void __init sun4m_init_IRQ(void)
  4159.  
  4160.     num_cpu_iregs = (len / sizeof(u32)) - 1;
  4161.     for (i = 0; i < num_cpu_iregs; i++) {
  4162. -       sun4m_irq_percpu[i] = (void __iomem *)
  4163. -           (unsigned long) addr[i];
  4164. +       sun4m_irq_percpu[i] = addr[i];
  4165.     }
  4166. -   sun4m_irq_global = (void __iomem *)
  4167. -       (unsigned long) addr[num_cpu_iregs];
  4168. +   sun4m_irq_global = addr[num_cpu_iregs];
  4169.  
  4170.     local_irq_disable();
  4171.  
  4172. diff -u -p a/arch/tile/kernel/unaligned.c b/arch/tile/kernel/unaligned.c
  4173. --- a/arch/tile/kernel/unaligned.c
  4174. +++ b/arch/tile/kernel/unaligned.c
  4175. @@ -917,7 +917,7 @@ void jit_bundle_gen(struct pt_regs *regs
  4176.  
  4177.                 /* Sign-extend 4-byte loads. */
  4178.                 if (load_store_size == 4)
  4179. -                   x = (long)(int)x;
  4180. +                   x = x;
  4181.  
  4182.                 /* Set register rd. */
  4183.                 regs->regs[rd] = x;
  4184. diff -u -p a/arch/s390/kernel/vdso.c b/arch/s390/kernel/vdso.c
  4185. --- a/arch/s390/kernel/vdso.c
  4186. +++ b/arch/s390/kernel/vdso.c
  4187. @@ -124,12 +124,12 @@ int vdso_alloc_per_cpu(struct _lowcore *
  4188.     for (i = 4; i < 32; i += 4)
  4189.         psal[i] = 0x80000000;
  4190.  
  4191. -   lowcore->paste[4] = (u32)(addr_t) psal;
  4192. +   lowcore->paste[4] = psal;
  4193.     psal[0] = 0x02000000;
  4194. -   psal[2] = (u32)(addr_t) aste;
  4195. +   psal[2] = aste;
  4196.     *(unsigned long *) (aste + 2) = segment_table +
  4197.         _ASCE_TABLE_LENGTH + _ASCE_USER_BITS + _ASCE_TYPE_SEGMENT;
  4198. -   aste[4] = (u32)(addr_t) psal;
  4199. +   aste[4] = psal;
  4200.     lowcore->vdso_per_cpu_data = page_frame;
  4201.  
  4202.     return 0;
  4203. @@ -149,8 +149,8 @@ void vdso_free_per_cpu(struct _lowcore *
  4204.     if (!vdso_enabled)
  4205.         return;
  4206.  
  4207. -   psal = (u32 *)(addr_t) lowcore->paste[4];
  4208. -   aste = (u32 *)(addr_t) psal[2];
  4209. +   psal = lowcore->paste[4];
  4210. +   aste = psal[2];
  4211.     segment_table = *(unsigned long *)(aste + 2) & PAGE_MASK;
  4212.     page_table = *(unsigned long *) segment_table;
  4213.     page_frame = *(unsigned long *) page_table;
  4214. diff -u -p a/arch/s390/kernel/ipl.c b/arch/s390/kernel/ipl.c
  4215. --- a/arch/s390/kernel/ipl.c
  4216. +++ b/arch/s390/kernel/ipl.c
  4217. @@ -2033,7 +2033,7 @@ void __init ipl_save_parameters(void)
  4218.     if (!iplinfo.is_qdio)
  4219.         return;
  4220.     ipl_flags |= IPL_PARMBLOCK_VALID;
  4221. -   src = (void *)(unsigned long)S390_lowcore.ipl_parmblock_ptr;
  4222. +   src = S390_lowcore.ipl_parmblock_ptr;
  4223.     dst = (void *)IPL_PARMBLOCK_ORIGIN;
  4224.     memmove(dst, src, PAGE_SIZE);
  4225.     S390_lowcore.ipl_parmblock_ptr = IPL_PARMBLOCK_ORIGIN;
  4226. @@ -2079,13 +2079,13 @@ void s390_reset_system(void (*fn_pre)(vo
  4227.  {
  4228.     struct _lowcore *lc;
  4229.  
  4230. -   lc = (struct _lowcore *)(unsigned long) store_prefix();
  4231. +   lc = store_prefix();
  4232.  
  4233.     /* Stack for interrupt/machine check handler */
  4234.     lc->panic_stack = S390_lowcore.panic_stack;
  4235.  
  4236.     /* Save prefix page address for dump case */
  4237. -   dump_prefix_page = (u32)(unsigned long) lc;
  4238. +   dump_prefix_page = lc;
  4239.  
  4240.     /* Disable prefixing */
  4241.     set_prefix(0);
  4242. diff -u -p a/arch/mips/fw/arc/identify.c b/arch/mips/fw/arc/identify.c
  4243. --- a/arch/mips/fw/arc/identify.c
  4244. +++ b/arch/mips/fw/arc/identify.c
  4245. @@ -106,7 +106,7 @@ void __init prom_identify_arch(void)
  4246.         iname = "Unknown";
  4247.  #endif
  4248.     } else
  4249. -       iname = (char *) (long) p->iname;
  4250. +       iname = p->iname;
  4251.  
  4252.     printk("ARCH: %s\n", iname);
  4253.     mach = string_to_mach(iname);
  4254. diff -u -p a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
  4255. --- a/arch/mips/kernel/traps.c
  4256. +++ b/arch/mips/kernel/traps.c
  4257. @@ -112,7 +112,7 @@ static void show_raw_backtrace(unsigned
  4258.  #endif
  4259.     while (!kstack_end(sp)) {
  4260.         unsigned long __user *p =
  4261. -           (unsigned long __user *)(unsigned long)sp++;
  4262. +           sp++;
  4263.         if (__get_user(addr, p)) {
  4264.             printk(" (Bad stack address)");
  4265.             break;
  4266. diff -u -p a/arch/mips/kernel/perf_event_mipsxx.c b/arch/mips/kernel/perf_event_mipsxx.c
  4267. --- a/arch/mips/kernel/perf_event_mipsxx.c
  4268. +++ b/arch/mips/kernel/perf_event_mipsxx.c
  4269. @@ -787,7 +787,7 @@ static int n_counters(void)
  4270.  
  4271.  static void reset_counters(void *arg)
  4272.  {
  4273. -   int counters = (int)(long)arg;
  4274. +   int counters = arg;
  4275.     switch (counters) {
  4276.     case 4:
  4277.         mipsxx_pmu_write_control(3, 0);
  4278. diff -u -p a/arch/mips/oprofile/op_model_mipsxx.c b/arch/mips/oprofile/op_model_mipsxx.c
  4279. --- a/arch/mips/oprofile/op_model_mipsxx.c
  4280. +++ b/arch/mips/oprofile/op_model_mipsxx.c
  4281. @@ -308,7 +308,7 @@ static inline int n_counters(void)
  4282.  
  4283.  static void reset_counters(void *arg)
  4284.  {
  4285. -   int counters = (int)(long)arg;
  4286. +   int counters = arg;
  4287.     switch (counters) {
  4288.     case 4:
  4289.         w_c0_perfctrl3(0);
  4290. diff -u -p a/arch/mips/pci/ops-tx4927.c b/arch/mips/pci/ops-tx4927.c
  4291. --- a/arch/mips/pci/ops-tx4927.c
  4292. +++ b/arch/mips/pci/ops-tx4927.c
  4293. @@ -473,7 +473,7 @@ irqreturn_t tx4927_pcierr_interrupt(int
  4294.  {
  4295.     struct pt_regs *regs = get_irq_regs();
  4296.     struct tx4927_pcic_reg __iomem *pcicptr =
  4297. -       (struct tx4927_pcic_reg __iomem *)(unsigned long)dev_id;
  4298. +       dev_id;
  4299.  
  4300.     if (txx9_pci_err_action != TXX9_PCI_ERR_IGNORE) {
  4301.         printk(KERN_WARNING "PCIERR interrupt at 0x%0*lx\n",
  4302. diff -u -p a/arch/mips/kvm/mips.c b/arch/mips/kvm/mips.c
  4303. --- a/arch/mips/kvm/mips.c
  4304. +++ b/arch/mips/kvm/mips.c
  4305. @@ -604,11 +604,11 @@ static int kvm_mips_get_reg(struct kvm_v
  4306.         return -EINVAL;
  4307.     }
  4308.     if ((reg->id & KVM_REG_SIZE_MASK) == KVM_REG_SIZE_U64) {
  4309. -       u64 __user *uaddr64 = (u64 __user *)(long)reg->addr;
  4310. +       u64 __user *uaddr64 = reg->addr;
  4311.  
  4312.         return put_user(v, uaddr64);
  4313.     } else if ((reg->id & KVM_REG_SIZE_MASK) == KVM_REG_SIZE_U32) {
  4314. -       u32 __user *uaddr32 = (u32 __user *)(long)reg->addr;
  4315. +       u32 __user *uaddr32 = reg->addr;
  4316.         u32 v32 = (u32)v;
  4317.  
  4318.         return put_user(v32, uaddr32);
  4319. @@ -624,12 +624,12 @@ static int kvm_mips_set_reg(struct kvm_v
  4320.     u64 v;
  4321.  
  4322.     if ((reg->id & KVM_REG_SIZE_MASK) == KVM_REG_SIZE_U64) {
  4323. -       u64 __user *uaddr64 = (u64 __user *)(long)reg->addr;
  4324. +       u64 __user *uaddr64 = reg->addr;
  4325.  
  4326.         if (get_user(v, uaddr64) != 0)
  4327.             return -EFAULT;
  4328.     } else if ((reg->id & KVM_REG_SIZE_MASK) == KVM_REG_SIZE_U32) {
  4329. -       u32 __user *uaddr32 = (u32 __user *)(long)reg->addr;
  4330. +       u32 __user *uaddr32 = reg->addr;
  4331.         s32 v32;
  4332.  
  4333.         if (get_user(v32, uaddr32) != 0)
  4334. diff -u -p a/arch/mips/dec/prom/init.c b/arch/mips/dec/prom/init.c
  4335. --- a/arch/mips/dec/prom/init.c
  4336. +++ b/arch/mips/dec/prom/init.c
  4337. @@ -52,25 +52,25 @@ void __init which_prom(s32 magic, s32 *p
  4338.          * Set up prom abstraction structure with REX entry points.
  4339.          */
  4340.         __rex_bootinit =
  4341. -           (void *)(long)*(prom_vec + REX_PROM_BOOTINIT);
  4342. +           *(prom_vec + REX_PROM_BOOTINIT);
  4343.         __rex_bootread =
  4344. -           (void *)(long)*(prom_vec + REX_PROM_BOOTREAD);
  4345. +           *(prom_vec + REX_PROM_BOOTREAD);
  4346.         __rex_getbitmap =
  4347. -           (void *)(long)*(prom_vec + REX_PROM_GETBITMAP);
  4348. +           *(prom_vec + REX_PROM_GETBITMAP);
  4349.         __prom_getchar =
  4350. -           (void *)(long)*(prom_vec + REX_PROM_GETCHAR);
  4351. +           *(prom_vec + REX_PROM_GETCHAR);
  4352.         __prom_getenv =
  4353. -           (void *)(long)*(prom_vec + REX_PROM_GETENV);
  4354. +           *(prom_vec + REX_PROM_GETENV);
  4355.         __rex_getsysid =
  4356. -           (void *)(long)*(prom_vec + REX_PROM_GETSYSID);
  4357. +           *(prom_vec + REX_PROM_GETSYSID);
  4358.         __rex_gettcinfo =
  4359. -           (void *)(long)*(prom_vec + REX_PROM_GETTCINFO);
  4360. +           *(prom_vec + REX_PROM_GETTCINFO);
  4361.         __prom_printf =
  4362. -           (void *)(long)*(prom_vec + REX_PROM_PRINTF);
  4363. +           *(prom_vec + REX_PROM_PRINTF);
  4364.         __rex_slot_address =
  4365. -           (void *)(long)*(prom_vec + REX_PROM_SLOTADDR);
  4366. +           *(prom_vec + REX_PROM_SLOTADDR);
  4367.         __rex_clear_cache =
  4368. -           (void *)(long)*(prom_vec + REX_PROM_CLEARCACHE);
  4369. +           *(prom_vec + REX_PROM_CLEARCACHE);
  4370.     } else {
  4371.         /*
  4372.          * Set up prom abstraction structure with non-REX entry points.
  4373. diff -u -p a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
  4374. --- a/arch/x86/platform/efi/efi.c
  4375. +++ b/arch/x86/platform/efi/efi.c
  4376. @@ -263,7 +263,7 @@ static int __init efi_systab_init(void *
  4377.                      (void *)(unsigned long)data->runtime :
  4378.                      (void *)(unsigned long)systab64->runtime;
  4379.         tmp |= data ? data->runtime : systab64->runtime;
  4380. -       efi_systab.boottime = (void *)(unsigned long)systab64->boottime;
  4381. +       efi_systab.boottime = systab64->boottime;
  4382.         tmp |= systab64->boottime;
  4383.         efi_systab.nr_tables = systab64->nr_tables;
  4384.         efi_systab.tables = data ? (unsigned long)data->tables :
  4385. @@ -298,8 +298,8 @@ static int __init efi_systab_init(void *
  4386.         efi_systab.con_out = systab32->con_out;
  4387.         efi_systab.stderr_handle = systab32->stderr_handle;
  4388.         efi_systab.stderr = systab32->stderr;
  4389. -       efi_systab.runtime = (void *)(unsigned long)systab32->runtime;
  4390. -       efi_systab.boottime = (void *)(unsigned long)systab32->boottime;
  4391. +       efi_systab.runtime = systab32->runtime;
  4392. +       efi_systab.boottime = systab32->boottime;
  4393.         efi_systab.nr_tables = systab32->nr_tables;
  4394.         efi_systab.tables = systab32->tables;
  4395.  
  4396. @@ -342,8 +342,7 @@ static int __init efi_runtime_init32(voi
  4397.      * via the virtual mapping.
  4398.      */
  4399.     efi_phys.set_virtual_address_map =
  4400. -           (efi_set_virtual_address_map_t *)
  4401. -           (unsigned long)runtime->set_virtual_address_map;
  4402. +           runtime->set_virtual_address_map;
  4403.     early_memunmap(runtime, sizeof(efi_runtime_services_32_t));
  4404.  
  4405.     return 0;
  4406. @@ -366,8 +365,7 @@ static int __init efi_runtime_init64(voi
  4407.      * via the virtual mapping.
  4408.      */
  4409.     efi_phys.set_virtual_address_map =
  4410. -           (efi_set_virtual_address_map_t *)
  4411. -           (unsigned long)runtime->set_virtual_address_map;
  4412. +           runtime->set_virtual_address_map;
  4413.     early_memunmap(runtime, sizeof(efi_runtime_services_64_t));
  4414.  
  4415.     return 0;
  4416. @@ -560,7 +558,7 @@ void __init old_map_region(efi_memory_de
  4417.         va = efi_ioremap(md->phys_addr, size,
  4418.                  md->type, md->attribute);
  4419.  
  4420. -   md->virt_addr = (u64) (unsigned long) va;
  4421. +   md->virt_addr = va;
  4422.     if (!va)
  4423.         pr_err("ioremap of 0x%llX failed!\n",
  4424.                (unsigned long long)md->phys_addr);
  4425. @@ -606,10 +604,10 @@ static void __init get_systab_virt_addr(
  4426.  
  4427.     size = md->num_pages << EFI_PAGE_SHIFT;
  4428.     end = md->phys_addr + size;
  4429. -   systab = (u64)(unsigned long)efi_phys.systab;
  4430. +   systab = efi_phys.systab;
  4431.     if (md->phys_addr <= systab && systab < end) {
  4432.         systab += md->virt_addr - md->phys_addr;
  4433. -       efi.systab = (efi_system_table_t *)(unsigned long)systab;
  4434. +       efi.systab = systab;
  4435.     }
  4436.  }
  4437.  
  4438. diff -u -p a/arch/x86/kernel/cpu/perf_event_intel_ds.c b/arch/x86/kernel/cpu/perf_event_intel_ds.c
  4439. --- a/arch/x86/kernel/cpu/perf_event_intel_ds.c
  4440. +++ b/arch/x86/kernel/cpu/perf_event_intel_ds.c
  4441. @@ -275,7 +275,7 @@ static int alloc_pebs_buffer(int cpu)
  4442.  
  4443.     max = PEBS_BUFFER_SIZE / x86_pmu.pebs_record_size;
  4444.  
  4445. -   ds->pebs_buffer_base = (u64)(unsigned long)buffer;
  4446. +   ds->pebs_buffer_base = buffer;
  4447.     ds->pebs_index = ds->pebs_buffer_base;
  4448.     ds->pebs_absolute_maximum = ds->pebs_buffer_base +
  4449.         max * x86_pmu.pebs_record_size;
  4450. @@ -319,7 +319,7 @@ static int alloc_bts_buffer(int cpu)
  4451.     max = BTS_BUFFER_SIZE / BTS_RECORD_SIZE;
  4452.     thresh = max / 16;
  4453.  
  4454. -   ds->bts_buffer_base = (u64)(unsigned long)buffer;
  4455. +   ds->bts_buffer_base = buffer;
  4456.     ds->bts_index = ds->bts_buffer_base;
  4457.     ds->bts_absolute_maximum = ds->bts_buffer_base +
  4458.         max * BTS_RECORD_SIZE;
  4459. @@ -511,8 +511,8 @@ int intel_pmu_drain_bts_buffer(void)
  4460.     if (!x86_pmu.bts_active)
  4461.         return 0;
  4462.  
  4463. -   at  = (struct bts_record *)(unsigned long)ds->bts_buffer_base;
  4464. -   top = (struct bts_record *)(unsigned long)ds->bts_index;
  4465. +   at  = ds->bts_buffer_base;
  4466. +   top = ds->bts_index;
  4467.  
  4468.     if (top <= at)
  4469.         return 0;
  4470. @@ -959,8 +959,8 @@ static void intel_pmu_drain_pebs_core(st
  4471.     if (!x86_pmu.pebs_active)
  4472.         return;
  4473.  
  4474. -   at  = (struct pebs_record_core *)(unsigned long)ds->pebs_buffer_base;
  4475. -   top = (struct pebs_record_core *)(unsigned long)ds->pebs_index;
  4476. +   at  = ds->pebs_buffer_base;
  4477. +   top = ds->pebs_index;
  4478.  
  4479.     /*
  4480.      * Whatever else happens, drain the thing
  4481. @@ -1001,8 +1001,8 @@ static void intel_pmu_drain_pebs_nhm(str
  4482.     if (!x86_pmu.pebs_active)
  4483.         return;
  4484.  
  4485. -   at  = (struct pebs_record_nhm *)(unsigned long)ds->pebs_buffer_base;
  4486. -   top = (struct pebs_record_nhm *)(unsigned long)ds->pebs_index;
  4487. +   at  = ds->pebs_buffer_base;
  4488. +   top = ds->pebs_index;
  4489.  
  4490.     ds->pebs_index = ds->pebs_buffer_base;
  4491.  
  4492. diff -u -p a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
  4493. --- a/arch/x86/boot/compressed/eboot.c
  4494. +++ b/arch/x86/boot/compressed/eboot.c
  4495. @@ -204,7 +204,7 @@ static inline efi_status_t __open_volume
  4496.     efi_file_handle_32_t *fh;
  4497.     efi_guid_t fs_proto = EFI_FILE_SYSTEM_GUID;
  4498.     efi_status_t status;
  4499. -   void *handle = (void *)(unsigned long)image->device_handle;
  4500. +   void *handle = image->device_handle;
  4501.     unsigned long func;
  4502.  
  4503.     status = efi_call_early(handle_protocol, handle,
  4504. @@ -230,7 +230,7 @@ static inline efi_status_t __open_volume
  4505.     efi_file_handle_64_t *fh;
  4506.     efi_guid_t fs_proto = EFI_FILE_SYSTEM_GUID;
  4507.     efi_status_t status;
  4508. -   void *handle = (void *)(unsigned long)image->device_handle;
  4509. +   void *handle = image->device_handle;
  4510.     unsigned long func;
  4511.  
  4512.     status = efi_call_early(handle_protocol, handle,
  4513. @@ -269,7 +269,7 @@ void efi_char16_printk(efi_system_table_
  4514.  
  4515.         offset = offsetof(typeof(*out), output_string);
  4516.         output_string = efi_early->text_output + offset;
  4517. -       out = (typeof(out))(unsigned long)efi_early->text_output;
  4518. +       out = efi_early->text_output;
  4519.         func = (u64 *)output_string;
  4520.  
  4521.         efi_early->call(*func, out, str);
  4522. @@ -279,7 +279,7 @@ void efi_char16_printk(efi_system_table_
  4523.  
  4524.         offset = offsetof(typeof(*out), output_string);
  4525.         output_string = efi_early->text_output + offset;
  4526. -       out = (typeof(out))(unsigned long)efi_early->text_output;
  4527. +       out = efi_early->text_output;
  4528.         func = (u32 *)output_string;
  4529.  
  4530.         efi_early->call(*func, out, str);
  4531. @@ -378,16 +378,16 @@ setup_efi_pci32(struct boot_params *para
  4532.  {
  4533.     efi_pci_io_protocol_32 *pci = NULL;
  4534.     efi_guid_t pci_proto = EFI_PCI_IO_PROTOCOL_GUID;
  4535. -   u32 *handles = (u32 *)(unsigned long)pci_handle;
  4536. +   u32 *handles = pci_handle;
  4537.     efi_status_t status;
  4538.     unsigned long nr_pci;
  4539.     struct setup_data *data;
  4540.     int i;
  4541.  
  4542. -   data = (struct setup_data *)(unsigned long)params->hdr.setup_data;
  4543. +   data = params->hdr.setup_data;
  4544.  
  4545.     while (data && data->next)
  4546. -       data = (struct setup_data *)(unsigned long)data->next;
  4547. +       data = data->next;
  4548.  
  4549.     nr_pci = size / sizeof(u32);
  4550.     for (i = 0; i < nr_pci; i++) {
  4551. @@ -485,16 +485,16 @@ setup_efi_pci64(struct boot_params *para
  4552.  {
  4553.     efi_pci_io_protocol_64 *pci = NULL;
  4554.     efi_guid_t pci_proto = EFI_PCI_IO_PROTOCOL_GUID;
  4555. -   u64 *handles = (u64 *)(unsigned long)pci_handle;
  4556. +   u64 *handles = pci_handle;
  4557.     efi_status_t status;
  4558.     unsigned long nr_pci;
  4559.     struct setup_data *data;
  4560.     int i;
  4561.  
  4562. -   data = (struct setup_data *)(unsigned long)params->hdr.setup_data;
  4563. +   data = params->hdr.setup_data;
  4564.  
  4565.     while (data && data->next)
  4566. -       data = (struct setup_data *)(unsigned long)data->next;
  4567. +       data = data->next;
  4568.  
  4569.     nr_pci = size / sizeof(u64);
  4570.     for (i = 0; i < nr_pci; i++) {
  4571. @@ -654,7 +654,7 @@ setup_gop32(struct screen_info *si, efi_
  4572.     struct efi_pixel_bitmask pixel_info;
  4573.     int pixel_format;
  4574.     efi_status_t status;
  4575. -   u32 *handles = (u32 *)(unsigned long)gop_handle;
  4576. +   u32 *handles = gop_handle;
  4577.     int i;
  4578.  
  4579.     first_gop = NULL;
  4580. @@ -757,7 +757,7 @@ setup_gop64(struct screen_info *si, efi_
  4581.     struct efi_pixel_bitmask pixel_info;
  4582.     int pixel_format;
  4583.     efi_status_t status;
  4584. -   u64 *handles = (u64 *)(unsigned long)gop_handle;
  4585. +   u64 *handles = gop_handle;
  4586.     int i;
  4587.  
  4588.     first_gop = NULL;
  4589. @@ -1058,8 +1058,8 @@ struct boot_params *make_boot_params(str
  4590.     unsigned long ramdisk_size;
  4591.  
  4592.     efi_early = c;
  4593. -   sys_table = (efi_system_table_t *)(unsigned long)efi_early->table;
  4594. -   handle = (void *)(unsigned long)efi_early->image_handle;
  4595. +   sys_table = efi_early->table;
  4596. +   handle = efi_early->image_handle;
  4597.  
  4598.     /* Check if we were booted by the EFI firmware */
  4599.     if (sys_table->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE)
  4600. @@ -1162,10 +1162,10 @@ static void add_e820ext(struct boot_para
  4601.     e820ext->len = nr_entries * sizeof(struct e820entry);
  4602.     e820ext->next = 0;
  4603.  
  4604. -   data = (struct setup_data *)(unsigned long)params->hdr.setup_data;
  4605. +   data = params->hdr.setup_data;
  4606.  
  4607.     while (data && data->next)
  4608. -       data = (struct setup_data *)(unsigned long)data->next;
  4609. +       data = data->next;
  4610.  
  4611.     if (data)
  4612.         data->next = (unsigned long)e820ext;
  4613. @@ -1391,8 +1391,8 @@ struct boot_params *efi_main(struct efi_
  4614.  
  4615.     efi_early = c;
  4616.  
  4617. -   _table = (efi_system_table_t *)(unsigned long)efi_early->table;
  4618. -   handle = (void *)(unsigned long)efi_early->image_handle;
  4619. +   _table = efi_early->table;
  4620. +   handle = efi_early->image_handle;
  4621.     is64 = efi_early->is64;
  4622.  
  4623.     sys_table = _table;
  4624. diff -u -p a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c
  4625. --- a/arch/powerpc/kernel/signal_32.c
  4626. +++ b/arch/powerpc/kernel/signal_32.c
  4627. @@ -1084,7 +1084,7 @@ static int do_setcontext(struct ucontext
  4628.  
  4629.         if (__get_user(cmcp, &ucp->uc_regs))
  4630.             return -EFAULT;
  4631. -       mcp = (struct mcontext __user *)(u64)cmcp;
  4632. +       mcp = cmcp;
  4633.         /* no need to check access_ok(mcp), since mcp < 4GB */
  4634.     }
  4635.  #else
  4636. @@ -1117,8 +1117,8 @@ static int do_setcontext_tm(struct ucont
  4637.     if (__get_user(cmcp, &ucp->uc_regs) ||
  4638.         __get_user(tm_cmcp, &tm_ucp->uc_regs))
  4639.         return -EFAULT;
  4640. -   mcp = (struct mcontext __user *)(u64)cmcp;
  4641. -   tm_mcp = (struct mcontext __user *)(u64)tm_cmcp;
  4642. +   mcp = cmcp;
  4643. +   tm_mcp = tm_cmcp;
  4644.     /* no need to check access_ok(mcp), since mcp < 4GB */
  4645.  
  4646.     set_current_blocked(&set);
  4647. @@ -1150,7 +1150,7 @@ long sys_swapcontext(struct ucontext __u
  4648.          */
  4649.         if (__get_user(cmcp, &new_ctx->uc_regs))
  4650.             return -EFAULT;
  4651. -       mcp = (struct mcontext __user *)(u64)cmcp;
  4652. +       mcp = cmcp;
  4653.         if (__get_user(new_msr, &mcp->mc_gregs[PT_MSR]))
  4654.             return -EFAULT;
  4655.     }
  4656. @@ -1240,14 +1240,14 @@ long sys_rt_sigreturn(int r3, int r4, in
  4657.  #ifdef CONFIG_PPC_TRANSACTIONAL_MEM
  4658.     if (__get_user(tmp, &rt_sf->uc.uc_link))
  4659.         goto bad;
  4660. -   uc_transact = (struct ucontext __user *)(uintptr_t)tmp;
  4661. +   uc_transact = tmp;
  4662.     if (uc_transact) {
  4663.         u32 cmcp;
  4664.         struct mcontext __user *mcp;
  4665.  
  4666.         if (__get_user(cmcp, &uc_transact->uc_regs))
  4667.             return -EFAULT;
  4668. -       mcp = (struct mcontext __user *)(u64)cmcp;
  4669. +       mcp = cmcp;
  4670.         /* The top 32 bits of the MSR are stashed in the transactional
  4671.          * ucontext. */
  4672.         if (__get_user(msr_hi, &mcp->mc_gregs[PT_MSR]))
  4673. @@ -1470,7 +1470,7 @@ int handle_signal32(struct ksignal *ksig
  4674.     regs->gpr[1] = newsp;
  4675.     regs->gpr[3] = ksig->sig;
  4676.     regs->gpr[4] = (unsigned long) sc;
  4677. -   regs->nip = (unsigned long) (unsigned long)ksig->ka.sa.sa_handler;
  4678. +   regs->nip = ksig->ka.sa.sa_handler;
  4679.     /* enter the signal handler in big-endian mode */
  4680.     regs->msr &= ~MSR_LE;
  4681.     return 0;
  4682. diff -u -p a/arch/powerpc/perf/callchain.c b/arch/powerpc/perf/callchain.c
  4683. --- a/arch/powerpc/perf/callchain.c
  4684. +++ b/arch/powerpc/perf/callchain.c
  4685. @@ -386,7 +386,7 @@ static int sane_signal_32_frame(unsigned
  4686.     struct signal_frame_32 __user *sf;
  4687.     unsigned int regs;
  4688.  
  4689. -   sf = (struct signal_frame_32 __user *) (unsigned long) sp;
  4690. +   sf = sp;
  4691.     if (read_user_stack_32((unsigned int __user *) &sf->sctx.regs, &regs))
  4692.         return 0;
  4693.     return regs == (unsigned long) &sf->mctx;
  4694. @@ -397,7 +397,7 @@ static int sane_rt_signal_32_frame(unsig
  4695.     struct rt_signal_frame_32 __user *sf;
  4696.     unsigned int regs;
  4697.  
  4698. -   sf = (struct rt_signal_frame_32 __user *) (unsigned long) sp;
  4699. +   sf = sp;
  4700.     if (read_user_stack_32((unsigned int __user *) &sf->uc.uc_regs, &regs))
  4701.         return 0;
  4702.     return regs == (unsigned long) &sf->uc.uc_mcontext;
  4703. @@ -419,14 +419,14 @@ static unsigned int __user *signal_frame
  4704.     if (next_sp - sp >= sizeof(struct signal_frame_32) &&
  4705.         is_sigreturn_32_address(next_ip, sp) &&
  4706.         sane_signal_32_frame(sp)) {
  4707. -       sf = (struct signal_frame_32 __user *) (unsigned long) sp;
  4708. +       sf = sp;
  4709.         mctx = &sf->mctx;
  4710.     }
  4711.  
  4712.     if (!mctx && next_sp - sp >= sizeof(struct rt_signal_frame_32) &&
  4713.         is_rt_sigreturn_32_address(next_ip, sp) &&
  4714.         sane_rt_signal_32_frame(sp)) {
  4715. -       rt_sf = (struct rt_signal_frame_32 __user *) (unsigned long) sp;
  4716. +       rt_sf = sp;
  4717.         mctx = &rt_sf->uc.uc_mcontext;
  4718.     }
  4719.  
  4720. @@ -450,7 +450,7 @@ static void perf_callchain_user_32(struc
  4721.     perf_callchain_store(entry, next_ip);
  4722.  
  4723.     while (entry->nr < PERF_MAX_STACK_DEPTH) {
  4724. -       fp = (unsigned int __user *) (unsigned long) sp;
  4725. +       fp = sp;
  4726.         if (!valid_user_sp(sp, 0) || read_user_stack_32(fp, &next_sp))
  4727.             return;
  4728.         if (level > 0 && read_user_stack_32(&fp[1], &next_ip))
  4729. diff -u -p a/arch/powerpc/mm/mmu_context_nohash.c b/arch/powerpc/mm/mmu_context_nohash.c
  4730. --- a/arch/powerpc/mm/mmu_context_nohash.c
  4731. +++ b/arch/powerpc/mm/mmu_context_nohash.c
  4732. @@ -373,7 +373,7 @@ void destroy_context(struct mm_struct *m
  4733.  static int mmu_context_cpu_notify(struct notifier_block *self,
  4734.                   unsigned long action, void *hcpu)
  4735.  {
  4736. -   unsigned int cpu = (unsigned int)(long)hcpu;
  4737. +   unsigned int cpu = hcpu;
  4738.  
  4739.     /* We don't touch CPU 0 map, it's allocated at aboot and kept
  4740.      * around forever
  4741. diff -u -p a/arch/powerpc/platforms/powermac/low_i2c.c b/arch/powerpc/platforms/powermac/low_i2c.c
  4742. --- a/arch/powerpc/platforms/powermac/low_i2c.c
  4743. +++ b/arch/powerpc/platforms/powermac/low_i2c.c
  4744. @@ -1259,7 +1259,7 @@ static void* pmac_i2c_do_begin(struct pm
  4745.     }
  4746.     inst->bus = bus;
  4747.     inst->addr = pmac_i2c_get_dev_addr(func->node);
  4748. -   inst->quirks = (int)(long)func->driver_data;
  4749. +   inst->quirks = func->driver_data;
  4750.     return inst;
  4751.  }
  4752.  
  4753. diff -u -p a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
  4754. --- a/arch/powerpc/kvm/powerpc.c
  4755. +++ b/arch/powerpc/kvm/powerpc.c
  4756. @@ -740,14 +740,14 @@ static void kvmppc_complete_mmio_load(st
  4757.         switch (run->mmio.len) {
  4758.  #ifdef CONFIG_PPC64
  4759.         case 4:
  4760. -           gpr = (s64)(s32)gpr;
  4761. +           gpr = gpr;
  4762.             break;
  4763.  #endif
  4764.         case 2:
  4765. -           gpr = (s64)(s16)gpr;
  4766. +           gpr = gpr;
  4767.             break;
  4768.         case 1:
  4769. -           gpr = (s64)(s8)gpr;
  4770. +           gpr = gpr;
  4771.             break;
  4772.         }
  4773.     }
  4774. @@ -1079,7 +1079,7 @@ static int kvm_vcpu_ioctl_enable_cap(str
  4775.  #if defined(CONFIG_KVM_E500V2) || defined(CONFIG_KVM_E500MC)
  4776.     case KVM_CAP_SW_TLB: {
  4777.         struct kvm_config_tlb cfg;
  4778. -       void __user *user_ptr = (void __user *)(uintptr_t)cap->args[0];
  4779. +       void __user *user_ptr = cap->args[0];
  4780.  
  4781.         r = -EFAULT;
  4782.         if (copy_from_user(&cfg, user_ptr, sizeof(cfg)))
  4783. diff -u -p a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c
  4784. --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c
  4785. +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c
  4786. @@ -297,7 +297,7 @@ static void rq_cq_reap(struct svcxprt_rd
  4787.     atomic_inc(&rdma_stat_rq_poll);
  4788.  
  4789.     while ((ret = ib_poll_cq(xprt->sc_rq_cq, 1, &wc)) > 0) {
  4790. -       ctxt = (struct svc_rdma_op_ctxt *)(unsigned long)wc.wr_id;
  4791. +       ctxt = wc.wr_id;
  4792.         ctxt->wc_status = wc.status;
  4793.         ctxt->byte_len = wc.byte_len;
  4794.         svc_rdma_unmap_dma(ctxt);
  4795. @@ -413,8 +413,7 @@ static void sq_cq_reap(struct svcxprt_rd
  4796.             atomic_dec(&xprt->sc_sq_count);
  4797.             wake_up(&xprt->sc_send_wait);
  4798.  
  4799. -           ctxt = (struct svc_rdma_op_ctxt *)
  4800. -               (unsigned long)wc->wr_id;
  4801. +           ctxt =wc->wr_id;
  4802.             if (ctxt)
  4803.                 process_context(xprt, ctxt);
  4804.  
  4805. @@ -537,7 +536,7 @@ int svc_rdma_post_recv(struct svcxprt_rd
  4806.     recv_wr.next = NULL;
  4807.     recv_wr.sg_list = &ctxt->sge[0];
  4808.     recv_wr.num_sge = ctxt->count;
  4809. -   recv_wr.wr_id = (u64)(unsigned long)ctxt;
  4810. +   recv_wr.wr_id = ctxt;
  4811.  
  4812.     svc_xprt_get(&xprt->sc_xprt);
  4813.     ret = ib_post_recv(xprt->sc_qp, &recv_wr, &bad_recv_wr);
  4814. diff -u -p a/net/rds/rdma.c b/net/rds/rdma.c
  4815. --- a/net/rds/rdma.c
  4816. +++ b/net/rds/rdma.c
  4817. @@ -514,7 +514,7 @@ int rds_rdma_extra_size(struct rds_rdma_
  4818.     unsigned int nr_pages;
  4819.     unsigned int i;
  4820.  
  4821. -   local_vec = (struct rds_iovec __user *)(unsigned long) args->local_vec_addr;
  4822. +   local_vec = args->local_vec_addr;
  4823.  
  4824.     /* figure out the number of pages in the vector */
  4825.     for (i = 0; i < args->nr_local; i++) {
  4826. diff -u -p a/net/iucv/iucv.c b/net/iucv/iucv.c
  4827. --- a/net/iucv/iucv.c
  4828. +++ b/net/iucv/iucv.c
  4829. @@ -1184,7 +1184,7 @@ int __iucv_message_receive(struct iucv_p
  4830.     }
  4831.     parm = iucv_param[smp_processor_id()];
  4832.     memset(parm, 0, sizeof(union iucv_param));
  4833. -   parm->db.ipbfadr1 = (u32)(addr_t) buffer;
  4834. +   parm->db.ipbfadr1 = buffer;
  4835.     parm->db.ipbfln1f = (u32) size;
  4836.     parm->db.ipmsgid = msg->id;
  4837.     parm->db.ippathid = path->pathid;
  4838. @@ -1303,7 +1303,7 @@ int iucv_message_reply(struct iucv_path
  4839.         parm->dpl.iptrgcls = msg->class;
  4840.         memcpy(parm->dpl.iprmmsg, reply, min_t(size_t, size, 8));
  4841.     } else {
  4842. -       parm->db.ipbfadr1 = (u32)(addr_t) reply;
  4843. +       parm->db.ipbfadr1 = reply;
  4844.         parm->db.ipbfln1f = (u32) size;
  4845.         parm->db.ippathid = path->pathid;
  4846.         parm->db.ipflags1 = flags;
  4847. @@ -1355,7 +1355,7 @@ int __iucv_message_send(struct iucv_path
  4848.         parm->dpl.ipmsgtag = msg->tag;
  4849.         memcpy(parm->dpl.iprmmsg, buffer, 8);
  4850.     } else {
  4851. -       parm->db.ipbfadr1 = (u32)(addr_t) buffer;
  4852. +       parm->db.ipbfadr1 = buffer;
  4853.         parm->db.ipbfln1f = (u32) size;
  4854.         parm->db.ippathid = path->pathid;
  4855.         parm->db.ipflags1 = flags | IUCV_IPNORPY;
  4856. @@ -1439,7 +1439,7 @@ int iucv_message_send2way(struct iucv_pa
  4857.         parm->dpl.iptrgcls = msg->class;
  4858.         parm->dpl.ipsrccls = srccls;
  4859.         parm->dpl.ipmsgtag = msg->tag;
  4860. -       parm->dpl.ipbfadr2 = (u32)(addr_t) answer;
  4861. +       parm->dpl.ipbfadr2 = answer;
  4862.         parm->dpl.ipbfln2f = (u32) asize;
  4863.         memcpy(parm->dpl.iprmmsg, buffer, 8);
  4864.     } else {
  4865. @@ -1448,9 +1448,9 @@ int iucv_message_send2way(struct iucv_pa
  4866.         parm->db.iptrgcls = msg->class;
  4867.         parm->db.ipsrccls = srccls;
  4868.         parm->db.ipmsgtag = msg->tag;
  4869. -       parm->db.ipbfadr1 = (u32)(addr_t) buffer;
  4870. +       parm->db.ipbfadr1 = buffer;
  4871.         parm->db.ipbfln1f = (u32) size;
  4872. -       parm->db.ipbfadr2 = (u32)(addr_t) answer;
  4873. +       parm->db.ipbfadr2 = answer;
  4874.         parm->db.ipbfln2f = (u32) asize;
  4875.     }
  4876.     rc = iucv_call_b2f0(IUCV_SEND, parm);
  4877. diff -u -p a/net/core/filter.c b/net/core/filter.c
  4878. --- a/net/core/filter.c
  4879. +++ b/net/core/filter.c
  4880. @@ -95,7 +95,7 @@ static u64 __skb_get_pay_offset(u64 ctx,
  4881.  
  4882.  static u64 __skb_get_nlattr(u64 ctx, u64 a, u64 x, u64 r4, u64 r5)
  4883.  {
  4884. -   struct sk_buff *skb = (struct sk_buff *)(unsigned long) ctx;
  4885. +   struct sk_buff *skb = ctx;
  4886.     struct nlattr *nla;
  4887.  
  4888.     if (skb_is_nonlinear(skb))
  4889. @@ -116,7 +116,7 @@ static u64 __skb_get_nlattr(u64 ctx, u64
  4890.  
  4891.  static u64 __skb_get_nlattr_nest(u64 ctx, u64 a, u64 x, u64 r4, u64 r5)
  4892.  {
  4893. -   struct sk_buff *skb = (struct sk_buff *)(unsigned long) ctx;
  4894. +   struct sk_buff *skb = ctx;
  4895.     struct nlattr *nla;
  4896.  
  4897.     if (skb_is_nonlinear(skb))
  4898. diff -u -p a/net/core/netprio_cgroup.c b/net/core/netprio_cgroup.c
  4899. --- a/net/core/netprio_cgroup.c
  4900. +++ b/net/core/netprio_cgroup.c
  4901. @@ -214,7 +214,7 @@ static int update_netprio(const void *v,
  4902.     int err;
  4903.     struct socket *sock = sock_from_file(file, &err);
  4904.     if (sock)
  4905. -       sock->sk->sk_cgrp_prioidx = (u32)(unsigned long)v;
  4906. +       sock->sk->sk_cgrp_prioidx = v;
  4907.     return 0;
  4908.  }
  4909.  
  4910. @@ -222,7 +222,7 @@ static void net_prio_attach(struct cgrou
  4911.                 struct cgroup_taskset *tset)
  4912.  {
  4913.     struct task_struct *p;
  4914. -   void *v = (void *)(unsigned long)css->cgroup->id;
  4915. +   void *v = css->cgroup->id;
  4916.  
  4917.     cgroup_taskset_for_each(p, tset) {
  4918.         task_lock(p);
  4919. diff -u -p a/tools/perf/util/trace-event-info.c b/tools/perf/util/trace-event-info.c
  4920. --- a/tools/perf/util/trace-event-info.c
  4921. +++ b/tools/perf/util/trace-event-info.c
  4922. @@ -52,7 +52,7 @@ int bigendian(void)
  4923.     unsigned char str[] = { 0x1, 0x2, 0x3, 0x4, 0x0, 0x0, 0x0, 0x0};
  4924.     unsigned int *ptr;
  4925.  
  4926. -   ptr = (unsigned int *)(void *)str;
  4927. +   ptr = str;
  4928.     return *ptr == 0x01020304;
  4929.  }
  4930.  
  4931. diff -u -p a/tools/lib/traceevent/plugin_cfg80211.c b/tools/lib/traceevent/plugin_cfg80211.c
  4932. --- a/tools/lib/traceevent/plugin_cfg80211.c
  4933. +++ b/tools/lib/traceevent/plugin_cfg80211.c
  4934. @@ -7,7 +7,7 @@
  4935.  static unsigned long long
  4936.  process___le16_to_cpup(struct trace_seq *s, unsigned long long *args)
  4937.  {
  4938. -   uint16_t *val = (uint16_t *) (unsigned long) args[0];
  4939. +   uint16_t *val = args[0];
  4940.     return val ? (long long) le16toh(*val) : 0;
  4941.  }
  4942.  
  4943. diff -u -p a/fs/affs/amigaffs.c b/fs/affs/amigaffs.c
  4944. --- a/fs/affs/amigaffs.c
  4945. +++ b/fs/affs/amigaffs.c
  4946. @@ -150,7 +150,7 @@ affs_remove_link(struct dentry *dentry)
  4947.     if (!bh)
  4948.         goto done;
  4949.  
  4950. -   link_ino = (u32)(long)dentry->d_fsdata;
  4951. +   link_ino = dentry->d_fsdata;
  4952.     if (inode->i_ino == link_ino) {
  4953.         /* we can't remove the head of the link, as its blocknr is still used as ino,
  4954.          * so we remove the block of the first link instead.
  4955. diff -u -p a/fs/affs/inode.c b/fs/affs/inode.c
  4956. --- a/fs/affs/inode.c
  4957. +++ b/fs/affs/inode.c
  4958. @@ -391,7 +391,7 @@ affs_add_entry(struct inode *dir, struct
  4959.     }
  4960.     affs_fix_checksum(sb, bh);
  4961.     mark_buffer_dirty_inode(bh, inode);
  4962. -   dentry->d_fsdata = (void *)(long)bh->b_blocknr;
  4963. +   dentry->d_fsdata = bh->b_blocknr;
  4964.  
  4965.     affs_lock_dir(dir);
  4966.     retval = affs_insert_hash(dir, bh);
  4967. diff -u -p a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c
  4968. --- a/fs/jfs/jfs_imap.c
  4969. +++ b/fs/jfs/jfs_imap.c
  4970. @@ -1274,8 +1274,8 @@ int diFree(struct inode *ip)
  4971.      *
  4972.      * It's not pretty, but it works.
  4973.      */
  4974. -   iplist[1] = (struct inode *) (size_t)iagno;
  4975. -   iplist[2] = (struct inode *) (size_t)extno;
  4976. +   iplist[1] = iagno;
  4977. +   iplist[2] = extno;
  4978.  
  4979.     rc = txCommit(tid, 1, &iplist[0], COMMIT_FORCE);
  4980.  
  4981. diff -u -p a/fs/ext4/inode.c b/fs/ext4/inode.c
  4982. --- a/fs/ext4/inode.c
  4983. +++ b/fs/ext4/inode.c
  4984. @@ -708,7 +708,7 @@ static int _ext4_get_block(struct inode
  4985.         bh->b_state = (bh->b_state & ~EXT4_MAP_FLAGS) | map.m_flags;
  4986.         if (IS_DAX(inode) && buffer_unwritten(bh) && !io_end) {
  4987.             bh->b_assoc_map = inode->i_mapping;
  4988. -           bh->b_private = (void *)(unsigned long)iblock;
  4989. +           bh->b_private = iblock;
  4990.             bh->b_end_io = ext4_end_io_unwritten;
  4991.         }
  4992.         if (io_end && io_end->flag & EXT4_IO_END_UNWRITTEN)
  4993. @@ -2633,7 +2633,7 @@ static int ext4_da_write_end(struct file
  4994.     handle_t *handle = ext4_journal_current_handle();
  4995.     loff_t new_i_size;
  4996.     unsigned long start, end;
  4997. -   int write_mode = (int)(unsigned long)fsdata;
  4998. +   int write_mode = fsdata;
  4999.  
  5000.     if (write_mode == FALL_BACK_TO_NONDELALLOC)
  5001.         return ext4_write_end(file, mapping, pos,
  5002. diff -u -p a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c
  5003. --- a/scripts/kconfig/nconf.c
  5004. +++ b/scripts/kconfig/nconf.c
  5005. @@ -1169,7 +1169,7 @@ static void conf(struct menu *menu)
  5006.             case 'm':
  5007.                 if (single_menu_mode)
  5008.                     submenu->data =
  5009. -                       (void *) (long) !submenu->data;
  5010. +                       !submenu->data;
  5011.                 else
  5012.                     conf(submenu);
  5013.                 break;
  5014. diff -u -p a/kernel/trace/trace_probe.c b/kernel/trace/trace_probe.c
  5015. --- a/kernel/trace/trace_probe.c
  5016. +++ b/kernel/trace/trace_probe.c
  5017. @@ -376,7 +376,7 @@ static int parse_probe_arg(char *arg, co
  5018.         ret = regs_query_register_offset(arg + 1);
  5019.         if (ret >= 0) {
  5020.             f->fn = t->fetch[FETCH_MTD_reg];
  5021. -           f->data = (void *)(unsigned long)ret;
  5022. +           f->data = ret;
  5023.             ret = 0;
  5024.         }
  5025.         break;
  5026. diff -u -p a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
  5027. --- a/kernel/bpf/verifier.c
  5028. +++ b/kernel/bpf/verifier.c
  5029. @@ -1807,7 +1807,7 @@ static int replace_map_fd_with_map_ptr(s
  5030.             }
  5031.  
  5032.             /* store map pointer inside BPF_LD_IMM64 instruction */
  5033. -           insn[0].imm = (u32) (unsigned long) map;
  5034. +           insn[0].imm = map;
  5035.             insn[1].imm = ((u64) (unsigned long) map) >> 32;
  5036.  
  5037.             /* check whether we recorded this map already */
  5038. @@ -1915,7 +1915,7 @@ int bpf_check(struct bpf_prog *prog, uni
  5039.          * and supplied buffer to store the verification trace
  5040.          */
  5041.         log_level = attr->log_level;
  5042. -       log_ubuf = (char __user *) (unsigned long) attr->log_buf;
  5043. +       log_ubuf = attr->log_buf;
  5044.         log_size = attr->log_size;
  5045.         log_len = 0;
  5046.  
  5047. diff -u -p a/drivers/net/hyperv/netvsc.c b/drivers/net/hyperv/netvsc.c
  5048. --- a/drivers/net/hyperv/netvsc.c
  5049. +++ b/drivers/net/hyperv/netvsc.c
  5050. @@ -625,7 +625,7 @@ static void netvsc_send_completion(struc
  5051.         int queue_sends;
  5052.  
  5053.         /* Get the send context */
  5054. -       nvsc_packet = (struct hv_netvsc_packet *)(unsigned long)
  5055. +       nvsc_packet =
  5056.             packet->trans_id;
  5057.  
  5058.         /* Notify the layer above us */
  5059. @@ -742,8 +742,7 @@ int netvsc_send(struct hv_device *device
  5060.             msg_size = netvsc_copy_to_send_buf(net_device,
  5061.                                section_index,
  5062.                                packet);
  5063. -           skb = (struct sk_buff *)
  5064. -                 (unsigned long)packet->send_completion_tid;
  5065. +           skb =packet->send_completion_tid;
  5066.             packet->page_buf_cnt = 0;
  5067.         }
  5068.     }
  5069. diff -u -p a/drivers/net/ethernet/neterion/vxge/vxge-traffic.c b/drivers/net/ethernet/neterion/vxge/vxge-traffic.c
  5070. --- a/drivers/net/ethernet/neterion/vxge/vxge-traffic.c
  5071. +++ b/drivers/net/ethernet/neterion/vxge/vxge-traffic.c
  5072. @@ -1477,7 +1477,7 @@ enum vxge_hw_status vxge_hw_fifo_txdl_re
  5073.         priv->alloc_frags = fifo->config->max_frags;
  5074.         priv->next_txdl_priv = NULL;
  5075.  
  5076. -       *txdl_priv = (void *)(size_t)txdp->host_control;
  5077. +       *txdl_priv = txdp->host_control;
  5078.  
  5079.         for (i = 0; i < fifo->config->max_frags; i++) {
  5080.             txdp = ((struct vxge_hw_fifo_txd *)*txdlh) + i;
  5081. diff -u -p a/drivers/regulator/tps62360-regulator.c b/drivers/regulator/tps62360-regulator.c
  5082. --- a/drivers/regulator/tps62360-regulator.c
  5083. +++ b/drivers/regulator/tps62360-regulator.c
  5084. @@ -371,7 +371,7 @@ static int tps62360_probe(struct i2c_cli
  5085.             dev_err(&client->dev, "Error: No device match found\n");
  5086.             return -ENODEV;
  5087.         }
  5088. -       chip_id = (int)(long)match->data;
  5089. +       chip_id = match->data;
  5090.         if (!pdata)
  5091.             pdata = of_get_tps62360_platform_data(&client->dev,
  5092.                                   &tps->desc);
  5093. diff -u -p a/drivers/vhost/vringh.c b/drivers/vhost/vringh.c
  5094. --- a/drivers/vhost/vringh.c
  5095. +++ b/drivers/vhost/vringh.c
  5096. @@ -310,7 +310,7 @@ __vringh_iov(struct vringh *vrh, u16 i,
  5097.                 slowrange = range;
  5098.             }
  5099.  
  5100. -           addr = (void *)(long)(a + range.offset);
  5101. +           addr = (a + range.offset);
  5102.             err = move_to_indirect(vrh, &up_next, &i, addr, &desc,
  5103.                            &descs, &desc_max);
  5104.             if (err)
  5105. @@ -351,7 +351,7 @@ __vringh_iov(struct vringh *vrh, u16 i,
  5106.             err = -EINVAL;
  5107.             goto fail;
  5108.         }
  5109. -       addr = (void *)(unsigned long)(vringh64_to_cpu(vrh, desc.addr) +
  5110. +       addr = (vringh64_to_cpu(vrh, desc.addr) +
  5111.                            range.offset);
  5112.  
  5113.         if (unlikely(iov->used == (iov->max_num & ~VRINGH_IOV_ALLOCATED))) {
  5114. diff -u -p a/drivers/staging/unisys/virthba/virthba.c b/drivers/staging/unisys/virthba/virthba.c
  5115. --- a/drivers/staging/unisys/virthba/virthba.c
  5116. +++ b/drivers/staging/unisys/virthba/virthba.c
  5117. @@ -718,7 +718,6 @@ forward_vdiskmgmt_command(enum vdisk_mgm
  5118.     cmdrsp->vdiskmgmt.vdest.id = vdest->id;
  5119.     cmdrsp->vdiskmgmt.vdest.lun = vdest->lun;
  5120.     cmdrsp->vdiskmgmt.scsicmd =
  5121. -       (void *)(uintptr_t)
  5122.         add_scsipending_entry_with_wait(virthbainfo, CMD_VDISKMGMT_TYPE,
  5123.                         (void *)cmdrsp);
  5124.  
  5125. @@ -779,7 +778,6 @@ forward_taskmgmt_command(enum task_mgmt_
  5126.     cmdrsp->scsitaskmgmt.vdest.id = scsidev->id;
  5127.     cmdrsp->scsitaskmgmt.vdest.lun = scsidev->lun;
  5128.     cmdrsp->scsitaskmgmt.scsicmd =
  5129. -       (void *)(uintptr_t)
  5130.         add_scsipending_entry_with_wait(virthbainfo,
  5131.                         CMD_SCSITASKMGMT_TYPE,
  5132.                         (void *)cmdrsp);
  5133. @@ -945,7 +943,7 @@ virthba_queue_command_lck(struct scsi_cm
  5134.     insert_location =
  5135.         add_scsipending_entry(virthbainfo, CMD_SCSI_TYPE, (void *)scsicmd);
  5136.     if (insert_location != -1) {
  5137. -       cmdrsp->scsi.scsicmd = (void *)(uintptr_t)insert_location;
  5138. +       cmdrsp->scsi.scsicmd = insert_location;
  5139.     } else {
  5140.         LOGERR("Queue is full. Returning busy.\n");
  5141.         kfree(cmdrsp);
  5142. diff -u -p a/drivers/staging/comedi/drivers/ni_65xx.c b/drivers/staging/comedi/drivers/ni_65xx.c
  5143. --- a/drivers/staging/comedi/drivers/ni_65xx.c
  5144. +++ b/drivers/staging/comedi/drivers/ni_65xx.c
  5145. @@ -708,7 +708,7 @@ static int ni_65xx_auto_attach(struct co
  5146.         s->insn_bits    = ni_65xx_dio_insn_bits;
  5147.  
  5148.         /* the output ports always start after the input ports */
  5149. -       s->private = (void *)(unsigned long)board->num_di_ports;
  5150. +       s->private = board->num_di_ports;
  5151.  
  5152.         /*
  5153.          * Use the io_bits to handle the inverted outputs.  Inverted
  5154. diff -u -p a/drivers/staging/lustre/lustre/obdclass/cl_object.c b/drivers/staging/lustre/lustre/obdclass/cl_object.c
  5155. --- a/drivers/staging/lustre/lustre/obdclass/cl_object.c
  5156. +++ b/drivers/staging/lustre/lustre/obdclass/cl_object.c
  5157. @@ -635,7 +635,7 @@ static inline void cl_env_attach(struct
  5158.         int rc;
  5159.  
  5160.         LASSERT(cle->ce_owner == NULL);
  5161. -       cle->ce_owner = (void *) (long) current->pid;
  5162. +       cle->ce_owner = current->pid;
  5163.         rc = cfs_hash_add_unique(cl_env_hash, cle->ce_owner,
  5164.                      &cle->ce_node);
  5165.         LASSERT(rc == 0);
  5166. diff -u -p a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
  5167. --- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
  5168. +++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
  5169. @@ -1349,7 +1349,7 @@ static int ldlm_res_hash_dump(struct cfs
  5170.                   struct hlist_node *hnode, void *arg)
  5171.  {
  5172.     struct ldlm_resource *res = cfs_hash_object(hs, hnode);
  5173. -   int    level = (int)(unsigned long)arg;
  5174. +   int    level = arg;
  5175.  
  5176.     lock_res(res);
  5177.     ldlm_resource_dump(level, res);
  5178. diff -u -p a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
  5179. --- a/drivers/platform/x86/hp-wmi.c
  5180. +++ b/drivers/platform/x86/hp-wmi.c
  5181. @@ -372,7 +372,7 @@ static bool hp_wmi_get_hw_state(enum hp_
  5182.  
  5183.  static int hp_wmi_rfkill2_set_block(void *data, bool blocked)
  5184.  {
  5185. -   int rfkill_id = (int)(long)data;
  5186. +   int rfkill_id = data;
  5187.     char buffer[4] = { 0x01, 0x00, rfkill_id, !blocked };
  5188.  
  5189.     if (hp_wmi_perform_query(HPWMI_WIRELESS2_QUERY, 1,
  5190. diff -u -p a/drivers/gpu/drm/drm_ioc32.c b/drivers/gpu/drm/drm_ioc32.c
  5191. --- a/drivers/gpu/drm/drm_ioc32.c
  5192. +++ b/drivers/gpu/drm/drm_ioc32.c
  5193. @@ -446,7 +446,7 @@ static int compat_drm_infobufs(struct fi
  5194.         return -EFAULT;
  5195.  
  5196.     count = req32.count;
  5197. -   to = (drm_buf_desc32_t __user *) (unsigned long)req32.list;
  5198. +   to = req32.list;
  5199.     if (count < 0)
  5200.         count = 0;
  5201.     if (count > 0
  5202. @@ -510,7 +510,7 @@ static int compat_drm_mapbufs(struct fil
  5203.     if (copy_from_user(&req32, argp, sizeof(req32)))
  5204.         return -EFAULT;
  5205.     count = req32.count;
  5206. -   list32 = (void __user *)(unsigned long)req32.list;
  5207. +   list32 = req32.list;
  5208.  
  5209.     if (count < 0)
  5210.         return -EINVAL;
  5211. diff -u -p a/drivers/gpu/drm/nouveau/nvif/object.c b/drivers/gpu/drm/nouveau/nvif/object.c
  5212. --- a/drivers/gpu/drm/nouveau/nvif/object.c
  5213. +++ b/drivers/gpu/drm/nouveau/nvif/object.c
  5214. @@ -247,7 +247,7 @@ nvif_object_init(struct nvif_object *par
  5215.         ctor->ioctl.type = NVIF_IOCTL_V0_NEW;
  5216.         ctor->new.version = 0;
  5217.         ctor->new.route = NVIF_IOCTL_V0_ROUTE_NVIF;
  5218. -       ctor->new.token = (unsigned long)(void *)object;
  5219. +       ctor->new.token = object;
  5220.         ctor->new.handle = handle;
  5221.         ctor->new.oclass = oclass;
  5222.  
  5223. diff -u -p a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
  5224. --- a/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
  5225. +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.c
  5226. @@ -2045,7 +2045,7 @@ int vmw_kms_update_layout_ioctl(struct d
  5227.     if (unlikely(!rects))
  5228.         return -ENOMEM;
  5229.  
  5230. -   user_rects = (void __user *)(unsigned long)arg->rects;
  5231. +   user_rects = arg->rects;
  5232.     ret = copy_from_user(rects, user_rects, rects_size);
  5233.     if (unlikely(ret != 0)) {
  5234.         DRM_ERROR("Failed to get rects.\n");
  5235. diff -u -p a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
  5236. --- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c
  5237. +++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c
  5238. @@ -419,7 +419,7 @@ int vidi_connection_ioctl(struct drm_dev
  5239.     }
  5240.  
  5241.     if (vidi->connection) {
  5242. -       struct edid *raw_edid  = (struct edid *)(uint32_t)vidi->edid;
  5243. +       struct edid *raw_edid  = vidi->edid;
  5244.         if (!drm_edid_is_valid(raw_edid)) {
  5245.             DRM_DEBUG_KMS("edid data is invalid.\n");
  5246.             return -EINVAL;
  5247. diff -u -p a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
  5248. --- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c
  5249. +++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c
  5250. @@ -1175,7 +1175,7 @@ int exynos_g2d_set_cmdlist_ioctl(struct
  5251.         goto err_free_event;
  5252.     }
  5253.  
  5254. -   cmd = (struct drm_exynos_g2d_cmd *)(uint32_t)req->cmd;
  5255. +   cmd = req->cmd;
  5256.  
  5257.     if (copy_from_user(cmdlist->data + cmdlist->last,
  5258.                 (void __user *)cmd,
  5259. @@ -1193,7 +1193,7 @@ int exynos_g2d_set_cmdlist_ioctl(struct
  5260.     if (req->cmd_buf_nr) {
  5261.         struct drm_exynos_g2d_cmd *cmd_buf;
  5262.  
  5263. -       cmd_buf = (struct drm_exynos_g2d_cmd *)(uint32_t)req->cmd_buf;
  5264. +       cmd_buf = req->cmd_buf;
  5265.  
  5266.         if (copy_from_user(cmdlist->data + cmdlist->last,
  5267.                     (void __user *)cmd_buf,
  5268. diff -u -p a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
  5269. --- a/drivers/gpu/drm/tegra/drm.c
  5270. +++ b/drivers/gpu/drm/tegra/drm.c
  5271. @@ -320,11 +320,11 @@ int tegra_drm_submit(struct tegra_drm_co
  5272.     unsigned int num_relocs = args->num_relocs;
  5273.     unsigned int num_waitchks = args->num_waitchks;
  5274.     struct drm_tegra_cmdbuf __user *cmdbufs =
  5275. -       (void __user *)(uintptr_t)args->cmdbufs;
  5276. +       args->cmdbufs;
  5277.     struct drm_tegra_reloc __user *relocs =
  5278. -       (void __user *)(uintptr_t)args->relocs;
  5279. +       args->relocs;
  5280.     struct drm_tegra_waitchk __user *waitchks =
  5281. -       (void __user *)(uintptr_t)args->waitchks;
  5282. +       args->waitchks;
  5283.     struct drm_tegra_syncpt syncpt;
  5284.     struct host1x_job *job;
  5285.     int err;
  5286. diff -u -p a/drivers/gpu/drm/radeon/radeon_cp.c b/drivers/gpu/drm/radeon/radeon_cp.c
  5287. --- a/drivers/gpu/drm/radeon/radeon_cp.c
  5288. +++ b/drivers/gpu/drm/radeon/radeon_cp.c
  5289. @@ -1351,11 +1351,11 @@ static int radeon_do_init_cp(struct drm_
  5290.  #endif
  5291.     {
  5292.         dev_priv->cp_ring->handle =
  5293. -           (void *)(unsigned long)dev_priv->cp_ring->offset;
  5294. +           dev_priv->cp_ring->offset;
  5295.         dev_priv->ring_rptr->handle =
  5296. -           (void *)(unsigned long)dev_priv->ring_rptr->offset;
  5297. +           dev_priv->ring_rptr->offset;
  5298.         dev->agp_buffer_map->handle =
  5299. -           (void *)(unsigned long)dev->agp_buffer_map->offset;
  5300. +           dev->agp_buffer_map->offset;
  5301.  
  5302.         DRM_DEBUG("dev_priv->cp_ring->handle %p\n",
  5303.               dev_priv->cp_ring->handle);
  5304. diff -u -p a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c
  5305. --- a/drivers/gpu/drm/radeon/radeon_cs.c
  5306. +++ b/drivers/gpu/drm/radeon/radeon_cs.c
  5307. @@ -274,7 +274,7 @@ int radeon_cs_parser_init(struct radeon_
  5308.     if (p->chunks_array == NULL) {
  5309.         return -ENOMEM;
  5310.     }
  5311. -   chunk_array_ptr = (uint64_t *)(unsigned long)(cs->chunks);
  5312. +   chunk_array_ptr = (cs->chunks);
  5313.     if (copy_from_user(p->chunks_array, chunk_array_ptr,
  5314.                    sizeof(uint64_t)*cs->num_chunks)) {
  5315.         return -EFAULT;
  5316. @@ -290,7 +290,7 @@ int radeon_cs_parser_init(struct radeon_
  5317.         struct drm_radeon_cs_chunk user_chunk;
  5318.         uint32_t __user *cdata;
  5319.  
  5320. -       chunk_ptr = (void __user*)(unsigned long)p->chunks_array[i];
  5321. +       chunk_ptr = p->chunks_array[i];
  5322.         if (copy_from_user(&user_chunk, chunk_ptr,
  5323.                        sizeof(struct drm_radeon_cs_chunk))) {
  5324.             return -EFAULT;
  5325. @@ -319,7 +319,7 @@ int radeon_cs_parser_init(struct radeon_
  5326.         }
  5327.  
  5328.         size = p->chunks[i].length_dw;
  5329. -       cdata = (void __user *)(unsigned long)user_chunk.chunk_data;
  5330. +       cdata = user_chunk.chunk_data;
  5331.         p->chunks[i].user_ptr = cdata;
  5332.         if (user_chunk.chunk_id == RADEON_CHUNK_ID_CONST_IB)
  5333.             continue;
  5334. diff -u -p a/drivers/gpu/drm/radeon/r300_cmdbuf.c b/drivers/gpu/drm/radeon/r300_cmdbuf.c
  5335. --- a/drivers/gpu/drm/radeon/r300_cmdbuf.c
  5336. +++ b/drivers/gpu/drm/radeon/r300_cmdbuf.c
  5337. @@ -922,7 +922,7 @@ static int r300_scratch(drm_radeon_priva
  5338.  
  5339.     ptr_addr = drm_buffer_read_object(cmdbuf->buffer,
  5340.             sizeof(stack_ptr_addr), &stack_ptr_addr);
  5341. -   ref_age_base = (u32 *)(unsigned long)get_unaligned(ptr_addr);
  5342. +   ref_age_base = get_unaligned(ptr_addr);
  5343.  
  5344.     for (i=0; i < header.scratch.n_bufs; i++) {
  5345.         buf_idx = drm_buffer_pointer_to_dword(cmdbuf->buffer, 0);
  5346. diff -u -p a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c
  5347. --- a/drivers/s390/cio/cio.c
  5348. +++ b/drivers/s390/cio/cio.c
  5349. @@ -136,7 +136,7 @@ cio_start_key (struct subchannel *sch,  /
  5350.  
  5351.     memset(orb, 0, sizeof(union orb));
  5352.     /* sch is always under 2G. */
  5353. -   orb->cmd.intparm = (u32)(addr_t)sch;
  5354. +   orb->cmd.intparm = sch;
  5355.     orb->cmd.fmt = 1;
  5356.  
  5357.     orb->cmd.pfch = priv->options.prefetch == 0;
  5358. @@ -564,7 +564,7 @@ static irqreturn_t do_cio_interrupt(int
  5359.     set_cpu_flag(CIF_NOHZ_DELAY);
  5360.     tpi_info = (struct tpi_info *) &get_irq_regs()->int_code;
  5361.     irb = this_cpu_ptr(&cio_irb);
  5362. -   sch = (struct subchannel *)(unsigned long) tpi_info->intparm;
  5363. +   sch = tpi_info->intparm;
  5364.     if (!sch) {
  5365.         /* Clear pending interrupt condition. */
  5366.         inc_irq_stat(IRQIO_CIO);
  5367. @@ -690,7 +690,7 @@ struct subchannel *cio_probe_console(voi
  5368.     lockdep_set_class(sch->lock, &console_sch_key);
  5369.     isc_register(CONSOLE_ISC);
  5370.     sch->config.isc = CONSOLE_ISC;
  5371. -   sch->config.intparm = (u32)(addr_t)sch;
  5372. +   sch->config.intparm = sch;
  5373.     ret = cio_commit_config(sch);
  5374.     if (ret) {
  5375.         isc_unregister(CONSOLE_ISC);
  5376. @@ -979,11 +979,11 @@ int cio_tm_start_key(struct subchannel *
  5377.     union orb *orb = &to_io_private(sch)->orb;
  5378.  
  5379.     memset(orb, 0, sizeof(union orb));
  5380. -   orb->tm.intparm = (u32) (addr_t) sch;
  5381. +   orb->tm.intparm = sch;
  5382.     orb->tm.key = key >> 4;
  5383.     orb->tm.b = 1;
  5384.     orb->tm.lpm = lpm ? lpm : sch->lpm;
  5385. -   orb->tm.tcw = (u32) (addr_t) tcw;
  5386. +   orb->tm.tcw = tcw;
  5387.     cc = ssch(sch->schid, orb);
  5388.     switch (cc) {
  5389.     case 0:
  5390. diff -u -p a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
  5391. --- a/drivers/s390/block/dasd.c
  5392. +++ b/drivers/s390/block/dasd.c
  5393. @@ -3738,11 +3738,11 @@ static struct dasd_ccw_req *dasd_generic
  5394.     ccw->cmd_code = CCW_CMD_RDC;
  5395.     if (idal_is_needed(rdc_buffer, rdc_buffer_size)) {
  5396.         idaw = (unsigned long *) (cqr->data);
  5397. -       ccw->cda = (__u32)(addr_t) idaw;
  5398. +       ccw->cda = idaw;
  5399.         ccw->flags = CCW_FLAG_IDA;
  5400.         idaw = idal_create_words(idaw, rdc_buffer, rdc_buffer_size);
  5401.     } else {
  5402. -       ccw->cda = (__u32)(addr_t) rdc_buffer;
  5403. +       ccw->cda = rdc_buffer;
  5404.         ccw->flags = 0;
  5405.     }
  5406.  
  5407. diff -u -p a/drivers/infiniband/hw/cxgb3/iwch_provider.c b/drivers/infiniband/hw/cxgb3/iwch_provider.c
  5408. --- a/drivers/infiniband/hw/cxgb3/iwch_provider.c
  5409. +++ b/drivers/infiniband/hw/cxgb3/iwch_provider.c
  5410. @@ -163,7 +163,7 @@ static struct ib_cq *iwch_create_cq(stru
  5411.                 kfree(chp);
  5412.                 return ERR_PTR(-EFAULT);
  5413.             }
  5414. -           chp->user_rptr_addr = (u32 __user *)(unsigned long)ureq.user_rptr_addr;
  5415. +           chp->user_rptr_addr = ureq.user_rptr_addr;
  5416.         }
  5417.     }
  5418.  
  5419. diff -u -p a/drivers/infiniband/hw/amso1100/c2_rnic.c b/drivers/infiniband/hw/amso1100/c2_rnic.c
  5420. --- a/drivers/infiniband/hw/amso1100/c2_rnic.c
  5421. +++ b/drivers/infiniband/hw/amso1100/c2_rnic.c
  5422. @@ -148,7 +148,7 @@ static int c2_rnic_query(struct c2_dev *
  5423.         goto bail1;
  5424.  
  5425.     reply =
  5426. -       (struct c2wr_rnic_query_rep *) (unsigned long) (vq_req->reply_msg);
  5427. +       (vq_req->reply_msg);
  5428.     if (!reply)
  5429.         err = -ENOMEM;
  5430.     else
  5431. @@ -252,7 +252,7 @@ int c2_add_addr(struct c2_dev *c2dev, __
  5432.         goto bail1;
  5433.  
  5434.     reply =
  5435. -       (struct c2wr_rnic_setconfig_rep *) (unsigned long) (vq_req->reply_msg);
  5436. +       (vq_req->reply_msg);
  5437.     if (!reply) {
  5438.         err = -ENOMEM;
  5439.         goto bail1;
  5440. @@ -314,7 +314,7 @@ int c2_del_addr(struct c2_dev *c2dev, __
  5441.         goto bail1;
  5442.  
  5443.     reply =
  5444. -       (struct c2wr_rnic_setconfig_rep *) (unsigned long) (vq_req->reply_msg);
  5445. +       (vq_req->reply_msg);
  5446.     if (!reply) {
  5447.         err = -ENOMEM;
  5448.         goto bail1;
  5449. @@ -366,7 +366,7 @@ static int c2_rnic_open(struct c2_dev *c
  5450.         goto bail0;
  5451.     }
  5452.  
  5453. -   reply = (struct c2wr_rnic_open_rep *) (unsigned long) (vq_req->reply_msg);
  5454. +   reply = (vq_req->reply_msg);
  5455.     if (!reply) {
  5456.         err = -ENOMEM;
  5457.         goto bail0;
  5458. @@ -418,7 +418,7 @@ static int c2_rnic_close(struct c2_dev *
  5459.         goto bail0;
  5460.     }
  5461.  
  5462. -   reply = (struct c2wr_rnic_close_rep *) (unsigned long) (vq_req->reply_msg);
  5463. +   reply = (vq_req->reply_msg);
  5464.     if (!reply) {
  5465.         err = -ENOMEM;
  5466.         goto bail0;
  5467. diff -u -p a/drivers/infiniband/hw/amso1100/c2_intr.c b/drivers/infiniband/hw/amso1100/c2_intr.c
  5468. --- a/drivers/infiniband/hw/amso1100/c2_intr.c
  5469. +++ b/drivers/infiniband/hw/amso1100/c2_intr.c
  5470. @@ -163,7 +163,7 @@ static void handle_vq(struct c2_dev *c2d
  5471.     /*
  5472.      * wakeup the waiter.
  5473.      */
  5474. -   req = (struct c2_vq_req *) (unsigned long) host_msg->context;
  5475. +   req = host_msg->context;
  5476.     if (req == NULL) {
  5477.         /*
  5478.          * We should never get here, as the adapter should
  5479. @@ -207,7 +207,7 @@ static void handle_vq(struct c2_dev *c2d
  5480.         break;
  5481.     }
  5482.  
  5483. -   req->reply_msg = (u64) (unsigned long) (reply_msg);
  5484. +   req->reply_msg = (reply_msg);
  5485.     atomic_set(&req->reply_ready, 1);
  5486.     wake_up(&req->wait_object);
  5487.  
  5488. diff -u -p a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
  5489. --- a/drivers/infiniband/hw/cxgb4/cm.c
  5490. +++ b/drivers/infiniband/hw/cxgb4/cm.c
  5491. @@ -3422,7 +3422,7 @@ static void passive_ofld_conn_reply(stru
  5492.     struct cpl_pass_accept_req *cpl;
  5493.     int ret;
  5494.  
  5495. -   rpl_skb = (struct sk_buff *)(unsigned long)req->cookie;
  5496. +   rpl_skb = req->cookie;
  5497.     BUG_ON(!rpl_skb);
  5498.     if (req->retval) {
  5499.         PDBG("%s passive open failure %d\n", __func__, req->retval);
  5500. @@ -3897,7 +3897,7 @@ static int fw6_msg(struct c4iw_dev *dev,
  5501.     switch (rpl->type) {
  5502.     case FW6_TYPE_WR_RPL:
  5503.         ret = (int)((be64_to_cpu(rpl->data[0]) >> 8) & 0xff);
  5504. -       wr_waitp = (struct c4iw_wr_wait *)(__force unsigned long) rpl->data[1];
  5505. +       wr_waitp = rpl->data[1];
  5506.         PDBG("%s wr_waitp %p ret %u\n", __func__, wr_waitp, ret);
  5507.         if (wr_waitp)
  5508.             c4iw_wake_up(wr_waitp, ret ? -ret : 0);
  5509. diff -u -p a/drivers/infiniband/hw/mlx5/mr.c b/drivers/infiniband/hw/mlx5/mr.c
  5510. --- a/drivers/infiniband/hw/mlx5/mr.c
  5511. +++ b/drivers/infiniband/hw/mlx5/mr.c
  5512. @@ -741,7 +741,7 @@ void mlx5_umr_cq_handler(struct ib_cq *c
  5513.         if (err == 0)
  5514.             break;
  5515.  
  5516. -       context = (struct mlx5_ib_umr_context *) (unsigned long) wc.wr_id;
  5517. +       context = wc.wr_id;
  5518.         context->status = wc.status;
  5519.         complete(&context->done);
  5520.     }
  5521. @@ -803,7 +803,7 @@ static struct mlx5_ib_mr *reg_umr(struct
  5522.     }
  5523.  
  5524.     memset(&wr, 0, sizeof(wr));
  5525. -   wr.wr_id = (u64)(unsigned long)&umr_context;
  5526. +   wr.wr_id = &umr_context;
  5527.     prep_umr_reg_wqe(pd, &wr, &sg, dma, npages, mr->mmr.key, page_shift,
  5528.              virt_addr, len, access_flags);
  5529.  
  5530. @@ -921,7 +921,7 @@ int mlx5_ib_update_mtt(struct mlx5_ib_mr
  5531.         dma_sync_single_for_device(ddev, dma, size, DMA_TO_DEVICE);
  5532.  
  5533.         memset(&wr, 0, sizeof(wr));
  5534. -       wr.wr_id = (u64)(unsigned long)&umr_context;
  5535. +       wr.wr_id = &umr_context;
  5536.  
  5537.         sg.addr = dma;
  5538.         sg.length = ALIGN(npages * sizeof(u64),
  5539. @@ -1143,7 +1143,7 @@ static int unreg_umr(struct mlx5_ib_dev
  5540.     int err;
  5541.  
  5542.     memset(&wr, 0, sizeof(wr));
  5543. -   wr.wr_id = (u64)(unsigned long)&umr_context;
  5544. +   wr.wr_id = &umr_context;
  5545.     prep_umr_unreg_wqe(dev, &wr, mr->mmr.key);
  5546.  
  5547.     mlx5_ib_init_umr_context(&umr_context);
  5548. diff -u -p a/drivers/infiniband/hw/nes/nes_hw.c b/drivers/infiniband/hw/nes/nes_hw.c
  5549. --- a/drivers/infiniband/hw/nes/nes_hw.c
  5550. +++ b/drivers/infiniband/hw/nes/nes_hw.c
  5551. @@ -3052,7 +3052,7 @@ static void nes_cqp_ce_handler(struct ne
  5552.                     ((u64)(le32_to_cpu(cq->cq_vbase[head].
  5553.                     cqe_words[NES_CQE_COMP_COMP_CTX_LOW_IDX])));
  5554.  
  5555. -           cqp_request = (struct nes_cqp_request *)(unsigned long)u64temp;
  5556. +           cqp_request = u64temp;
  5557.             if (cqp_request) {
  5558.                 if (cqp_request->waiting) {
  5559.                     /* nes_debug(NES_DBG_CQP, "%s: Waking up requestor\n"); */
  5560. @@ -3392,7 +3392,7 @@ static void nes_terminate_connection(str
  5561.         return;
  5562.     }
  5563.  
  5564. -   nesqp = (struct nes_qp *)(unsigned long)context;
  5565. +   nesqp = context;
  5566.     spin_lock_irqsave(&nesqp->lock, flags);
  5567.     nesqp->hw_iwarp_state = iwarp_state;
  5568.     nesqp->hw_tcp_state = tcp_state;
  5569. @@ -3521,7 +3521,7 @@ static void nes_terminate_received(struc
  5570.  /* Timeout routine in case terminate fails to complete */
  5571.  void nes_terminate_timeout(unsigned long context)
  5572.  {
  5573. -   struct nes_qp *nesqp = (struct nes_qp *)(unsigned long)context;
  5574. +   struct nes_qp *nesqp = context;
  5575.  
  5576.     nes_terminate_done(nesqp, 1);
  5577.  }
  5578. @@ -3565,7 +3565,7 @@ static void nes_process_iwarp_aeqe(struc
  5579.     }
  5580.  
  5581.     /* context is nesqp unless async_event_id == CQ ERROR */
  5582. -   nesqp = (struct nes_qp *)(unsigned long)context;
  5583. +   nesqp = context;
  5584.     async_event_id = (u16)aeq_info;
  5585.     tcp_state = (aeq_info & NES_AEQE_TCP_STATE_MASK) >> NES_AEQE_TCP_STATE_SHIFT;
  5586.     iwarp_state = (aeq_info & NES_AEQE_IWARP_STATE_MASK) >> NES_AEQE_IWARP_STATE_SHIFT;
  5587. @@ -3728,7 +3728,7 @@ static void nes_process_iwarp_aeqe(struc
  5588.             if (resource_allocated) {
  5589.                 printk(KERN_ERR PFX "%s: Processing an NES_AEQE_AEID_CQ_OPERATION_ERROR event on CQ%u\n",
  5590.                         __func__, le32_to_cpu(aeqe->aeqe_words[NES_AEQE_COMP_QP_CQ_ID_IDX]));
  5591. -               hw_cq = (struct nes_hw_cq *)(unsigned long)context;
  5592. +               hw_cq = context;
  5593.                 if (hw_cq) {
  5594.                     nescq = container_of(hw_cq, struct nes_cq, hw_cq);
  5595.                     if (nescq->ibcq.event_handler) {
  5596. diff -u -p a/drivers/infiniband/core/sa_query.c b/drivers/infiniband/core/sa_query.c
  5597. --- a/drivers/infiniband/core/sa_query.c
  5598. +++ b/drivers/infiniband/core/sa_query.c
  5599. @@ -1133,7 +1133,7 @@ static void recv_handler(struct ib_mad_a
  5600.     struct ib_sa_query *query;
  5601.     struct ib_mad_send_buf *mad_buf;
  5602.  
  5603. -   mad_buf = (void *) (unsigned long) mad_recv_wc->wc->wr_id;
  5604. +   mad_buf = mad_recv_wc->wc->wr_id;
  5605.     query = mad_buf->context[0];
  5606.  
  5607.     if (query->callback) {
  5608. diff -u -p a/drivers/infiniband/ulp/iser/iser_verbs.c b/drivers/infiniband/ulp/iser/iser_verbs.c
  5609. --- a/drivers/infiniband/ulp/iser/iser_verbs.c
  5610. +++ b/drivers/infiniband/ulp/iser/iser_verbs.c
  5611. @@ -1201,7 +1201,7 @@ static void
  5612.  iser_handle_comp_error(struct ib_conn *ib_conn,
  5613.                struct ib_wc *wc)
  5614.  {
  5615. -   void *wr_id = (void *)(uintptr_t)wc->wr_id;
  5616. +   void *wr_id = wc->wr_id;
  5617.     struct iser_conn *iser_conn = container_of(ib_conn, struct iser_conn,
  5618.                            ib_conn);
  5619.  
  5620. @@ -1237,12 +1237,12 @@ static void iser_handle_wc(struct ib_wc
  5621.     ib_conn = wc->qp->qp_context;
  5622.     if (likely(wc->status == IB_WC_SUCCESS)) {
  5623.         if (wc->opcode == IB_WC_RECV) {
  5624. -           rx_desc = (struct iser_rx_desc *)(uintptr_t)wc->wr_id;
  5625. +           rx_desc = wc->wr_id;
  5626.             iser_rcv_completion(rx_desc, wc->byte_len,
  5627.                         ib_conn);
  5628.         } else
  5629.         if (wc->opcode == IB_WC_SEND) {
  5630. -           tx_desc = (struct iser_tx_desc *)(uintptr_t)wc->wr_id;
  5631. +           tx_desc = wc->wr_id;
  5632.             iser_snd_completion(tx_desc, ib_conn);
  5633.         } else {
  5634.             iser_err("Unknown wc opcode %d\n", wc->opcode);
  5635. diff -u -p a/drivers/sbus/char/envctrl.c b/drivers/sbus/char/envctrl.c
  5636. --- a/drivers/sbus/char/envctrl.c
  5637. +++ b/drivers/sbus/char/envctrl.c
  5638. @@ -665,7 +665,7 @@ envctrl_ioctl(struct file *file, unsigne
  5639.     case ENVCTRL_RD_ETHERNET_TEMPERATURE:
  5640.     case ENVCTRL_RD_SCSI_TEMPERATURE:
  5641.     case ENVCTRL_RD_GLOBALADDRESS:
  5642. -       file->private_data = (void *)(long)cmd;
  5643. +       file->private_data = cmd;
  5644.         break;
  5645.  
  5646.     case ENVCTRL_RD_CPU_TEMPERATURE:
  5647. @@ -681,7 +681,7 @@ envctrl_ioctl(struct file *file, unsigne
  5648.         }
  5649.  
  5650.         /* Save the command for use when reading. */
  5651. -       file->private_data = (void *)(long)cmd;
  5652. +       file->private_data = cmd;
  5653.         break;
  5654.  
  5655.     default:
  5656. diff -u -p a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c
  5657. --- a/drivers/message/fusion/mptctl.c
  5658. +++ b/drivers/message/fusion/mptctl.c
  5659. @@ -2897,10 +2897,10 @@ compat_mpt_command(struct file *filp, un
  5660.     karg.maxSenseBytes = karg32.maxSenseBytes;
  5661.     karg.dataSgeOffset = karg32.dataSgeOffset;
  5662.  
  5663. -   karg.replyFrameBufPtr = (char __user *)(unsigned long)karg32.replyFrameBufPtr;
  5664. -   karg.dataInBufPtr = (char __user *)(unsigned long)karg32.dataInBufPtr;
  5665. -   karg.dataOutBufPtr = (char __user *)(unsigned long)karg32.dataOutBufPtr;
  5666. -   karg.senseDataPtr = (char __user *)(unsigned long)karg32.senseDataPtr;
  5667. +   karg.replyFrameBufPtr = karg32.replyFrameBufPtr;
  5668. +   karg.dataInBufPtr = karg32.dataInBufPtr;
  5669. +   karg.dataOutBufPtr = karg32.dataOutBufPtr;
  5670. +   karg.senseDataPtr = karg32.senseDataPtr;
  5671.  
  5672.     /* Pass new structure to do_mpt_command
  5673.      */
  5674. diff -u -p a/drivers/isdn/hardware/eicon/os_bri.c b/drivers/isdn/hardware/eicon/os_bri.c
  5675. --- a/drivers/isdn/hardware/eicon/os_bri.c
  5676. +++ b/drivers/isdn/hardware/eicon/os_bri.c
  5677. @@ -383,7 +383,7 @@ static int diva_bri_reregister_io(diva_o
  5678.                 return (-1);
  5679.         }
  5680.         a->resources.pci.addr[i] =
  5681. -           (void *) (unsigned long) a->resources.pci.bar[i];
  5682. +           a->resources.pci.bar[i];
  5683.     }
  5684.  
  5685.     return (0);
  5686. diff -u -p a/drivers/video/fbdev/s3fb.c b/drivers/video/fbdev/s3fb.c
  5687. --- a/drivers/video/fbdev/s3fb.c
  5688. +++ b/drivers/video/fbdev/s3fb.c
  5689. @@ -1182,7 +1182,7 @@ static int s3_pci_probe(struct pci_dev *
  5690.  
  5691.     pcibios_bus_to_resource(dev->bus, &vga_res, &bus_reg);
  5692.  
  5693. -   par->state.vgabase = (void __iomem *) (unsigned long) vga_res.start;
  5694. +   par->state.vgabase = vga_res.start;
  5695.  
  5696.     /* Unlock regs */
  5697.     cr38 = vga_rcrt(par->state.vgabase, 0x38);
  5698. diff -u -p a/drivers/media/dvb-frontends/stb0899_drv.c b/drivers/media/dvb-frontends/stb0899_drv.c
  5699. --- a/drivers/media/dvb-frontends/stb0899_drv.c
  5700. +++ b/drivers/media/dvb-frontends/stb0899_drv.c
  5701. @@ -978,7 +978,7 @@ static int stb0899_read_signal_strength(
  5702.             if (STB0899_GETFIELD(VSTATUS_LOCKEDVIT, reg)) {
  5703.  
  5704.                 reg = stb0899_read_reg(state, STB0899_AGCIQIN);
  5705. -               val = (s32)(s8)STB0899_GETFIELD(AGCIQVALUE, reg);
  5706. +               val = STB0899_GETFIELD(AGCIQVALUE, reg);
  5707.  
  5708.                 *strength = stb0899_table_lookup(stb0899_dvbsrf_tab, ARRAY_SIZE(stb0899_dvbsrf_tab) - 1, val);
  5709.                 *strength += 750;
  5710. diff -u -p a/drivers/crypto/qat/qat_common/qat_algs.c b/drivers/crypto/qat/qat_common/qat_algs.c
  5711. --- a/drivers/crypto/qat/qat_common/qat_algs.c
  5712. +++ b/drivers/crypto/qat/qat_common/qat_algs.c
  5713. @@ -828,7 +828,7 @@ void qat_alg_callback(void *resp)
  5714.  {
  5715.     struct icp_qat_fw_la_resp *qat_resp = resp;
  5716.     struct qat_crypto_request *qat_req =
  5717. -               (void *)(__force long)qat_resp->opaque_data;
  5718. +               qat_resp->opaque_data;
  5719.  
  5720.     qat_req->cb(qat_resp, qat_req);
  5721.  }
  5722. @@ -855,7 +855,7 @@ static int qat_alg_aead_dec(struct aead_
  5723.     qat_req->aead_ctx = ctx;
  5724.     qat_req->aead_req = areq;
  5725.     qat_req->cb = qat_aead_alg_callback;
  5726. -   qat_req->req.comn_mid.opaque_data = (uint64_t)(__force long)qat_req;
  5727. +   qat_req->req.comn_mid.opaque_data = qat_req;
  5728.     qat_req->req.comn_mid.src_data_addr = qat_req->buf.blp;
  5729.     qat_req->req.comn_mid.dest_data_addr = qat_req->buf.bloutp;
  5730.     cipher_param = (void *)&qat_req->req.serv_specif_rqpars;
  5731. @@ -899,7 +899,7 @@ static int qat_alg_aead_enc_internal(str
  5732.     qat_req->aead_ctx = ctx;
  5733.     qat_req->aead_req = areq;
  5734.     qat_req->cb = qat_aead_alg_callback;
  5735. -   qat_req->req.comn_mid.opaque_data = (uint64_t)(__force long)qat_req;
  5736. +   qat_req->req.comn_mid.opaque_data = qat_req;
  5737.     qat_req->req.comn_mid.src_data_addr = qat_req->buf.blp;
  5738.     qat_req->req.comn_mid.dest_data_addr = qat_req->buf.bloutp;
  5739.     cipher_param = (void *)&qat_req->req.serv_specif_rqpars;
  5740. @@ -1027,7 +1027,7 @@ static int qat_alg_ablkcipher_encrypt(st
  5741.     qat_req->ablkcipher_ctx = ctx;
  5742.     qat_req->ablkcipher_req = req;
  5743.     qat_req->cb = qat_ablkcipher_alg_callback;
  5744. -   qat_req->req.comn_mid.opaque_data = (uint64_t)(__force long)qat_req;
  5745. +   qat_req->req.comn_mid.opaque_data = qat_req;
  5746.     qat_req->req.comn_mid.src_data_addr = qat_req->buf.blp;
  5747.     qat_req->req.comn_mid.dest_data_addr = qat_req->buf.bloutp;
  5748.     cipher_param = (void *)&qat_req->req.serv_specif_rqpars;
  5749. @@ -1065,7 +1065,7 @@ static int qat_alg_ablkcipher_decrypt(st
  5750.     qat_req->ablkcipher_ctx = ctx;
  5751.     qat_req->ablkcipher_req = req;
  5752.     qat_req->cb = qat_ablkcipher_alg_callback;
  5753. -   qat_req->req.comn_mid.opaque_data = (uint64_t)(__force long)qat_req;
  5754. +   qat_req->req.comn_mid.opaque_data = qat_req;
  5755.     qat_req->req.comn_mid.src_data_addr = qat_req->buf.blp;
  5756.     qat_req->req.comn_mid.dest_data_addr = qat_req->buf.bloutp;
  5757.     cipher_param = (void *)&qat_req->req.serv_specif_rqpars;
  5758. diff -u -p a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
  5759. --- a/drivers/block/drbd/drbd_receiver.c
  5760. +++ b/drivers/block/drbd/drbd_receiver.c
  5761. @@ -1825,7 +1825,7 @@ find_request(struct drbd_device *device,
  5762.     struct drbd_request *req;
  5763.  
  5764.     /* Request object according to our peer */
  5765. -   req = (struct drbd_request *)(unsigned long)id;
  5766. +   req = id;
  5767.     if (drbd_contains_interval(root, sector, &req->i) && req->i.local)
  5768.         return req;
  5769.     if (!missing_ok) {
  5770. diff -u -p a/drivers/block/aoe/aoechr.c b/drivers/block/aoe/aoechr.c
  5771. --- a/drivers/block/aoe/aoechr.c
  5772. +++ b/drivers/block/aoe/aoechr.c
  5773. @@ -192,7 +192,7 @@ aoechr_open(struct inode *inode, struct
  5774.  
  5775.     mutex_lock(&aoechr_mutex);
  5776.     n = iminor(inode);
  5777. -   filp->private_data = (void *) (unsigned long) n;
  5778. +   filp->private_data = n;
  5779.  
  5780.     for (i = 0; i < ARRAY_SIZE(chardevs); ++i)
  5781.         if (chardevs[i].minor == n) {
  5782. diff -u -p a/drivers/char/agp/uninorth-agp.c b/drivers/char/agp/uninorth-agp.c
  5783. --- a/drivers/char/agp/uninorth-agp.c
  5784. +++ b/drivers/char/agp/uninorth-agp.c
  5785. @@ -329,7 +329,7 @@ static int agp_uninorth_suspend(struct p
  5786.     /* turn off AGP on the bridge */
  5787.     agp = pci_find_capability(pdev, PCI_CAP_ID_AGP);
  5788.     pci_read_config_dword(pdev, agp + PCI_AGP_COMMAND, &cmd);
  5789. -   bridge->dev_private_data = (void *)(long)cmd;
  5790. +   bridge->dev_private_data = cmd;
  5791.     if (cmd & PCI_AGP_COMMAND_AGP) {
  5792.         dev_info(&pdev->dev, "disabling AGP on bridge\n");
  5793.         cmd &= ~PCI_AGP_COMMAND_AGP;
  5794. diff -u -p a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c
  5795. --- a/drivers/usb/serial/visor.c
  5796. +++ b/drivers/usb/serial/visor.c
  5797. @@ -468,7 +468,7 @@ static int visor_probe(struct usb_serial
  5798.  
  5799.  static int visor_calc_num_ports(struct usb_serial *serial)
  5800.  {
  5801. -   int num_ports = (int)(long)(usb_get_serial_data(serial));
  5802. +   int num_ports = (usb_get_serial_data(serial));
  5803.  
  5804.     if (num_ports)
  5805.         usb_set_serial_data(serial, NULL);
  5806. diff -u -p a/drivers/scsi/qla2xxx/qla_mr.c b/drivers/scsi/qla2xxx/qla_mr.c
  5807. --- a/drivers/scsi/qla2xxx/qla_mr.c
  5808. +++ b/drivers/scsi/qla2xxx/qla_mr.c
  5809. @@ -3138,7 +3138,7 @@ qlafx00_start_scsi(srb_t *sp)
  5810.     req->current_outstanding_cmd = handle;
  5811.     req->outstanding_cmds[handle] = sp;
  5812.     sp->handle = handle;
  5813. -   cmd->host_scribble = (unsigned char *)(unsigned long)handle;
  5814. +   cmd->host_scribble = handle;
  5815.     req->cnt -= req_cnt;
  5816.  
  5817.     cmd_pkt = (struct cmd_type_7_fx00 *)req->ring_ptr;
  5818. diff -u -p a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c
  5819. --- a/drivers/scsi/scsi_transport_sas.c
  5820. +++ b/drivers/scsi/scsi_transport_sas.c
  5821. @@ -331,7 +331,7 @@ static int sas_host_match(struct attribu
  5822.  
  5823.  static int do_sas_phy_delete(struct device *dev, void *data)
  5824.  {
  5825. -   int pass = (int)(unsigned long)data;
  5826. +   int pass = data;
  5827.  
  5828.     if (pass == 0 && scsi_is_sas_port(dev))
  5829.         sas_port_delete(dev_to_sas_port(dev));
  5830. diff -u -p a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c
  5831. --- a/drivers/scsi/qla4xxx/ql4_os.c
  5832. +++ b/drivers/scsi/qla4xxx/ql4_os.c
  5833. @@ -9089,7 +9089,7 @@ struct srb *qla4xxx_del_from_active_arra
  5834.         ha->iocb_cnt -= srb->iocb_cnt;
  5835.         if (srb->cmd)
  5836.             srb->cmd->host_scribble =
  5837. -               (unsigned char *)(unsigned long) MAX_SRBS;
  5838. +               MAX_SRBS;
  5839.     }
  5840.     return srb;
  5841.  }
  5842. diff -u -p a/arch/arm/kvm/guest.c b/arch/arm/kvm/guest.c
  5843. --- a/arch/arm/kvm/guest.c
  5844. +++ b/arch/arm/kvm/guest.c
  5845. @@ -48,7 +48,7 @@ static u64 core_reg_offset_from_id(u64 i
  5846.  
  5847.  static int get_core_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
  5848.  {
  5849. -   u32 __user *uaddr = (u32 __user *)(long)reg->addr;
  5850. +   u32 __user *uaddr = reg->addr;
  5851.     struct kvm_regs *regs = &vcpu->arch.regs;
  5852.     u64 off;
  5853.  
  5854. @@ -65,7 +65,7 @@ static int get_core_reg(struct kvm_vcpu
  5855.  
  5856.  static int set_core_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
  5857.  {
  5858. -   u32 __user *uaddr = (u32 __user *)(long)reg->addr;
  5859. +   u32 __user *uaddr = reg->addr;
  5860.     struct kvm_regs *regs = &vcpu->arch.regs;
  5861.     u64 off, val;
  5862.  
  5863. @@ -156,7 +156,7 @@ static int copy_timer_indices(struct kvm
  5864.  
  5865.  static int set_timer_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
  5866.  {
  5867. -   void __user *uaddr = (void __user *)(long)reg->addr;
  5868. +   void __user *uaddr = reg->addr;
  5869.     u64 val;
  5870.     int ret;
  5871.  
  5872. @@ -169,7 +169,7 @@ static int set_timer_reg(struct kvm_vcpu
  5873.  
  5874.  static int get_timer_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
  5875.  {
  5876. -   void __user *uaddr = (void __user *)(long)reg->addr;
  5877. +   void __user *uaddr = reg->addr;
  5878.     u64 val;
  5879.  
  5880.     val = kvm_arm_timer_get_reg(vcpu, reg->id);
  5881. diff -u -p a/arch/sparc/kernel/sysfs.c b/arch/sparc/kernel/sysfs.c
  5882. --- a/arch/sparc/kernel/sysfs.c
  5883. +++ b/arch/sparc/kernel/sysfs.c
  5884. @@ -249,7 +249,7 @@ static void unregister_cpu_online(unsign
  5885.  static int sysfs_cpu_notify(struct notifier_block *self,
  5886.                       unsigned long action, void *hcpu)
  5887.  {
  5888. -   unsigned int cpu = (unsigned int)(long)hcpu;
  5889. +   unsigned int cpu = hcpu;
  5890.  
  5891.     switch (action) {
  5892.     case CPU_ONLINE:
  5893. diff -u -p a/arch/s390/kernel/crash_dump.c b/arch/s390/kernel/crash_dump.c
  5894. --- a/arch/s390/kernel/crash_dump.c
  5895. +++ b/arch/s390/kernel/crash_dump.c
  5896. @@ -659,7 +659,7 @@ void elfcorehdr_free(unsigned long long
  5897.   */
  5898.  ssize_t elfcorehdr_read(char *buf, size_t count, u64 *ppos)
  5899.  {
  5900. -   void *src = (void *)(unsigned long)*ppos;
  5901. +   void *src = *ppos;
  5902.  
  5903.     src = elfcorehdr_newmem ? src : src - OLDMEM_BASE;
  5904.     memcpy(buf, src, count);
  5905. @@ -672,7 +672,7 @@ ssize_t elfcorehdr_read(char *buf, size_
  5906.   */
  5907.  ssize_t elfcorehdr_read_notes(char *buf, size_t count, u64 *ppos)
  5908.  {
  5909. -   void *src = (void *)(unsigned long)*ppos;
  5910. +   void *src = *ppos;
  5911.     int rc;
  5912.  
  5913.     if (elfcorehdr_newmem) {
  5914. diff -u -p a/arch/s390/kernel/machine_kexec.c b/arch/s390/kernel/machine_kexec.c
  5915. --- a/arch/s390/kernel/machine_kexec.c
  5916. +++ b/arch/s390/kernel/machine_kexec.c
  5917. @@ -58,7 +58,7 @@ static void setup_regs(void)
  5918.     int cpu, this_cpu;
  5919.  
  5920.     /* Get lowcore pointer from store status of this CPU (absolute zero) */
  5921. -   lc = (struct _lowcore *)(unsigned long)S390_lowcore.prefixreg_save_area;
  5922. +   lc = S390_lowcore.prefixreg_save_area;
  5923.     this_cpu = smp_find_processor_id(stap());
  5924.     add_elf_notes(this_cpu);
  5925.     for_each_online_cpu(cpu) {
  5926. diff -u -p a/arch/s390/kernel/os_info.c b/arch/s390/kernel/os_info.c
  5927. --- a/arch/s390/kernel/os_info.c
  5928. +++ b/arch/s390/kernel/os_info.c
  5929. @@ -34,8 +34,8 @@ u32 os_info_csum(struct os_info *os_info
  5930.   */
  5931.  void os_info_crashkernel_add(unsigned long base, unsigned long size)
  5932.  {
  5933. -   os_info.crashkernel_addr = (u64)(unsigned long)base;
  5934. -   os_info.crashkernel_size = (u64)(unsigned long)size;
  5935. +   os_info.crashkernel_addr = base;
  5936. +   os_info.crashkernel_size = size;
  5937.     os_info.csum = os_info_csum(&os_info);
  5938.  }
  5939.  
  5940. @@ -44,7 +44,7 @@ void os_info_crashkernel_add(unsigned lo
  5941.   */
  5942.  void os_info_entry_add(int nr, void *ptr, u64 size)
  5943.  {
  5944. -   os_info.entry[nr].addr = (u64)(unsigned long)ptr;
  5945. +   os_info.entry[nr].addr = ptr;
  5946.     os_info.entry[nr].size = size;
  5947.     os_info.entry[nr].csum = csum_partial(ptr, size, 0);
  5948.     os_info.csum = os_info_csum(&os_info);
  5949. @@ -98,7 +98,7 @@ static void os_info_old_alloc(int nr, in
  5950.         msg = "checksum failed";
  5951.         goto fail_free;
  5952.     }
  5953. -   os_info_old->entry[nr].addr = (u64)(unsigned long)buf_align;
  5954. +   os_info_old->entry[nr].addr = buf_align;
  5955.     msg = "copied";
  5956.     goto out;
  5957.  fail_free:
  5958. diff -u -p a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
  5959. --- a/arch/s390/kvm/kvm-s390.c
  5960. +++ b/arch/s390/kvm/kvm-s390.c
  5961. @@ -815,7 +815,7 @@ static int kvm_s390_apxa_installed(void)
  5962.  
  5963.  static void kvm_s390_set_crycb_format(struct kvm *kvm)
  5964.  {
  5965. -   kvm->arch.crypto.crycbd = (__u32)(unsigned long) kvm->arch.crypto.crycb;
  5966. +   kvm->arch.crypto.crycbd = kvm->arch.crypto.crycb;
  5967.  
  5968.     if (kvm_s390_apxa_installed())
  5969.         kvm->arch.crypto.crycbd |= CRYCB_FORMAT2;
  5970. @@ -1202,10 +1202,10 @@ struct kvm_vcpu *kvm_arch_vcpu_create(st
  5971.                 (__u64) vcpu->arch.sie_block;
  5972.         vcpu->arch.sie_block->scaoh =
  5973.             (__u32)(((__u64)kvm->arch.sca) >> 32);
  5974. -       vcpu->arch.sie_block->scaol = (__u32)(__u64)kvm->arch.sca;
  5975. +       vcpu->arch.sie_block->scaol = kvm->arch.sca;
  5976.         set_bit(63 - id, (unsigned long *) &kvm->arch.sca->mcn);
  5977.     }
  5978. -   vcpu->arch.sie_block->fac = (int) (long) kvm->arch.model.fac->list;
  5979. +   vcpu->arch.sie_block->fac = kvm->arch.model.fac->list;
  5980.  
  5981.     spin_lock_init(&vcpu->arch.local_int.lock);
  5982.     vcpu->arch.local_int.float_int = &kvm->arch.float_int;
  5983. diff -u -p a/arch/mips/netlogic/xlr/setup.c b/arch/mips/netlogic/xlr/setup.c
  5984. --- a/arch/mips/netlogic/xlr/setup.c
  5985. +++ b/arch/mips/netlogic/xlr/setup.c
  5986. @@ -107,7 +107,7 @@ static void __init build_arcs_cmdline(in
  5987.     remain = sizeof(arcs_cmdline) - 1;
  5988.     arcs_cmdline[0] = '\0';
  5989.     for (i = 0; argv[i] != 0; i++) {
  5990. -       arg = (char *)(long)argv[i];
  5991. +       arg = argv[i];
  5992.         len = strlen(arg);
  5993.         if (len + 1 > remain)
  5994.             break;
  5995. @@ -147,7 +147,7 @@ static void prom_add_memory(void)
  5996.     u64 pref_backup = 512;  /* avoid pref walking beyond end */
  5997.     int i;
  5998.  
  5999. -   bootm = (void *)(long)nlm_prom_info.psb_mem_map;
  6000. +   bootm = nlm_prom_info.psb_mem_map;
  6001.     for (i = 0; i < bootm->nr_map; i++) {
  6002.         if (bootm->map[i].type != BOOT_MEM_RAM)
  6003.             continue;
  6004. @@ -182,9 +182,9 @@ void __init prom_init(void)
  6005.  #endif
  6006.  
  6007.     /* truncate to 32 bit and sign extend all args */
  6008. -   argv = (int *)(long)(int)fw_arg1;
  6009. -   envp = (int *)(long)(int)fw_arg2;
  6010. -   prom_infop = (struct psb_info *)(long)(int)fw_arg3;
  6011. +   argv = (int)fw_arg1;
  6012. +   envp = (int)fw_arg2;
  6013. +   prom_infop = (int)fw_arg3;
  6014.  
  6015.     nlm_prom_info = *prom_infop;
  6016.     nlm_init_node();
  6017. diff -u -p a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
  6018. --- a/arch/arm64/kvm/sys_regs.c
  6019. +++ b/arch/arm64/kvm/sys_regs.c
  6020. @@ -1291,7 +1291,7 @@ static int demux_c15_set(u64 id, void __
  6021.  int kvm_arm_sys_reg_get_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
  6022.  {
  6023.     const struct sys_reg_desc *r;
  6024. -   void __user *uaddr = (void __user *)(unsigned long)reg->addr;
  6025. +   void __user *uaddr = reg->addr;
  6026.  
  6027.     if ((reg->id & KVM_REG_ARM_COPROC_MASK) == KVM_REG_ARM_DEMUX)
  6028.         return demux_c15_get(reg->id, uaddr);
  6029. @@ -1309,7 +1309,7 @@ int kvm_arm_sys_reg_get_reg(struct kvm_v
  6030.  int kvm_arm_sys_reg_set_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
  6031.  {
  6032.     const struct sys_reg_desc *r;
  6033. -   void __user *uaddr = (void __user *)(unsigned long)reg->addr;
  6034. +   void __user *uaddr = reg->addr;
  6035.  
  6036.     if ((reg->id & KVM_REG_ARM_COPROC_MASK) == KVM_REG_ARM_DEMUX)
  6037.         return demux_c15_set(reg->id, uaddr);
  6038. diff -u -p a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c
  6039. --- a/arch/x86/platform/efi/efi_64.c
  6040. +++ b/arch/x86/platform/efi/efi_64.c
  6041. @@ -148,7 +148,7 @@ int __init efi_setup_page_tables(unsigne
  6042.     if (efi_enabled(EFI_OLD_MEMMAP))
  6043.         return 0;
  6044.  
  6045. -   efi_scratch.efi_pgt = (pgd_t *)(unsigned long)real_mode_header->trampoline_pgd;
  6046. +   efi_scratch.efi_pgt = real_mode_header->trampoline_pgd;
  6047.     pgd = __va(efi_scratch.efi_pgt);
  6048.  
  6049.     /*
  6050. @@ -377,7 +377,7 @@ efi_status_t efi_thunk_set_virtual_addre
  6051.     write_cr3((unsigned long)efi_scratch.efi_pgt);
  6052.     __flush_tlb_all();
  6053.  
  6054. -   func = (u32)(unsigned long)phys_set_virtual_address_map;
  6055. +   func = phys_set_virtual_address_map;
  6056.     status = efi64_thunk(func, memory_map_size, descriptor_size,
  6057.                  descriptor_version, virtual_map);
  6058.  
  6059. diff -u -p a/arch/x86/kernel/devicetree.c b/arch/x86/kernel/devicetree.c
  6060. --- a/arch/x86/kernel/devicetree.c
  6061. +++ b/arch/x86/kernel/devicetree.c
  6062. @@ -214,7 +214,7 @@ static int ioapic_xlate(struct irq_domai
  6063.  
  6064.     it = &of_ioapic_type[intspec[1]];
  6065.  
  6066. -   idx = (u32)(long)domain->host_data;
  6067. +   idx = domain->host_data;
  6068.     gsi = mp_pin_to_gsi(idx, line);
  6069.     if (mp_set_gsi_attr(gsi, it->trigger, it->polarity, cpu_to_node(0)))
  6070.         return -EBUSY;
  6071. diff -u -p a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
  6072. --- a/arch/x86/kernel/apic/io_apic.c
  6073. +++ b/arch/x86/kernel/apic/io_apic.c
  6074. @@ -941,7 +941,7 @@ static int irq_trigger(int idx)
  6075.  static int alloc_irq_from_domain(struct irq_domain *domain, u32 gsi, int pin)
  6076.  {
  6077.     int irq = -1;
  6078. -   int ioapic = (int)(long)domain->host_data;
  6079. +   int ioapic = domain->host_data;
  6080.     int type = ioapics[ioapic].irqdomain_cfg.type;
  6081.  
  6082.     switch (type) {
  6083. @@ -1086,7 +1086,7 @@ void mp_unmap_irq(int irq)
  6084.     if (!data || !data->domain)
  6085.         return;
  6086.  
  6087. -   ioapic = (int)(long)data->domain->host_data;
  6088. +   ioapic = data->domain->host_data;
  6089.     pin = (int)data->hwirq;
  6090.     info = mp_pin_info(ioapic, pin);
  6091.  
  6092. @@ -3019,7 +3019,7 @@ static inline void set_io_apic_irq_attr(
  6093.  int mp_irqdomain_map(struct irq_domain *domain, unsigned int virq,
  6094.              irq_hw_number_t hwirq)
  6095.  {
  6096. -   int ioapic = (int)(long)domain->host_data;
  6097. +   int ioapic = domain->host_data;
  6098.     struct mp_pin_info *info = mp_pin_info(ioapic, hwirq);
  6099.     struct io_apic_irq_attr attr;
  6100.  
  6101. @@ -3057,7 +3057,7 @@ void mp_irqdomain_unmap(struct irq_domai
  6102.  {
  6103.     struct irq_data *data = irq_get_irq_data(virq);
  6104.     struct irq_cfg *cfg = irq_cfg(virq);
  6105. -   int ioapic = (int)(long)domain->host_data;
  6106. +   int ioapic = domain->host_data;
  6107.     int pin = (int)data->hwirq;
  6108.  
  6109.     ioapic_mask_entry(ioapic, pin);
  6110. diff -u -p a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c
  6111. --- a/arch/x86/kvm/pmu.c
  6112. +++ b/arch/x86/kvm/pmu.c
  6113. @@ -414,7 +414,7 @@ int kvm_pmu_set_msr(struct kvm_vcpu *vcp
  6114.         if ((pmc = get_gp_pmc(pmu, index, MSR_IA32_PERFCTR0)) ||
  6115.                 (pmc = get_fixed_pmc(pmu, index))) {
  6116.             if (!msr_info->host_initiated)
  6117. -               data = (s64)(s32)data;
  6118. +               data = data;
  6119.             pmc->counter += data - read_pmc(pmc);
  6120.             return 0;
  6121.         } else if ((pmc = get_gp_pmc(pmu, index, MSR_P6_EVNTSEL0))) {
  6122. diff -u -p a/arch/sh/kernel/cpu/sh4a/smp-shx3.c b/arch/sh/kernel/cpu/sh4a/smp-shx3.c
  6123. --- a/arch/sh/kernel/cpu/sh4a/smp-shx3.c
  6124. +++ b/arch/sh/kernel/cpu/sh4a/smp-shx3.c
  6125. @@ -29,7 +29,7 @@
  6126.  
  6127.  static irqreturn_t ipi_interrupt_handler(int irq, void *arg)
  6128.  {
  6129. -   unsigned int message = (unsigned int)(long)arg;
  6130. +   unsigned int message = arg;
  6131.     unsigned int cpu = hard_smp_processor_id();
  6132.     unsigned int offs = 4 * cpu;
  6133.     unsigned int x;
  6134. diff -u -p a/arch/sh/mm/cache-sh5.c b/arch/sh/mm/cache-sh5.c
  6135. --- a/arch/sh/mm/cache-sh5.c
  6136. +++ b/arch/sh/mm/cache-sh5.c
  6137. @@ -74,9 +74,9 @@ static void sh64_icache_inv_kernel_range
  6138.      * the addresses lie in the kernel superpage. */
  6139.  
  6140.     unsigned long long ullend, addr, aligned_start;
  6141. -   aligned_start = (unsigned long long)(signed long long)(signed long) start;
  6142. +   aligned_start = (signed long) start;
  6143.     addr = L1_CACHE_ALIGN(aligned_start);
  6144. -   ullend = (unsigned long long) (signed long long) (signed long) end;
  6145. +   ullend = (signed long) end;
  6146.  
  6147.     while (addr <= ullend) {
  6148.         __asm__ __volatile__ ("icbi %0, 0" : : "r" (addr));
  6149. diff -u -p a/arch/powerpc/kernel/sysfs.c b/arch/powerpc/kernel/sysfs.c
  6150. --- a/arch/powerpc/kernel/sysfs.c
  6151. +++ b/arch/powerpc/kernel/sysfs.c
  6152. @@ -850,7 +850,7 @@ ssize_t arch_cpu_release(const char *buf
  6153.  static int sysfs_cpu_notify(struct notifier_block *self,
  6154.                       unsigned long action, void *hcpu)
  6155.  {
  6156. -   unsigned int cpu = (unsigned int)(long)hcpu;
  6157. +   unsigned int cpu = hcpu;
  6158.  
  6159.     switch (action) {
  6160.     case CPU_ONLINE:
RAW Paste Data