All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: lustre: remove unused variable
@ 2015-05-11 10:47 Sudip Mukherjee
  2015-05-11 11:31 ` Dan Carpenter
  0 siblings, 1 reply; 7+ messages in thread
From: Sudip Mukherjee @ 2015-05-11 10:47 UTC (permalink / raw)
  To: Oleg Drokin, Andreas Dilger, Greg Kroah-Hartman
  Cc: HPDD-discuss, devel, linux-kernel, Sudip Mukherjee

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

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
 drivers/staging/lustre/lustre/lov/lov_request.c | 4 +---
 drivers/staging/lustre/lustre/obdclass/acl.c    | 1 -
 2 files changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/staging/lustre/lustre/lov/lov_request.c b/drivers/staging/lustre/lustre/lov/lov_request.c
index f6e1314..d24ba8e 100644
--- a/drivers/staging/lustre/lustre/lov/lov_request.c
+++ b/drivers/staging/lustre/lustre/lov/lov_request.c
@@ -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);
 
diff --git a/drivers/staging/lustre/lustre/obdclass/acl.c b/drivers/staging/lustre/lustre/obdclass/acl.c
index 194c48a..bc3fc47 100644
--- a/drivers/staging/lustre/lustre/obdclass/acl.c
+++ b/drivers/staging/lustre/lustre/obdclass/acl.c
@@ -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))
-- 
1.8.1.2


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] staging: lustre: remove unused variable
  2015-05-11 10:47 [PATCH] staging: lustre: remove unused variable Sudip Mukherjee
@ 2015-05-11 11:31 ` Dan Carpenter
  2015-05-11 11:43   ` Sudip Mukherjee
  0 siblings, 1 reply; 7+ messages in thread
From: Dan Carpenter @ 2015-05-11 11:31 UTC (permalink / raw)
  To: Sudip Mukherjee
  Cc: Oleg Drokin, Andreas Dilger, Greg Kroah-Hartman, HPDD-discuss,
	devel, linux-kernel

On Mon, May 11, 2015 at 04:17:10PM +0530, Sudip Mukherjee wrote:
> there variables were not used anywhere and was showing as build warning.
> 
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
>  drivers/staging/lustre/lustre/lov/lov_request.c | 4 +---
>  drivers/staging/lustre/lustre/obdclass/acl.c    | 1 -
>  2 files changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/lov/lov_request.c b/drivers/staging/lustre/lustre/lov/lov_request.c
> index f6e1314..d24ba8e 100644
> --- a/drivers/staging/lustre/lustre/lov/lov_request.c
> +++ b/drivers/staging/lustre/lustre/lov/lov_request.c
> @@ -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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] staging: lustre: remove unused variable
  2015-05-11 11:31 ` Dan Carpenter
@ 2015-05-11 11:43   ` Sudip Mukherjee
  2015-05-11 11:53     ` Drokin, Oleg
  0 siblings, 1 reply; 7+ messages in thread
From: Sudip Mukherjee @ 2015-05-11 11:43 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Oleg Drokin, Andreas Dilger, Greg Kroah-Hartman, HPDD-discuss,
	devel, linux-kernel

On Mon, May 11, 2015 at 02:31:02PM +0300, Dan Carpenter wrote:
> On Mon, May 11, 2015 at 04:17:10PM +0530, Sudip Mukherjee wrote:
> > -	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

> 
> regards,
> dan carpenter
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] staging: lustre: remove unused variable
  2015-05-11 11:43   ` Sudip Mukherjee
@ 2015-05-11 11:53     ` Drokin, Oleg
  0 siblings, 0 replies; 7+ messages in thread
From: Drokin, Oleg @ 2015-05-11 11:53 UTC (permalink / raw)
  To: Sudip Mukherjee
  Cc: Dan Carpenter, Dilger, Andreas, Greg Kroah-Hartman,
	<HPDD-discuss@ml01.01.org>,
	<devel@driverdev.osuosl.org>,
	<linux-kernel@vger.kernel.org>

