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>
static void dm_integrity_postsuspend(struct dm_target *ti)
{
- struct dm_integrity_c *ic = (struct dm_integrity_c *)ti->private;
+ struct dm_integrity_c *ic = ti->private;
int r;
WARN_ON(unregister_reboot_notifier(&ic->reboot_notifier));
static void dm_integrity_resume(struct dm_target *ti)
{
- struct dm_integrity_c *ic = (struct dm_integrity_c *)ti->private;
+ struct dm_integrity_c *ic = ti->private;
__u64 old_provided_data_sectors = le64_to_cpu(ic->sb->provided_data_sectors);
int r;
static void dm_integrity_status(struct dm_target *ti, status_type_t type,
unsigned int status_flags, char *result, unsigned int maxlen)
{
- struct dm_integrity_c *ic = (struct dm_integrity_c *)ti->private;
+ struct dm_integrity_c *ic = ti->private;
unsigned int arg_count;
size_t sz = 0;
struct page **p, unsigned long *len, unsigned int *offset)
{
unsigned int o = dp->context_u;
- struct page_list *pl = (struct page_list *) dp->context_ptr;
+ struct page_list *pl = dp->context_ptr;
*p = pl->page;
*len = PAGE_SIZE - o;
static void list_next_page(struct dpages *dp)
{
- struct page_list *pl = (struct page_list *) dp->context_ptr;
+ struct page_list *pl = dp->context_ptr;
dp->context_ptr = pl->next;
dp->context_u = 0;
static void complete_io(unsigned long error, void *context)
{
- struct kcopyd_job *job = (struct kcopyd_job *) context;
+ struct kcopyd_job *job = context;
struct dm_kcopyd_client *kc = job->kc;
io_job_finish(kc->throttle);
/* FIXME: tidy this function */
sector_t progress = 0;
sector_t count = 0;
- struct kcopyd_job *sub_job = (struct kcopyd_job *) context;
+ struct kcopyd_job *sub_job = context;
struct kcopyd_job *job = sub_job->master_job;
struct dm_kcopyd_client *kc = job->kc;
static void linear_dtr(struct dm_target *ti)
{
- struct linear_c *lc = (struct linear_c *) ti->private;
+ struct linear_c *lc = ti->private;
dm_put_device(ti, lc->dev);
kfree(lc);
static void linear_status(struct dm_target *ti, status_type_t type,
unsigned int status_flags, char *result, unsigned int maxlen)
{
- struct linear_c *lc = (struct linear_c *) ti->private;
+ struct linear_c *lc = ti->private;
size_t sz = 0;
switch (type) {
static int linear_prepare_ioctl(struct dm_target *ti, struct block_device **bdev)
{
- struct linear_c *lc = (struct linear_c *) ti->private;
+ struct linear_c *lc = ti->private;
struct dm_dev *dev = lc->dev;
*bdev = dev->bdev;
static int log_writes_kthread(void *arg)
{
- struct log_writes_c *lc = (struct log_writes_c *)arg;
+ struct log_writes_c *lc = arg;
sector_t sector = 0;
while (!kthread_should_stop()) {
static void core_dtr(struct dm_dirty_log *log)
{
- struct log_c *lc = (struct log_c *) log->context;
+ struct log_c *lc = log->context;
vfree(lc->clean_bits);
destroy_log_context(lc);
static void disk_dtr(struct dm_dirty_log *log)
{
- struct log_c *lc = (struct log_c *) log->context;
+ struct log_c *lc = log->context;
dm_put_device(lc->ti, lc->log_dev);
vfree(lc->disk_header);
{
int r;
unsigned int i;
- struct log_c *lc = (struct log_c *) log->context;
+ struct log_c *lc = log->context;
size_t size = lc->bitset_uint32_count * sizeof(uint32_t);
/* read the disk header */
static uint32_t core_get_region_size(struct dm_dirty_log *log)
{
- struct log_c *lc = (struct log_c *) log->context;
+ struct log_c *lc = log->context;
return lc->region_size;
}
static int core_resume(struct dm_dirty_log *log)
{
- struct log_c *lc = (struct log_c *) log->context;
+ struct log_c *lc = log->context;
lc->sync_search = 0;
return 0;
static int core_is_clean(struct dm_dirty_log *log, region_t region)
{
- struct log_c *lc = (struct log_c *) log->context;
+ struct log_c *lc = log->context;
return log_test_bit(lc->clean_bits, region);
}
static int core_in_sync(struct dm_dirty_log *log, region_t region, int block)
{
- struct log_c *lc = (struct log_c *) log->context;
+ struct log_c *lc = log->context;
return log_test_bit(lc->sync_bits, region);
}
static void core_mark_region(struct dm_dirty_log *log, region_t region)
{
- struct log_c *lc = (struct log_c *) log->context;
+ struct log_c *lc = log->context;
log_clear_bit(lc, lc->clean_bits, region);
}
static void core_clear_region(struct dm_dirty_log *log, region_t region)
{
- struct log_c *lc = (struct log_c *) log->context;
+ struct log_c *lc = log->context;
if (likely(!lc->flush_failed))
log_set_bit(lc, lc->clean_bits, region);
static int core_get_resync_work(struct dm_dirty_log *log, region_t *region)
{
- struct log_c *lc = (struct log_c *) log->context;
+ struct log_c *lc = log->context;
if (lc->sync_search >= lc->region_count)
return 0;
static void core_set_region_sync(struct dm_dirty_log *log, region_t region,
int in_sync)
{
- struct log_c *lc = (struct log_c *) log->context;
+ struct log_c *lc = log->context;
log_clear_bit(lc, lc->recovering_bits, region);
if (in_sync) {
static region_t core_get_sync_count(struct dm_dirty_log *log)
{
- struct log_c *lc = (struct log_c *) log->context;
+ struct log_c *lc = log->context;
return lc->sync_count;
}
static void write_callback(unsigned long error, void *context)
{
unsigned int i;
- struct bio *bio = (struct bio *) context;
+ struct bio *bio = context;
struct mirror_set *ms;
int should_wake = 0;
unsigned long flags;
static void mirror_dtr(struct dm_target *ti)
{
- struct mirror_set *ms = (struct mirror_set *) ti->private;
+ struct mirror_set *ms = ti->private;
del_timer_sync(&ms->timer);
flush_workqueue(ms->kmirrord_wq);
blk_status_t *error)
{
int rw = bio_data_dir(bio);
- struct mirror_set *ms = (struct mirror_set *) ti->private;
+ struct mirror_set *ms = ti->private;
struct mirror *m = NULL;
struct dm_bio_details *bd = NULL;
struct dm_raid1_bio_record *bio_record =
static void mirror_presuspend(struct dm_target *ti)
{
- struct mirror_set *ms = (struct mirror_set *) ti->private;
+ struct mirror_set *ms = ti->private;
struct dm_dirty_log *log = dm_rh_dirty_log(ms->rh);
struct bio_list holds;
{
unsigned int m, sz = 0;
int num_feature_args = 0;
- struct mirror_set *ms = (struct mirror_set *) ti->private;
+ struct mirror_set *ms = ti->private;
struct dm_dirty_log *log = dm_rh_dirty_log(ms->rh);
char buffer[MAX_NR_MIRRORS + 1];
static struct pstore *get_info(struct dm_exception_store *store)
{
- return (struct pstore *) store->context;
+ return store->context;
}
static void persistent_usage(struct dm_exception_store *store,
static void stripe_dtr(struct dm_target *ti)
{
unsigned int i;
- struct stripe_c *sc = (struct stripe_c *) ti->private;
+ struct stripe_c *sc = ti->private;
for (i = 0; i < sc->stripes; i++)
dm_put_device(ti, sc->stripe[i].dev);
static void stripe_status(struct dm_target *ti, status_type_t type,
unsigned int status_flags, char *result, unsigned int maxlen)
{
- struct stripe_c *sc = (struct stripe_c *) ti->private;
+ struct stripe_c *sc = ti->private;
unsigned int sz = 0;
unsigned int i;
static void *fec_rs_alloc(gfp_t gfp_mask, void *pool_data)
{
- struct dm_verity *v = (struct dm_verity *)pool_data;
+ struct dm_verity *v = pool_data;
return init_rs_gfp(8, 0x11d, 0, 1, v->fec->roots, gfp_mask);
}
static void fec_rs_free(void *element, void *pool_data)
{
- struct rs_control *rs = (struct rs_control *)element;
+ struct rs_control *rs = element;
if (rs)
free_rs(rs);
if (IS_ERR(dmap_mblk))
return PTR_ERR(dmap_mblk);
zmd->map_mblk[i] = dmap_mblk;
- dmap = (struct dmz_map *) dmap_mblk->data;
+ dmap = dmap_mblk->data;
i++;
e = 0;
}
unsigned int dzone_id, unsigned int bzone_id)
{
struct dmz_mblock *dmap_mblk = zmd->map_mblk[chunk >> DMZ_MAP_ENTRIES_SHIFT];
- struct dmz_map *dmap = (struct dmz_map *) dmap_mblk->data;
+ struct dmz_map *dmap = dmap_mblk->data;
int map_idx = chunk & DMZ_MAP_ENTRIES_MASK;
dmap[map_idx].dzone_id = cpu_to_le32(dzone_id);
unsigned int chunk, enum req_op op)
{
struct dmz_mblock *dmap_mblk = zmd->map_mblk[chunk >> DMZ_MAP_ENTRIES_SHIFT];
- struct dmz_map *dmap = (struct dmz_map *) dmap_mblk->data;
+ struct dmz_map *dmap = dmap_mblk->data;
int dmap_idx = chunk & DMZ_MAP_ENTRIES_MASK;
unsigned int dzone_id;
struct dm_zone *dzone = NULL;