Skip to content

Commit 26cb62a

Browse files
yuzhenfschinaMike Snitzer
authored andcommitted
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>
1 parent 990f61e commit 26cb62a

11 files changed

Lines changed: 36 additions & 36 deletions

drivers/md/dm-integrity.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3118,7 +3118,7 @@ static int dm_integrity_reboot(struct notifier_block *n, unsigned long code, voi
31183118

31193119
static void dm_integrity_postsuspend(struct dm_target *ti)
31203120
{
3121-
struct dm_integrity_c *ic = (struct dm_integrity_c *)ti->private;
3121+
struct dm_integrity_c *ic = ti->private;
31223122
int r;
31233123

31243124
WARN_ON(unregister_reboot_notifier(&ic->reboot_notifier));
@@ -3167,7 +3167,7 @@ static void dm_integrity_postsuspend(struct dm_target *ti)
31673167

31683168
static void dm_integrity_resume(struct dm_target *ti)
31693169
{
3170-
struct dm_integrity_c *ic = (struct dm_integrity_c *)ti->private;
3170+
struct dm_integrity_c *ic = ti->private;
31713171
__u64 old_provided_data_sectors = le64_to_cpu(ic->sb->provided_data_sectors);
31723172
int r;
31733173

@@ -3290,7 +3290,7 @@ static void dm_integrity_resume(struct dm_target *ti)
32903290
static void dm_integrity_status(struct dm_target *ti, status_type_t type,
32913291
unsigned int status_flags, char *result, unsigned int maxlen)
32923292
{
3293-
struct dm_integrity_c *ic = (struct dm_integrity_c *)ti->private;
3293+
struct dm_integrity_c *ic = ti->private;
32943294
unsigned int arg_count;
32953295
size_t sz = 0;
32963296

drivers/md/dm-io.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ static void list_get_page(struct dpages *dp,
187187
struct page **p, unsigned long *len, unsigned int *offset)
188188
{
189189
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;
191191

192192
*p = pl->page;
193193
*len = PAGE_SIZE - o;
@@ -196,7 +196,7 @@ static void list_get_page(struct dpages *dp,
196196

197197
static void list_next_page(struct dpages *dp)
198198
{
199-
struct page_list *pl = (struct page_list *) dp->context_ptr;
199+
struct page_list *pl = dp->context_ptr;
200200

201201
dp->context_ptr = pl->next;
202202
dp->context_u = 0;

drivers/md/dm-kcopyd.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ static int run_complete_job(struct kcopyd_job *job)
519519

520520
static void complete_io(unsigned long error, void *context)
521521
{
522-
struct kcopyd_job *job = (struct kcopyd_job *) context;
522+
struct kcopyd_job *job = context;
523523
struct dm_kcopyd_client *kc = job->kc;
524524

525525
io_job_finish(kc->throttle);
@@ -696,7 +696,7 @@ static void segment_complete(int read_err, unsigned long write_err,
696696
/* FIXME: tidy this function */
697697
sector_t progress = 0;
698698
sector_t count = 0;
699-
struct kcopyd_job *sub_job = (struct kcopyd_job *) context;
699+
struct kcopyd_job *sub_job = context;
700700
struct kcopyd_job *job = sub_job->master_job;
701701
struct dm_kcopyd_client *kc = job->kc;
702702

drivers/md/dm-linear.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ static int linear_ctr(struct dm_target *ti, unsigned int argc, char **argv)
7272

7373
static void linear_dtr(struct dm_target *ti)
7474
{
75-
struct linear_c *lc = (struct linear_c *) ti->private;
75+
struct linear_c *lc = ti->private;
7676

7777
dm_put_device(ti, lc->dev);
7878
kfree(lc);
@@ -98,7 +98,7 @@ static int linear_map(struct dm_target *ti, struct bio *bio)
9898
static void linear_status(struct dm_target *ti, status_type_t type,
9999
unsigned int status_flags, char *result, unsigned int maxlen)
100100
{
101-
struct linear_c *lc = (struct linear_c *) ti->private;
101+
struct linear_c *lc = ti->private;
102102
size_t sz = 0;
103103

104104
switch (type) {
@@ -120,7 +120,7 @@ static void linear_status(struct dm_target *ti, status_type_t type,
120120

121121
static int linear_prepare_ioctl(struct dm_target *ti, struct block_device **bdev)
122122
{
123-
struct linear_c *lc = (struct linear_c *) ti->private;
123+
struct linear_c *lc = ti->private;
124124
struct dm_dev *dev = lc->dev;
125125

126126
*bdev = dev->bdev;

drivers/md/dm-log-writes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,7 @@ static inline sector_t logdev_last_sector(struct log_writes_c *lc)
429429

430430
static int log_writes_kthread(void *arg)
431431
{
432-
struct log_writes_c *lc = (struct log_writes_c *)arg;
432+
struct log_writes_c *lc = arg;
433433
sector_t sector = 0;
434434

435435
while (!kthread_should_stop()) {

drivers/md/dm-log.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ static void destroy_log_context(struct log_c *lc)
530530

531531
static void core_dtr(struct dm_dirty_log *log)
532532
{
533-
struct log_c *lc = (struct log_c *) log->context;
533+
struct log_c *lc = log->context;
534534

535535
vfree(lc->clean_bits);
536536
destroy_log_context(lc);
@@ -569,7 +569,7 @@ static int disk_ctr(struct dm_dirty_log *log, struct dm_target *ti,
569569

570570
static void disk_dtr(struct dm_dirty_log *log)
571571
{
572-
struct log_c *lc = (struct log_c *) log->context;
572+
struct log_c *lc = log->context;
573573

574574
dm_put_device(lc->ti, lc->log_dev);
575575
vfree(lc->disk_header);
@@ -590,7 +590,7 @@ static int disk_resume(struct dm_dirty_log *log)
590590
{
591591
int r;
592592
unsigned int i;
593-
struct log_c *lc = (struct log_c *) log->context;
593+
struct log_c *lc = log->context;
594594
size_t size = lc->bitset_uint32_count * sizeof(uint32_t);
595595

596596
/* read the disk header */
@@ -652,29 +652,29 @@ static int disk_resume(struct dm_dirty_log *log)
652652

653653
static uint32_t core_get_region_size(struct dm_dirty_log *log)
654654
{
655-
struct log_c *lc = (struct log_c *) log->context;
655+
struct log_c *lc = log->context;
656656

657657
return lc->region_size;
658658
}
659659

660660
static int core_resume(struct dm_dirty_log *log)
661661
{
662-
struct log_c *lc = (struct log_c *) log->context;
662+
struct log_c *lc = log->context;
663663

664664
lc->sync_search = 0;
665665
return 0;
666666
}
667667

668668
static int core_is_clean(struct dm_dirty_log *log, region_t region)
669669
{
670-
struct log_c *lc = (struct log_c *) log->context;
670+
struct log_c *lc = log->context;
671671

672672
return log_test_bit(lc->clean_bits, region);
673673
}
674674

675675
static int core_in_sync(struct dm_dirty_log *log, region_t region, int block)
676676
{
677-
struct log_c *lc = (struct log_c *) log->context;
677+
struct log_c *lc = log->context;
678678

679679
return log_test_bit(lc->sync_bits, region);
680680
}
@@ -727,22 +727,22 @@ static int disk_flush(struct dm_dirty_log *log)
727727

728728
static void core_mark_region(struct dm_dirty_log *log, region_t region)
729729
{
730-
struct log_c *lc = (struct log_c *) log->context;
730+
struct log_c *lc = log->context;
731731

732732
log_clear_bit(lc, lc->clean_bits, region);
733733
}
734734

735735
static void core_clear_region(struct dm_dirty_log *log, region_t region)
736736
{
737-
struct log_c *lc = (struct log_c *) log->context;
737+
struct log_c *lc = log->context;
738738

739739
if (likely(!lc->flush_failed))
740740
log_set_bit(lc, lc->clean_bits, region);
741741
}
742742

743743
static int core_get_resync_work(struct dm_dirty_log *log, region_t *region)
744744
{
745-
struct log_c *lc = (struct log_c *) log->context;
745+
struct log_c *lc = log->context;
746746

747747
if (lc->sync_search >= lc->region_count)
748748
return 0;
@@ -765,7 +765,7 @@ static int core_get_resync_work(struct dm_dirty_log *log, region_t *region)
765765
static void core_set_region_sync(struct dm_dirty_log *log, region_t region,
766766
int in_sync)
767767
{
768-
struct log_c *lc = (struct log_c *) log->context;
768+
struct log_c *lc = log->context;
769769

770770
log_clear_bit(lc, lc->recovering_bits, region);
771771
if (in_sync) {
@@ -779,7 +779,7 @@ static void core_set_region_sync(struct dm_dirty_log *log, region_t region,
779779

780780
static region_t core_get_sync_count(struct dm_dirty_log *log)
781781
{
782-
struct log_c *lc = (struct log_c *) log->context;
782+
struct log_c *lc = log->context;
783783

784784
return lc->sync_count;
785785
}

drivers/md/dm-raid1.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ static void do_reads(struct mirror_set *ms, struct bio_list *reads)
604604
static void write_callback(unsigned long error, void *context)
605605
{
606606
unsigned int i;
607-
struct bio *bio = (struct bio *) context;
607+
struct bio *bio = context;
608608
struct mirror_set *ms;
609609
int should_wake = 0;
610610
unsigned long flags;
@@ -1180,7 +1180,7 @@ static int mirror_ctr(struct dm_target *ti, unsigned int argc, char **argv)
11801180

11811181
static void mirror_dtr(struct dm_target *ti)
11821182
{
1183-
struct mirror_set *ms = (struct mirror_set *) ti->private;
1183+
struct mirror_set *ms = ti->private;
11841184

11851185
del_timer_sync(&ms->timer);
11861186
flush_workqueue(ms->kmirrord_wq);
@@ -1246,7 +1246,7 @@ static int mirror_end_io(struct dm_target *ti, struct bio *bio,
12461246
blk_status_t *error)
12471247
{
12481248
int rw = bio_data_dir(bio);
1249-
struct mirror_set *ms = (struct mirror_set *) ti->private;
1249+
struct mirror_set *ms = ti->private;
12501250
struct mirror *m = NULL;
12511251
struct dm_bio_details *bd = NULL;
12521252
struct dm_raid1_bio_record *bio_record =
@@ -1311,7 +1311,7 @@ static int mirror_end_io(struct dm_target *ti, struct bio *bio,
13111311

13121312
static void mirror_presuspend(struct dm_target *ti)
13131313
{
1314-
struct mirror_set *ms = (struct mirror_set *) ti->private;
1314+
struct mirror_set *ms = ti->private;
13151315
struct dm_dirty_log *log = dm_rh_dirty_log(ms->rh);
13161316

13171317
struct bio_list holds;
@@ -1407,7 +1407,7 @@ static void mirror_status(struct dm_target *ti, status_type_t type,
14071407
{
14081408
unsigned int m, sz = 0;
14091409
int num_feature_args = 0;
1410-
struct mirror_set *ms = (struct mirror_set *) ti->private;
1410+
struct mirror_set *ms = ti->private;
14111411
struct dm_dirty_log *log = dm_rh_dirty_log(ms->rh);
14121412
char buffer[MAX_NR_MIRRORS + 1];
14131413

drivers/md/dm-snap-persistent.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ static int read_exceptions(struct pstore *ps,
567567

568568
static struct pstore *get_info(struct dm_exception_store *store)
569569
{
570-
return (struct pstore *) store->context;
570+
return store->context;
571571
}
572572

573573
static void persistent_usage(struct dm_exception_store *store,

drivers/md/dm-stripe.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ static int stripe_ctr(struct dm_target *ti, unsigned int argc, char **argv)
189189
static void stripe_dtr(struct dm_target *ti)
190190
{
191191
unsigned int i;
192-
struct stripe_c *sc = (struct stripe_c *) ti->private;
192+
struct stripe_c *sc = ti->private;
193193

194194
for (i = 0; i < sc->stripes; i++)
195195
dm_put_device(ti, sc->stripe[i].dev);
@@ -360,7 +360,7 @@ static size_t stripe_dax_recovery_write(struct dm_target *ti, pgoff_t pgoff,
360360
static void stripe_status(struct dm_target *ti, status_type_t type,
361361
unsigned int status_flags, char *result, unsigned int maxlen)
362362
{
363-
struct stripe_c *sc = (struct stripe_c *) ti->private;
363+
struct stripe_c *sc = ti->private;
364364
unsigned int sz = 0;
365365
unsigned int i;
366366

drivers/md/dm-verity-fec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,14 +567,14 @@ void verity_fec_dtr(struct dm_verity *v)
567567

568568
static void *fec_rs_alloc(gfp_t gfp_mask, void *pool_data)
569569
{
570-
struct dm_verity *v = (struct dm_verity *)pool_data;
570+
struct dm_verity *v = pool_data;
571571

572572
return init_rs_gfp(8, 0x11d, 0, 1, v->fec->roots, gfp_mask);
573573
}
574574

575575
static void fec_rs_free(void *element, void *pool_data)
576576
{
577-
struct rs_control *rs = (struct rs_control *)element;
577+
struct rs_control *rs = element;
578578

579579
if (rs)
580580
free_rs(rs);

0 commit comments

Comments
 (0)