Skip to contentSkip to conversation

staging: lustre fix constant comparision style issue in lu_object.h

PATCH In review Craig Inches 3 participants 4 messages Mar 11, 2017 – Mar 13, 2017 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 staging: lustre fix constant comparision style issue in lu_object.h

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

---
 drivers/staging/lustre/lustre/include/lu_object.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/lustre/lustre/include/lu_object.h +1 -1
index 7a4f412..02be805 100644
@@ -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)				\
Signature · 1 line
2.10.2
maintainer
#1 lore raw
Quoted 2 lines · Craig Inches

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

#2 lore raw
Quoted 6 lines · Greg KH
Quoted 2 lines · Craig Inches

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

#3 lore raw
Quoted 5 lines · Dan Carpenter
Quoted 4 lines · Greg KH
Quoted 2 lines · Craig Inches

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

Quoted 9 lines
Quoted 2 lines

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