staging: lustre: Remove useless cast on void pointer
v2 cover staging: lustre: Remove useless cast on void pointer
This patchset fixes multiple useless casts on void pointers.
The semantic patch used to find this is:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
*((T *)e)
|
((T *)x)[...]
|
((T *)x)->f
|
- (T *)
e
)
Changes in v2:
-Fixed subject in commit message
Amitoj Kaur Chawla (6):
staging: lustre: ptlrpc: sec_bulk: Remove useless cast on void pointer
staging: lustre: ptlrpc: service: Remove useless cast on void pointer
staging: lustre: ptlrpc: pinger: Remove useless cast on void pointer
staging: lustre: ptlrpc: sec_gc: Remove useless cast on void pointer
staging: lustre: mgc: Remove useless cast on void pointer
staging: lustre: osc: Remove useless cast on void pointer
drivers/staging/lustre/lustre/mgc/mgc_request.c | 6 +++--- drivers/staging/lustre/lustre/osc/osc_request.c | 7 +++---- drivers/staging/lustre/lustre/ptlrpc/pinger.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c | 3 +-- drivers/staging/lustre/lustre/ptlrpc/sec_gc.c | 2 +- drivers/staging/lustre/lustre/ptlrpc/service.c | 6 +++--- 6 files changed, 12 insertions(+), 14 deletions(-)
Signature · 1 line
1.9.1
PATCH v2 1/6 staging: lustre: ptlrpc: sec_bulk: Remove useless cast on void pointer
The semantic patch used to find this is:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
*((T *)e)
|
((T *)x)[...]
|
((T *)x)->f
|
- (T *)
e
)
---
Changes in v2:
-Fixed subject in commit message
drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/staging/lustre/lustre/ptlrpc/sec_bulk.c +1 -2
@@ -541,8 +541,7 @@ int sptlrpc_get_bulk_checksum(struct ptlrpc_bulk_desc *desc, __u8 alg,memcpy (buf, hashbuf, buflen); }else { bufsize = buflen; - err =cfs_crypto_hash_final (hdesc, (unsigned char *)buf, - &bufsize); + err =cfs_crypto_hash_final (hdesc, buf, &bufsize); }if (err)
Signature · 1 line
1.9.1
PATCH v2 2/6 staging: lustre: ptlrpc: service: Remove useless cast on void pointer
In reply to Amitoj Kaur ChawlaThe semantic patch used to find this is:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
*((T *)e)
|
((T *)x)[...]
|
((T *)x)->f
|
- (T *)
e
)
---
Changes in v2:
-Fixed subject in commit message
drivers/staging/lustre/lustre/ptlrpc/service.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/lustre/lustre/ptlrpc/service.c +3 -3
@@ -1873,7 +1873,7 @@ ptlrpc_check_rqbd_pool(struct ptlrpc_service_part *svcpt)static int ptlrpc_retry_rqbds (void *arg) { -struct ptlrpc_service_part *svcpt = (struct ptlrpc_service_part *)arg; +struct ptlrpc_service_part *svcpt = arg; svcpt->scp_rqbd_timeout =0 ;return -ETIMEDOUT ;
@@ -1980,7 +1980,7 @@ ptlrpc_wait_event(struct ptlrpc_service_part *svcpt,*/ static int ptlrpc_main (void *arg) { -struct ptlrpc_thread *thread = (struct ptlrpc_thread *)arg; +struct ptlrpc_thread *thread = arg;struct ptlrpc_service_part *svcpt = thread->t_svcpt;struct ptlrpc_service *svc = svcpt->scp_service;struct ptlrpc_reply_state *rs;
@@ -2182,7 +2182,7 @@ static int hrt_dont_sleep(struct ptlrpc_hr_thread *hrt,*/ static int ptlrpc_hr_main (void *arg) { -struct ptlrpc_hr_thread *hrt = (struct ptlrpc_hr_thread *)arg; +struct ptlrpc_hr_thread *hrt = arg;struct ptlrpc_hr_partition *hrp = hrt->hrt_partition;LIST_HEAD (replies);char threadname[20 ];
Signature · 1 line
1.9.1
PATCH v2 3/6 staging: lustre: ptlrpc: pinger: Remove useless cast on void pointer
In reply to Amitoj Kaur ChawlaThe semantic patch used to find this is:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
*((T *)e)
|
((T *)x)[...]
|
((T *)x)->f
|
- (T *)
e
)
---
Changes in v2:
-Fixed subject in commit message
drivers/staging/lustre/lustre/ptlrpc/pinger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/ptlrpc/pinger.c +1 -1
@@ -219,7 +219,7 @@ static void ptlrpc_pinger_process_import(struct obd_import *imp,static int ptlrpc_pinger_main (void *arg) { -struct ptlrpc_thread *thread = (struct ptlrpc_thread *)arg; +struct ptlrpc_thread *thread = arg;/* Record that the thread is running */ thread_set_flags (thread,SVC_RUNNING );
Signature · 1 line
1.9.1
PATCH v2 4/6 staging: lustre: ptlrpc: sec_gc: Remove useless cast on void pointer
In reply to Amitoj Kaur ChawlaThe semantic patch used to find this is:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
*((T *)e)
|
((T *)x)[...]
|
((T *)x)->f
|
- (T *)
e
)
---
Changes in v2:
-Fixed subject in commit message
drivers/staging/lustre/lustre/ptlrpc/sec_gc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/ptlrpc/sec_gc.c +1 -1
@@ -148,7 +148,7 @@ static void sec_do_gc(struct ptlrpc_sec *sec)static int sec_gc_main (void *arg) { -struct ptlrpc_thread *thread = (struct ptlrpc_thread *) arg; +struct ptlrpc_thread *thread = arg;struct l_wait_info lwi;unshare_fs_struct ();
Signature · 1 line
1.9.1
PATCH v2 5/6 staging: lustre: mgc: Remove useless cast on void pointer
In reply to Amitoj Kaur ChawlaThe semantic patch used to find this is:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
*((T *)e)
|
((T *)x)[...]
|
((T *)x)->f
|
- (T *)
e
)
---
Changes in v2:
-None
drivers/staging/lustre/lustre/mgc/mgc_request.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/lustre/lustre/mgc/mgc_request.c +3 -3
@@ -756,7 +756,7 @@ static int mgc_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, void *data, int flag) {struct lustre_handle lockh; -struct config_llog_data *cld = (struct config_llog_data *)data; +struct config_llog_data *cld = data;int rc =0 ;switch (flag) {
@@ -860,7 +860,7 @@ static int mgc_enqueue(struct obd_export *exp, struct lov_stripe_md *lsm, void *data, __u32 lvb_len, void *lvb_swabber, struct lustre_handle *lockh) { - struct config_llog_data *cld = (struct config_llog_data *)data; + struct config_llog_data *cld = data; struct ldlm_enqueue_info einfo = { .ei_type = type, .ei_mode = mode,
@@ -972,7 +972,7 @@ static int mgc_set_info_async(const struct lu_env *env, struct obd_export *exp,if (KEY_IS (KEY_SET_INFO )) {struct mgs_send_param *msp; - msp = (struct mgs_send_param *)val; + msp = val; rc =mgc_set_mgs_param (exp, msp);return rc; }
Signature · 1 line
1.9.1
PATCH v2 6/6 staging: lustre: osc: Remove useless cast on void pointer
In reply to Amitoj Kaur ChawlaThe semantic patch used to find this is:
@r@
expression x;
void* e;
type T;
identifier f;
@@
(
*((T *)e)
|
((T *)x)[...]
|
((T *)x)->f
|
- (T *)
e
)
---
Changes in v2:
-None
drivers/staging/lustre/lustre/osc/osc_request.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/staging/lustre/lustre/osc/osc_request.c +3 -4
@@ -2664,7 +2664,7 @@ static int osc_iocontrol(unsigned int cmd, struct obd_export *exp, int len, data->ioc_offset); goto out;case OBD_IOC_POLL_QUOTACHECK : - err =osc_quota_poll_check (exp, (struct if_quotacheck *)karg); + err =osc_quota_poll_check (exp, karg); goto out;case OBD_IOC_PING_TARGET : err =ptlrpc_obd_ping (obd);
@@ -2731,8 +2731,7 @@ static int osc_get_info(const struct lu_env *env, struct obd_export *exp,ptlrpc_req_finished (req);return rc; }else if (KEY_IS (KEY_FIEMAP )) { -struct ll_fiemap_info_key *fm_key = - (struct ll_fiemap_info_key *)key; +struct ll_fiemap_info_key *fm_key = key;struct ldlm_res_id res_id;ldlm_policy_data_t policy;struct lustre_handle lockh;
@@ -2854,7 +2853,7 @@ static int osc_set_info_async(const struct lu_env *env, struct obd_export *exp,struct client_obd *cli = &obd->u.cli;LASSERT (cli->cl_cache ==NULL );/* only once */ - cli->cl_cache = (struct cl_client_cache *)val; + cli->cl_cache = val;atomic_inc (&cli->cl_cache->ccc_users); cli->cl_lru_left = &cli->cl_cache->ccc_lru_left;
Signature · 1 line
1.9.1