Hello!
On May 11, 2015, at 7:43 AM, Sudip Mukherjee wrote:

> On Mon, May 11, 2015 at 02:31:02PM +0300, Dan Carpenter wrote:
>> On Mon, May 11, 2015 at 04:17:10PM +0530, Sudip Mukherjee wrote:
>>> -	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 :( 

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [patch] staging: lustre: remove unused variable
  2015-11-03 22:38 ` Simmons, James A.
@ 2015-11-04  1:23   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 7+ messages in thread
From: Greg Kroah-Hartman @ 2015-11-04  1:23 UTC (permalink / raw)
  To: lustre-devel

On Tue, Nov 03, 2015 at 10:38:15PM +0000, Simmons, James A. wrote:
> 
> >The "->lr_lvb_data" struct member is never used.  Delete it.
> >
> >Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> >---
> >I have compile tested this.  I looked through the history and it seems
> >to never have been used.  I wonder if we can remove the locking as well.
> 
> This is used by the quota and ofd layer which are both server side. 

What does that mean here?

confused,

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [patch] staging: lustre: remove unused variable
  2015-11-03 22:16 [patch] " Dan Carpenter
@ 2015-11-03 22:38 ` Simmons, James A.
  2015-11-04  1:23   ` Greg Kroah-Hartman
  0 siblings, 1 reply; 7+ messages in thread
From: Simmons, James A. @ 2015-11-03 22:38 UTC (permalink / raw)
  To: lustre-devel


>The "->lr_lvb_data" struct member is never used.  Delete it.
>
>Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>---
>I have compile tested this.  I looked through the history and it seems
>to never have been used.  I wonder if we can remove the locking as well.

This is used by the quota and ofd layer which are both server side. 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [patch] staging: lustre: remove unused variable
@ 2015-11-03 22:16 Dan Carpenter
  2015-11-03 22:38 ` Simmons, James A.
  0 siblings, 1 reply; 7+ messages in thread
From: Dan Carpenter @ 2015-11-03 22:16 UTC (permalink / raw)
  To: lustre-devel

The "->lr_lvb_data" struct member is never used.  Delete it.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
I have compile tested this.  I looked through the history and it seems
to never have been used.  I wonder if we can remove the locking as well.

diff --git a/drivers/staging/lustre/lustre/include/lustre_dlm.h b/drivers/staging/lustre/lustre/include/lustre_dlm.h
index 0e75a15..138479a 100644
--- a/drivers/staging/lustre/lustre/include/lustre_dlm.h
+++ b/drivers/staging/lustre/lustre/include/lustre_dlm.h
@@ -872,8 +872,6 @@ struct ldlm_resource {
 	 */
 	struct mutex		lr_lvb_mutex;
 	int			lr_lvb_len;
-	/** protected by lr_lock */
-	void			*lr_lvb_data;
 
 	/** When the resource was considered as contended. */
 	unsigned long		lr_contention_time;
diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
index c0a54bf..b55a4f0 100644
--- a/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
+++ b/drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
@@ -1154,8 +1154,6 @@ ldlm_resource_get(struct ldlm_namespace *ns, struct ldlm_resource *parent,
 			CERROR("%s: lvbo_init failed for resource %#llx:%#llx: rc = %d\n",
 			       ns->ns_obd->obd_name, name->name[0],
 			       name->name[1], rc);
-			kfree(res->lr_lvb_data);
-			res->lr_lvb_data = NULL;
 			res->lr_lvb_len = rc;
 			mutex_unlock(&res->lr_lvb_mutex);
 			ldlm_resource_putref(res);

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-11-04  1:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-11 10:47 [PATCH] staging: lustre: remove unused variable Sudip Mukherjee
2015-05-11 11:31 ` Dan Carpenter
2015-05-11 11:43   ` Sudip Mukherjee
2015-05-11 11:53     ` Drokin, Oleg
2015-11-03 22:16 [patch] " Dan Carpenter
2015-11-03 22:38 ` Simmons, James A.
2015-11-04  1:23   ` Greg Kroah-Hartman

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.