linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: lustre fix constant comparision style issue in lu_object.h
@ 2017-03-11 13:07 Craig Inches
  2017-03-12 13:37 ` Greg KH
  0 siblings, 1 reply; 4+ messages in thread
From: Craig Inches @ 2017-03-11 13:07 UTC (permalink / raw)
  To: oleg.drokin, andreas.dilger, jsimmons, gregkh
  Cc: lustre-devel, devel, linux-kernel, Craig Inches

This patch resolves the "Comparisons should place the constant on
the right side of the test" found with checkpatch tool.

Signed-off-by: Craig Inches <Craig@craiginches.com>
---
 drivers/staging/lustre/lustre/include/lu_object.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/lustre/lustre/include/lu_object.h b/drivers/staging/lustre/lustre/include/lu_object.h
index 7a4f412..02be805 100644
--- a/drivers/staging/lustre/lustre/include/lu_object.h
+++ b/drivers/staging/lustre/lustre/include/lu_object.h
@@ -1130,7 +1130,7 @@ struct lu_context_key {
 	{							 \
 		type *value;				      \
 								  \
-		BUILD_BUG_ON(PAGE_SIZE < sizeof(*value));        \
+		BUILD_BUG_ON(sizeof(*value) > PAGE_SIZE);        \
 								  \
 		value = kzalloc(sizeof(*value), GFP_NOFS);	\
 		if (!value)				\
-- 
2.10.2

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

* Re: [PATCH] staging: lustre fix constant comparision style issue in lu_object.h
  2017-03-11 13:07 [PATCH] staging: lustre fix constant comparision style issue in lu_object.h Craig Inches
@ 2017-03-12 13:37 ` Greg KH
  2017-03-13 12:11   ` Dan Carpenter
  0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2017-03-12 13:37 UTC (permalink / raw)
  To: Craig Inches
  Cc: oleg.drokin, andreas.dilger, jsimmons, devel, linux-kernel, lustre-devel

On Sat, Mar 11, 2017 at 01:07:40PM +0000, Craig Inches wrote:
> This patch resolves the "Comparisons should place the constant on
> the right side of the test" found with checkpatch tool.

Both are constants, I think checkpatch is the thing that is wrong here,
don't you agree?

thanks,

greg k-h

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

* Re: [PATCH] staging: lustre fix constant comparision style issue in lu_object.h
  2017-03-12 13:37 ` Greg KH
@ 2017-03-13 12:11   ` Dan Carpenter
  2017-03-13 13:13     ` Craig Inches
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2017-03-13 12:11 UTC (permalink / raw)
  To: Greg KH
  Cc: Craig Inches, devel, linux-kernel, oleg.drokin, andreas.dilger,
	lustre-devel

On Sun, Mar 12, 2017 at 02:37:22PM +0100, Greg KH wrote:
> On Sat, Mar 11, 2017 at 01:07:40PM +0000, Craig Inches wrote:
> > This patch resolves the "Comparisons should place the constant on
> > the right side of the test" found with checkpatch tool.
> 
> Both are constants, I think checkpatch is the thing that is wrong here,
> don't you agree?

Sort of constant-ish...  The sizeof(*value) changes each time the macro
is used.  I feel like checkpatch is right.

regads,
dan carpenter

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

* Re: [PATCH] staging: lustre fix constant comparision style issue in lu_object.h
  2017-03-13 12:11   ` Dan Carpenter
@ 2017-03-13 13:13     ` Craig Inches
  0 siblings, 0 replies; 4+ messages in thread
From: Craig Inches @ 2017-03-13 13:13 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Greg KH, devel, linux-kernel, oleg.drokin, andreas.dilger, lustre-devel

On Mon, Mar 13, 2017 at 03:11:10PM +0300, Dan Carpenter wrote:
> On Sun, Mar 12, 2017 at 02:37:22PM +0100, Greg KH wrote:
> > On Sat, Mar 11, 2017 at 01:07:40PM +0000, Craig Inches wrote:
> > > This patch resolves the "Comparisons should place the constant on
> > > the right side of the test" found with checkpatch tool.
> > 
> > Both are constants, I think checkpatch is the thing that is wrong here,
> > don't you agree?
> 
> Sort of constant-ish...  The sizeof(*value) changes each time the macro
> is used.  I feel like checkpatch is right.
> 
> regads,
> dan carpenter
> 

That was my take aswell.. PAGE_SIZE is constant for each boot, but
sizeof could change. Happy to be lead by the more experienced here
though.

Cheers
Craig

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

end of thread, other threads:[~2017-03-13 13:14 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-11 13:07 [PATCH] staging: lustre fix constant comparision style issue in lu_object.h Craig Inches
2017-03-12 13:37 ` Greg KH
2017-03-13 12:11   ` Dan Carpenter
2017-03-13 13:13     ` Craig Inches

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).