Skip to contentSkip to conversation

lib/btree: Kill unused MAX macro

PATCH In review Denis Kirjanov <[email protected] 3 participants 3 messages May 12, 2010 – May 14, 2010 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 lib/btree: Kill unused MAX macro

Kill unused MAX macro

---

lib/btree.c +0 -1
index 41859a8..f833949 100644
@@ -45,7 +45,6 @@
 #include <linux/slab.h>
 #include <linux/module.h>
 
-#define MAX(a, b) ((a) > (b) ? (a) : (b))
 #define NODESIZE MAX(L1_CACHE_BYTES, 128)
 
 struct btree_geo {
maintainer
#1 lore raw

lib/btree.c line 48

Quoted 13 lines · On Thu, 13 May 2010 01:17:24 +0400 "Denis Kirjanov <[email protected]"…

Kill unused MAX macro

---

lib/btree.c +0 -1
index 41859a8..f833949 100644
@@ -45,7 +45,6 @@
 #include <linux/slab.h>
 #include <linux/module.h>
 
-#define MAX(a, b) ((a) > (b) ? (a) : (b))

It's used on the very next line:

lib/btree.c line 48

Quoted 1 line
lib/btree.c +0 -0
 #define NODESIZE MAX(L1_CACHE_BYTES, 128)

And we cannot use max() here because it's evaluated at compile-time.

Also, this reader is quite unable to determine why this forumation for NODESIZE was chosen. As few kernel programmers can read Joern's mind, I'd suggest that a code comment is in order.

#2 lore raw
Quoted 4 lines · Andrew Morton

Also, this reader is quite unable to determine why this forumation for NODESIZE was chosen. As few kernel programmers can read Joern's mind, I'd suggest that a code comment is in order.

Ack. I'm currently on vacation, so it will have to wait until next week.

Jörn

Signature · 3 lines
Unless something dramatically changes, by 2015 we'll be largely
wondering what all the fuss surrounding Linux was really about.
-- Rob Enderle