Skip to contentSkip to conversation

staging: lustre: remove unused variable

PATCH In review Sudip Mukherjee 3 participants 4 messages May 11, 2015 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: lustre: remove unused variable

there variables were not used anywhere and was showing as build warning.

---
 drivers/staging/lustre/lustre/lov/lov_request.c | 4 +---
 drivers/staging/lustre/lustre/obdclass/acl.c    | 1 -
 2 files changed, 1 insertion(+), 4 deletions(-)
drivers/staging/lustre/lustre/lov/lov_request.c +1 -3
index f6e1314..d24ba8e 100644
@@ -74,10 +74,8 @@ void lov_finish_set(struct lov_request_set *set)
 		kfree(req);
 	}
 
-	if (set->set_pga) {
-		int len = set->set_oabufs * sizeof(*set->set_pga);
+	if (set->set_pga)
 		OBD_FREE_LARGE(set->set_pga, len);
-	}
 	if (set->set_lockh)
 		lov_llh_put(set->set_lockh);
 
drivers/staging/lustre/lustre/obdclass/acl.c +0 -1
index 194c48a..bc3fc47 100644
@@ -120,7 +120,6 @@ static int lustre_ext_acl_xattr_reduce_space(ext_acl_xattr_header **header,
 {
 	int ext_count = le32_to_cpu((*header)->a_count);
 	int ext_size = CFS_ACL_XATTR_SIZE(ext_count, ext_acl_xattr);
-	int old_size = CFS_ACL_XATTR_SIZE(old_count, ext_acl_xattr);
 	ext_acl_xattr_header *new;
 
 	if (unlikely(old_count <= ext_count))
Signature · 1 line
1.8.1.2
#1 lore raw
Quoted 13 lines · Sudip Mukherjee

there variables were not used anywhere and was showing as build warning.

---
 drivers/staging/lustre/lustre/lov/lov_request.c | 4 +---
 drivers/staging/lustre/lustre/obdclass/acl.c    | 1 -
 2 files changed, 1 insertion(+), 4 deletions(-)
drivers/staging/lustre/lustre/lov/lov_request.c +0 -0
index f6e1314..d24ba8e 100644

drivers/staging/lustre/lustre/lov/lov_request.c void lov_finish_set(struct lov_request_set *set) · line 78

Quoted 7 lines
drivers/staging/lustre/lustre/lov/lov_request.c +1 -2
@@ -74,10 +74,8 @@ void lov_finish_set(struct lov_request_set *set)
 		kfree(req);
 	}
 
-	if (set->set_pga) {
-		int len = set->set_oabufs * sizeof(*set->set_pga);
+	if (set->set_pga)
 		OBD_FREE_LARGE(set->set_pga, len);
                                             ^^^

It's used right here?

regards,
dan carpenter

#2 lore raw
Quoted 7 lines · Dan Carpenter

drivers/staging/lustre/lustre/lov/lov_request.c void lov_finish_set(struct lov_request_set *set) · line 78

Quoted 4 lines · Sudip Mukherjee
drivers/staging/lustre/lustre/lov/lov_request.c +1 -2
-	if (set->set_pga) {
-		int len = set->set_oabufs * sizeof(*set->set_pga);
+	if (set->set_pga)
 		OBD_FREE_LARGE(set->set_pga, len);
                                             ^^^

It's used right here?

oops.. sorry .. but why i didnot get a build failure after this?

ok, got it ...

#define OBD_FREE_LARGE(ptr, size) \

do {					\
		kvfree(ptr);		\
} while (0)

the variable is actually not used. I will make a v2 and send tomorrow. today is a day of silly mistakes :(

regards
sudip

Quoted 4 lines

regards,
dan carpenter

#3 lore raw

Hello!

Quoted 13 lines · Sudip Mukherjee
Quoted 7 lines · Dan Carpenter
Quoted 4 lines · Sudip Mukherjee
drivers/staging/lustre/lustre/lov/lov_request.c +1 -2
-	if (set->set_pga) {
-		int len = set->set_oabufs * sizeof(*set->set_pga);
+	if (set->set_pga)
		OBD_FREE_LARGE(set->set_pga, len);
                                            ^^^

It's used right here?

oops.. sorry .. but why i didnot get a build failure after this?

ok, got it ...

Quoted 7 lines

#define OBD_FREE_LARGE(ptr, size) \

do {					\
		kvfree(ptr);		\
} while (0)

the variable is actually not used. I will make a v2 and send tomorrow. today is a day of silly mistakes :(

It's probably best to wait for a bit at this point.

Julia is going to send in a bunch of patches actually getting rid of those macros.
And then whatever stuff surfaces would be easier to see.

Thanks!

Bye,
Oleg