Skip to contentSkip to conversation

staging: lustre: Remove useless cast on void pointer

PATCH Superseded Amitoj Kaur Chawla 3 participants 11 messages Oct 14, 2015 Staging

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

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
)

Amitoj Kaur Chawla (6):
staging: lustre: ptlrpc: Remove useless cast on void pointer
staging: lustre: ptlrpc: Remove useless cast on void pointer
staging: lustre: ptlrpc: Remove useless cast on void pointer
staging: lustre: ptlrpc: 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
#1 lore raw

PATCH 1/6 staging: lustre: ptlrpc: 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
)

---
 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
index c89973c..ee82b32 100644
@@ -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
#2 lore raw

PATCH 2/6 staging: lustre: ptlrpc: Remove useless cast on void pointer

In reply to Amitoj Kaur Chawla

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
)

---
 drivers/staging/lustre/lustre/ptlrpc/service.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/staging/lustre/lustre/ptlrpc/service.c +3 -3
index 0131361..22b89c7 100644
@@ -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
#3 lore raw

PATCH 3/6 staging: lustre: ptlrpc: Remove useless cast on void pointer

In reply to Amitoj Kaur Chawla

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
)

---
 drivers/staging/lustre/lustre/ptlrpc/pinger.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/ptlrpc/pinger.c +1 -1
index a608165..31b197a 100644
@@ -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
#4 lore raw
In reply to Amitoj Kaur Chawla
Quoted 23 lines · Amitoj Kaur Chawla

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
)

Quoted 5 lines

Amitoj Kaur Chawla (6):
staging: lustre: ptlrpc: Remove useless cast on void pointer
staging: lustre: ptlrpc: Remove useless cast on void pointer
staging: lustre: ptlrpc: Remove useless cast on void pointer
staging: lustre: ptlrpc: Remove useless cast on void pointer

The patches haven't arrived in my mailbox yet, but it looks like you will have four with the same subject?

julia

Quoted 21 lines

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(-)

--
1.9.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/cover.1444845733.git.amitoj1606%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

#5 lore raw
Quoted 31 lines · Julia Lawall
Quoted 23 lines · Amitoj Kaur Chawla

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
)

Quoted 5 lines

Amitoj Kaur Chawla (6):
staging: lustre: ptlrpc: Remove useless cast on void pointer
staging: lustre: ptlrpc: Remove useless cast on void pointer
staging: lustre: ptlrpc: Remove useless cast on void pointer
staging: lustre: ptlrpc: Remove useless cast on void pointer

Quoted 5 lines

The patches haven't arrived in my mailbox yet, but it looks like you will have four with the same subject?

julia

Yes all 4 are doing the same thing. Is this a bad thing? Since I'm making changes in separate files I thought it would be better to send them as separate patches.
Should I combine the 4 and resend the series?

Quoted 21 lines
Quoted 21 lines

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(-)

--
1.9.1

--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/cover.1444845733.git.amitoj1606%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Signature · 8 lines
Warm Regards,


Amitoj Kaur Chawla
Public Relations Head, IEEE IGDTUW Branch
Mobile: +919560127770
Indira Gandhi Delhi Technical University for Women
Kashmere Gate, New Delhi-06
#6 lore raw
Quoted 35 lines · Amitoj Kaur Chawla
Quoted 34 lines · Julia Lawall
Quoted 23 lines · Amitoj Kaur Chawla

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
)

Quoted 5 lines

Amitoj Kaur Chawla (6):
staging: lustre: ptlrpc: Remove useless cast on void pointer
staging: lustre: ptlrpc: Remove useless cast on void pointer
staging: lustre: ptlrpc: Remove useless cast on void pointer
staging: lustre: ptlrpc: Remove useless cast on void pointer

The patches haven't arrived in my mailbox yet, but it looks like you will have four with the same subject?

Quoted 6 lines
Quoted 2 lines

julia

Yes all 4 are doing the same thing. Is this a bad thing? Since I'm making changes in separate files I thought it would be better to send them as separate patches.
Should I combine the 4 and resend the series?

It's very good that you've split the patches. The issue here is that all patches have the same subject.

You can introduce the filename into the equation, thus resulting different subjects for your patches.

e.g. staging: lustre: ptlrpc: pinger: Remove useless cast on void pointer

#7 lore raw
Quoted 44 lines · Daniel Baluta
Quoted 35 lines · Amitoj Kaur Chawla
Quoted 34 lines · Julia Lawall
Quoted 23 lines · Amitoj Kaur Chawla

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
)

Quoted 5 lines

Amitoj Kaur Chawla (6):
staging: lustre: ptlrpc: Remove useless cast on void pointer
staging: lustre: ptlrpc: Remove useless cast on void pointer
staging: lustre: ptlrpc: Remove useless cast on void pointer
staging: lustre: ptlrpc: Remove useless cast on void pointer

The patches haven't arrived in my mailbox yet, but it looks like you will have four with the same subject?

Quoted 6 lines
Quoted 2 lines

julia

Yes all 4 are doing the same thing. Is this a bad thing? Since I'm making changes in separate files I thought it would be better to send them as separate patches.
Should I combine the 4 and resend the series?

Quoted 7 lines

It's very good that you've split the patches. The issue here is that all patches have the same subject.

You can introduce the filename into the equation, thus resulting different subjects for your patches.

e.g. staging: lustre: ptlrpc: pinger: Remove useless cast on void pointer

Okay will do that!

Thanks,

Amitoj

#8 lore raw

PATCH 4/6 staging: lustre: ptlrpc: Remove useless cast on void pointer

In reply to Amitoj Kaur Chawla

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
)

---
 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
index 520329f..e570359 100644
@@ -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
#9 lore raw

PATCH 5/6 staging: lustre: mgc: Remove useless cast on void pointer

In reply to Amitoj Kaur Chawla

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
)

---
 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
index 3e9cca0..b36bad9 100644
@@ -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
#10 lore raw

PATCH 6/6 staging: lustre: osc: Remove useless cast on void pointer

In reply to Amitoj Kaur Chawla

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
)

---
 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
index 225e5ed..2ab94c5 100644
@@ -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