* [PATCH] Staging: lustre: Remove unneeded variable and replace its uses
@ 2015-03-10 13:42 Vatika Harlalka
2015-03-10 13:47 ` [Outreachy kernel] " Julia Lawall
2015-03-15 10:20 ` Greg KH
0 siblings, 2 replies; 5+ messages in thread
From: Vatika Harlalka @ 2015-03-10 13:42 UTC (permalink / raw)
To: outreachy-kernel
Variable dotdot is only used as a function parameter and
can be replaced there directly to improve code compactness.
Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
---
drivers/staging/lustre/lustre/llite/llite_nfs.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/lustre/lustre/llite/llite_nfs.c b/drivers/staging/lustre/lustre/llite/llite_nfs.c
index 6a67e71..b8ced3d 100644
--- a/drivers/staging/lustre/lustre/llite/llite_nfs.c
+++ b/drivers/staging/lustre/lustre/llite/llite_nfs.c
@@ -287,7 +287,6 @@ static struct dentry *ll_get_parent(struct dentry *dchild)
struct ll_sb_info *sbi;
struct dentry *result = NULL;
struct mdt_body *body;
- static const char dotdot[] = "..";
struct md_op_data *op_data;
int rc;
int lmmsize;
@@ -303,8 +302,8 @@ static struct dentry *ll_get_parent(struct dentry *dchild)
if (rc != 0)
return ERR_PTR(rc);
- op_data = ll_prep_md_op_data(NULL, dir, NULL, dotdot,
- strlen(dotdot), lmmsize,
+ op_data = ll_prep_md_op_data(NULL, dir, NULL, "..",
+ 2, lmmsize,
LUSTRE_OPC_ANY, NULL);
if (IS_ERR(op_data))
return (void *)op_data;
@@ -321,7 +320,7 @@ static struct dentry *ll_get_parent(struct dentry *dchild)
CDEBUG(D_INFO, "parent for "DFID" is "DFID"\n",
PFID(ll_inode2fid(dir)), PFID(&body->fid1));
- result = ll_iget_for_nfs(dir->i_sb, &body->fid1, NULL);
+
ptlrpc_req_finished(req);
return result;
--
1.9.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: lustre: Remove unneeded variable and replace its uses
2015-03-10 13:42 [PATCH] Staging: lustre: Remove unneeded variable and replace its uses Vatika Harlalka
@ 2015-03-10 13:47 ` Julia Lawall
2015-03-10 14:00 ` Vatika Harlalka
2015-03-15 10:20 ` Greg KH
1 sibling, 1 reply; 5+ messages in thread
From: Julia Lawall @ 2015-03-10 13:47 UTC (permalink / raw)
To: Vatika Harlalka; +Cc: outreachy-kernel
On Tue, 10 Mar 2015, Vatika Harlalka wrote:
> Variable dotdot is only used as a function parameter and
> can be replaced there directly to improve code compactness.
How did you find it? (Just curious).
julia
>
> Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
> ---
> drivers/staging/lustre/lustre/llite/llite_nfs.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/lustre/lustre/llite/llite_nfs.c b/drivers/staging/lustre/lustre/llite/llite_nfs.c
> index 6a67e71..b8ced3d 100644
> --- a/drivers/staging/lustre/lustre/llite/llite_nfs.c
> +++ b/drivers/staging/lustre/lustre/llite/llite_nfs.c
> @@ -287,7 +287,6 @@ static struct dentry *ll_get_parent(struct dentry *dchild)
> struct ll_sb_info *sbi;
> struct dentry *result = NULL;
> struct mdt_body *body;
> - static const char dotdot[] = "..";
> struct md_op_data *op_data;
> int rc;
> int lmmsize;
> @@ -303,8 +302,8 @@ static struct dentry *ll_get_parent(struct dentry *dchild)
> if (rc != 0)
> return ERR_PTR(rc);
>
> - op_data = ll_prep_md_op_data(NULL, dir, NULL, dotdot,
> - strlen(dotdot), lmmsize,
> + op_data = ll_prep_md_op_data(NULL, dir, NULL, "..",
> + 2, lmmsize,
> LUSTRE_OPC_ANY, NULL);
> if (IS_ERR(op_data))
> return (void *)op_data;
> @@ -321,7 +320,7 @@ static struct dentry *ll_get_parent(struct dentry *dchild)
> CDEBUG(D_INFO, "parent for "DFID" is "DFID"\n",
> PFID(ll_inode2fid(dir)), PFID(&body->fid1));
>
> - result = ll_iget_for_nfs(dir->i_sb, &body->fid1, NULL);
> +
>
> ptlrpc_req_finished(req);
> return result;
> --
> 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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20150310134242.GA9593%40akanksha.
> For more options, visit https://groups.google.com/d/optout.
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: lustre: Remove unneeded variable and replace its uses
2015-03-10 13:47 ` [Outreachy kernel] " Julia Lawall
@ 2015-03-10 14:00 ` Vatika Harlalka
0 siblings, 0 replies; 5+ messages in thread
From: Vatika Harlalka @ 2015-03-10 14:00 UTC (permalink / raw)
To: Julia Lawall; +Cc: outreachy-kernel
[-- Attachment #1: Type: text/plain, Size: 159 bytes --]
I was looking into the checkpatch error related to converting
static char dotdot[] to static const char dotdot[] and then
saw that didn't seem to be required.
[-- Attachment #2: Type: text/html, Size: 227 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: lustre: Remove unneeded variable and replace its uses
2015-03-10 13:42 [PATCH] Staging: lustre: Remove unneeded variable and replace its uses Vatika Harlalka
2015-03-10 13:47 ` [Outreachy kernel] " Julia Lawall
@ 2015-03-15 10:20 ` Greg KH
2015-03-15 10:26 ` Vatika Harlalka
1 sibling, 1 reply; 5+ messages in thread
From: Greg KH @ 2015-03-15 10:20 UTC (permalink / raw)
To: Vatika Harlalka; +Cc: outreachy-kernel
On Tue, Mar 10, 2015 at 07:12:42PM +0530, Vatika Harlalka wrote:
> Variable dotdot is only used as a function parameter and
> can be replaced there directly to improve code compactness.
>
> Signed-off-by: Vatika Harlalka <vatikaharlalka@gmail.com>
> ---
> drivers/staging/lustre/lustre/llite/llite_nfs.c | 7 +++----
> 1 file changed, 3 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/lustre/lustre/llite/llite_nfs.c b/drivers/staging/lustre/lustre/llite/llite_nfs.c
> index 6a67e71..b8ced3d 100644
> --- a/drivers/staging/lustre/lustre/llite/llite_nfs.c
> +++ b/drivers/staging/lustre/lustre/llite/llite_nfs.c
> @@ -287,7 +287,6 @@ static struct dentry *ll_get_parent(struct dentry *dchild)
> struct ll_sb_info *sbi;
> struct dentry *result = NULL;
> struct mdt_body *body;
> - static const char dotdot[] = "..";
> struct md_op_data *op_data;
> int rc;
> int lmmsize;
> @@ -303,8 +302,8 @@ static struct dentry *ll_get_parent(struct dentry *dchild)
> if (rc != 0)
> return ERR_PTR(rc);
>
> - op_data = ll_prep_md_op_data(NULL, dir, NULL, dotdot,
> - strlen(dotdot), lmmsize,
> + op_data = ll_prep_md_op_data(NULL, dir, NULL, "..",
> + 2, lmmsize,
> LUSTRE_OPC_ANY, NULL);
> if (IS_ERR(op_data))
> return (void *)op_data;
> @@ -321,7 +320,7 @@ static struct dentry *ll_get_parent(struct dentry *dchild)
> CDEBUG(D_INFO, "parent for "DFID" is "DFID"\n",
> PFID(ll_inode2fid(dir)), PFID(&body->fid1));
>
> - result = ll_iget_for_nfs(dir->i_sb, &body->fid1, NULL);
> +
Why did you delete this whole function call? That does not seem to
match up with what you said this patch did.
I can't take this as-is, sorry.
greg k-h
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [Outreachy kernel] [PATCH] Staging: lustre: Remove unneeded variable and replace its uses
2015-03-15 10:20 ` Greg KH
@ 2015-03-15 10:26 ` Vatika Harlalka
0 siblings, 0 replies; 5+ messages in thread
From: Vatika Harlalka @ 2015-03-15 10:26 UTC (permalink / raw)
To: Greg KH; +Cc: outreachy-kernel
[-- Attachment #1: Type: text/plain, Size: 123 bytes --]
Sorry, removing the call is a mistake on my side.
I'll resend a patch for this one and will ensure that I'm
more careful !
[-- Attachment #2: Type: text/html, Size: 196 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2015-03-15 10:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-10 13:42 [PATCH] Staging: lustre: Remove unneeded variable and replace its uses Vatika Harlalka
2015-03-10 13:47 ` [Outreachy kernel] " Julia Lawall
2015-03-10 14:00 ` Vatika Harlalka
2015-03-15 10:20 ` Greg KH
2015-03-15 10:26 ` Vatika Harlalka
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.