Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dm: remove unnecessary (void*) conversions

Pointer variables of void * type do not require type cast.

Signed-off-by: Yu Zhe <yuzhe@nfschina.com>
Signed-off-by: Mike Snitzer <snitzer@kernel.org>

authored by

Yu Zhe and committed by
Mike Snitzer
26cb62a2 990f61e4

+36 -36
+3 -3
drivers/md/dm-integrity.c
··· 3118 3118 3119 3119 static void dm_integrity_postsuspend(struct dm_target *ti) 3120 3120 { 3121 - struct dm_integrity_c *ic = (struct dm_integrity_c *)ti->private; 3121 + struct dm_integrity_c *ic = ti->private; 3122 3122 int r; 3123 3123 3124 3124 WARN_ON(unregister_reboot_notifier(&ic->reboot_notifier)); ··· 3167 3167 3168 3168 static void dm_integrity_resume(struct dm_target *ti) 3169 3169 { 3170 - struct dm_integrity_c *ic = (struct dm_integrity_c *)ti->private; 3170 + struct dm_integrity_c *ic = ti->private; 3171 3171 __u64 old_provided_data_sectors = le64_to_cpu(ic->sb->provided_data_sectors); 3172 3172 int r; 3173 3173 ··· 3290 3290 static void dm_integrity_status(struct dm_target *ti, status_type_t type, 3291 3291 unsigned int status_flags, char *result, unsigned int maxlen) 3292 3292 { 3293 - struct dm_integrity_c *ic = (struct dm_integrity_c *)ti->private; 3293 + struct dm_integrity_c *ic = ti->private; 3294 3294 unsigned int arg_count; 3295 3295 size_t sz = 0; 3296 3296
+2 -2
drivers/md/dm-io.c
··· 187 187 struct page **p, unsigned long *len, unsigned int *offset) 188 188 { 189 189 unsigned int o = dp->context_u; 190 - struct page_list *pl = (struct page_list *) dp->context_ptr; 190 + struct page_list *pl = dp->context_ptr; 191 191 192 192 *p = pl->page; 193 193 *len = PAGE_SIZE - o; ··· 196 196 197 197 static void list_next_page(struct dpages *dp) 198 198 { 199 - struct page_list *pl = (struct page_list *) dp->context_ptr; 199 + struct page_list *pl = dp->context_ptr; 200 200 201 201 dp->context_ptr = pl->next; 202 202 dp->context_u = 0;
+2 -2
drivers/md/dm-kcopyd.c
··· 519 519 520 520 static void complete_io(unsigned long error, void *context) 521 521 { 522 - struct kcopyd_job *job = (struct kcopyd_job *) context; 522 + struct kcopyd_job *job = context; 523 523 struct dm_kcopyd_client *kc = job->kc; 524 524 525 525 io_job_finish(kc->throttle); ··· 696 696 /* FIXME: tidy this function */ 697 697 sector_t progress = 0; 698 698 sector_t count = 0; 699 - struct kcopyd_job *sub_job = (struct kcopyd_job *) context; 699 + struct kcopyd_job *sub_job = context; 700 700 struct kcopyd_job *job = sub_job->master_job; 701 701 struct dm_kcopyd_client *kc = job->kc; 702 702
+3 -3
drivers/md/dm-linear.c
··· 72 72 73 73 static void linear_dtr(struct dm_target *ti) 74 74 { 75 - struct linear_c *lc = (struct linear_c *) ti->private; 75 + struct linear_c *lc = ti->private; 76 76 77 77 dm_put_device(ti, lc->dev); 78 78 kfree(lc); ··· 98 98 static void linear_status(struct dm_target *ti, status_type_t type, 99 99 unsigned int status_flags, char *result, unsigned int maxlen) 100 100 { 101 - struct linear_c *lc = (struct linear_c *) ti->private; 101 + struct linear_c *lc = ti->private; 102 102 size_t sz = 0; 103 103 104 104 switch (type) { ··· 120 120 121 121 static int linear_prepare_ioctl(struct dm_target *ti, struct block_device **bdev) 122 122 { 123 - struct linear_c *lc = (struct linear_c *) ti->private; 123 + struct linear_c *lc = ti->private; 124 124 struct dm_dev *dev = lc->dev; 125 125 126 126 *bdev = dev->bdev;
+1 -1
drivers/md/dm-log-writes.c
··· 429 429 430 430 static int log_writes_kthread(void *arg) 431 431 { 432 - struct log_writes_c *lc = (struct log_writes_c *)arg; 432 + struct log_writes_c *lc = arg; 433 433 sector_t sector = 0; 434 434 435 435 while (!kthread_should_stop()) {
+12 -12
drivers/md/dm-log.c
··· 530 530 531 531 static void core_dtr(struct dm_dirty_log *log) 532 532 { 533 - struct log_c *lc = (struct log_c *) log->context; 533 + struct log_c *lc = log->context; 534 534 535 535 vfree(lc->clean_bits); 536 536 destroy_log_context(lc); ··· 569 569 570 570 static void disk_dtr(struct dm_dirty_log *log) 571 571 { 572 - struct log_c *lc = (struct log_c *) log->context; 572 + struct log_c *lc = log->context; 573 573 574 574 dm_put_device(lc->ti, lc->log_dev); 575 575 vfree(lc->disk_header); ··· 590 590 { 591 591 int r; 592 592 unsigned int i; 593 - struct log_c *lc = (struct log_c *) log->context; 593 + struct log_c *lc = log->context; 594 594 size_t size = lc->bitset_uint32_count * sizeof(uint32_t); 595 595 596 596 /* read the disk header */ ··· 652 652 653 653 static uint32_t core_get_region_size(struct dm_dirty_log *log) 654 654 { 655 - struct log_c *lc = (struct log_c *) log->context; 655 + struct log_c *lc = log->context; 656 656 657 657 return lc->region_size; 658 658 } 659 659 660 660 static int core_resume(struct dm_dirty_log *log) 661 661 { 662 - struct log_c *lc = (struct log_c *) log->context; 662 + struct log_c *lc = log->context; 663 663 664 664 lc->sync_search = 0; 665 665 return 0; ··· 667 667 668 668 static int core_is_clean(struct dm_dirty_log *log, region_t region) 669 669 { 670 - struct log_c *lc = (struct log_c *) log->context; 670 + struct log_c *lc = log->context; 671 671 672 672 return log_test_bit(lc->clean_bits, region); 673 673 } 674 674 675 675 static int core_in_sync(struct dm_dirty_log *log, region_t region, int block) 676 676 { 677 - struct log_c *lc = (struct log_c *) log->context; 677 + struct log_c *lc = log->context; 678 678 679 679 return log_test_bit(lc->sync_bits, region); 680 680 } ··· 727 727 728 728 static void core_mark_region(struct dm_dirty_log *log, region_t region) 729 729 { 730 - struct log_c *lc = (struct log_c *) log->context; 730 + struct log_c *lc = log->context; 731 731 732 732 log_clear_bit(lc, lc->clean_bits, region); 733 733 } 734 734 735 735 static void core_clear_region(struct dm_dirty_log *log, region_t region) 736 736 { 737 - struct log_c *lc = (struct log_c *) log->context; 737 + struct log_c *lc = log->context; 738 738 739 739 if (likely(!lc->flush_failed)) 740 740 log_set_bit(lc, lc->clean_bits, region); ··· 742 742 743 743 static int core_get_resync_work(struct dm_dirty_log *log, region_t *region) 744 744 { 745 - struct log_c *lc = (struct log_c *) log->context; 745 + struct log_c *lc = log->context; 746 746 747 747 if (lc->sync_search >= lc->region_count) 748 748 return 0; ··· 765 765 static void core_set_region_sync(struct dm_dirty_log *log, region_t region, 766 766 int in_sync) 767 767 { 768 - struct log_c *lc = (struct log_c *) log->context; 768 + struct log_c *lc = log->context; 769 769 770 770 log_clear_bit(lc, lc->recovering_bits, region); 771 771 if (in_sync) { ··· 779 779 780 780 static region_t core_get_sync_count(struct dm_dirty_log *log) 781 781 { 782 - struct log_c *lc = (struct log_c *) log->context; 782 + struct log_c *lc = log->context; 783 783 784 784 return lc->sync_count; 785 785 }
+5 -5
drivers/md/dm-raid1.c
··· 604 604 static void write_callback(unsigned long error, void *context) 605 605 { 606 606 unsigned int i; 607 - struct bio *bio = (struct bio *) context; 607 + struct bio *bio = context; 608 608 struct mirror_set *ms; 609 609 int should_wake = 0; 610 610 unsigned long flags; ··· 1180 1180 1181 1181 static void mirror_dtr(struct dm_target *ti) 1182 1182 { 1183 - struct mirror_set *ms = (struct mirror_set *) ti->private; 1183 + struct mirror_set *ms = ti->private; 1184 1184 1185 1185 del_timer_sync(&ms->timer); 1186 1186 flush_workqueue(ms->kmirrord_wq); ··· 1246 1246 blk_status_t *error) 1247 1247 { 1248 1248 int rw = bio_data_dir(bio); 1249 - struct mirror_set *ms = (struct mirror_set *) ti->private; 1249 + struct mirror_set *ms = ti->private; 1250 1250 struct mirror *m = NULL; 1251 1251 struct dm_bio_details *bd = NULL; 1252 1252 struct dm_raid1_bio_record *bio_record = ··· 1311 1311 1312 1312 static void mirror_presuspend(struct dm_target *ti) 1313 1313 { 1314 - struct mirror_set *ms = (struct mirror_set *) ti->private; 1314 + struct mirror_set *ms = ti->private; 1315 1315 struct dm_dirty_log *log = dm_rh_dirty_log(ms->rh); 1316 1316 1317 1317 struct bio_list holds; ··· 1407 1407 { 1408 1408 unsigned int m, sz = 0; 1409 1409 int num_feature_args = 0; 1410 - struct mirror_set *ms = (struct mirror_set *) ti->private; 1410 + struct mirror_set *ms = ti->private; 1411 1411 struct dm_dirty_log *log = dm_rh_dirty_log(ms->rh); 1412 1412 char buffer[MAX_NR_MIRRORS + 1]; 1413 1413
+1 -1
drivers/md/dm-snap-persistent.c
··· 567 567 568 568 static struct pstore *get_info(struct dm_exception_store *store) 569 569 { 570 - return (struct pstore *) store->context; 570 + return store->context; 571 571 } 572 572 573 573 static void persistent_usage(struct dm_exception_store *store,
+2 -2
drivers/md/dm-stripe.c
··· 189 189 static void stripe_dtr(struct dm_target *ti) 190 190 { 191 191 unsigned int i; 192 - struct stripe_c *sc = (struct stripe_c *) ti->private; 192 + struct stripe_c *sc = ti->private; 193 193 194 194 for (i = 0; i < sc->stripes; i++) 195 195 dm_put_device(ti, sc->stripe[i].dev); ··· 360 360 static void stripe_status(struct dm_target *ti, status_type_t type, 361 361 unsigned int status_flags, char *result, unsigned int maxlen) 362 362 { 363 - struct stripe_c *sc = (struct stripe_c *) ti->private; 363 + struct stripe_c *sc = ti->private; 364 364 unsigned int sz = 0; 365 365 unsigned int i; 366 366
+2 -2
drivers/md/dm-verity-fec.c
··· 567 567 568 568 static void *fec_rs_alloc(gfp_t gfp_mask, void *pool_data) 569 569 { 570 - struct dm_verity *v = (struct dm_verity *)pool_data; 570 + struct dm_verity *v = pool_data; 571 571 572 572 return init_rs_gfp(8, 0x11d, 0, 1, v->fec->roots, gfp_mask); 573 573 } 574 574 575 575 static void fec_rs_free(void *element, void *pool_data) 576 576 { 577 - struct rs_control *rs = (struct rs_control *)element; 577 + struct rs_control *rs = element; 578 578 579 579 if (rs) 580 580 free_rs(rs);
+3 -3
drivers/md/dm-zoned-metadata.c
··· 1701 1701 if (IS_ERR(dmap_mblk)) 1702 1702 return PTR_ERR(dmap_mblk); 1703 1703 zmd->map_mblk[i] = dmap_mblk; 1704 - dmap = (struct dmz_map *) dmap_mblk->data; 1704 + dmap = dmap_mblk->data; 1705 1705 i++; 1706 1706 e = 0; 1707 1707 } ··· 1832 1832 unsigned int dzone_id, unsigned int bzone_id) 1833 1833 { 1834 1834 struct dmz_mblock *dmap_mblk = zmd->map_mblk[chunk >> DMZ_MAP_ENTRIES_SHIFT]; 1835 - struct dmz_map *dmap = (struct dmz_map *) dmap_mblk->data; 1835 + struct dmz_map *dmap = dmap_mblk->data; 1836 1836 int map_idx = chunk & DMZ_MAP_ENTRIES_MASK; 1837 1837 1838 1838 dmap[map_idx].dzone_id = cpu_to_le32(dzone_id); ··· 2045 2045 unsigned int chunk, enum req_op op) 2046 2046 { 2047 2047 struct dmz_mblock *dmap_mblk = zmd->map_mblk[chunk >> DMZ_MAP_ENTRIES_SHIFT]; 2048 - struct dmz_map *dmap = (struct dmz_map *) dmap_mblk->data; 2048 + struct dmz_map *dmap = dmap_mblk->data; 2049 2049 int dmap_idx = chunk & DMZ_MAP_ENTRIES_MASK; 2050 2050 unsigned int dzone_id; 2051 2051 struct dm_zone *dzone = NULL;