All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging: lustre: lustre: osc: Modify right hand side of an assignment
@ 2016-02-10  6:40 Janani Ravichandran
  2016-02-12  3:28 ` [Outreachy kernel] " Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Janani Ravichandran @ 2016-02-10  6:40 UTC (permalink / raw)
  To: outreachy-kernel

This patch modifies an assignment of the form a = (a <op> b);
as: a <op>= b; where <op> is << or >>.
Coccinelle script used:

@@
identifier i;
expression e;
@@

- i = (i >> e);
+ i >>= e;

@@
identifier i;
expression e;
@@

- i = (i << e);
+ i <<= e;

Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
---
 drivers/staging/lustre/lustre/osc/osc_request.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/osc/osc_request.c b/drivers/staging/lustre/lustre/osc/osc_request.c
index 3ae00fc..cebc974 100644
--- a/drivers/staging/lustre/lustre/osc/osc_request.c
+++ b/drivers/staging/lustre/lustre/osc/osc_request.c
@@ -3326,7 +3326,7 @@ static int __init osc_init(void)
 
 	reqsize = 1;
 	while (reqsize < OST_MAXREQSIZE)
-		reqsize = reqsize << 1;
+		reqsize <<= 1;
 
 	/*
 	 * We don't enlarge the request count in OSC pool according to
-- 
2.5.0



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

* Re: [Outreachy kernel] [PATCH] staging: lustre: lustre: osc: Modify right hand side of an assignment
  2016-02-10  6:40 [PATCH] staging: lustre: lustre: osc: Modify right hand side of an assignment Janani Ravichandran
@ 2016-02-12  3:28 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2016-02-12  3:28 UTC (permalink / raw)
  To: Janani Ravichandran; +Cc: outreachy-kernel

On Wed, Feb 10, 2016 at 01:40:15AM -0500, Janani Ravichandran wrote:
> This patch modifies an assignment of the form a = (a <op> b);
> as: a <op>= b; where <op> is << or >>.
> Coccinelle script used:
> 
> @@
> identifier i;
> expression e;
> @@
> 
> - i = (i >> e);
> + i >>= e;
> 
> @@
> identifier i;
> expression e;
> @@
> 
> - i = (i << e);
> + i <<= e;
> 
> Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com>
> ---
>  drivers/staging/lustre/lustre/osc/osc_request.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

The subject line is very "odd", it doesn't say what you are doing.
Well, it does, but it doesn't make much sense.

I understand the changes here, but why are you making them?  They aren't
"fixing" anything, nor making the code "simpler" or "cleaner" or
anything else.  We don't have any coding style rules that forces someone
to write this type of expression only one way, and I don't want to start
doing that either.  So I really don't want to accept patches like this.

Yes, I know I already did, sorry, I'll stop that now.  There has to be
lots of other "real" types of fixes / cleanups that you can do instead,
this code needs a lot of work :)

thanks,

greg k-h


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

end of thread, other threads:[~2016-02-12  3:28 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-10  6:40 [PATCH] staging: lustre: lustre: osc: Modify right hand side of an assignment Janani Ravichandran
2016-02-12  3:28 ` [Outreachy kernel] " Greg KH

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.