aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2015-04-30 18:37:42 -0400
committerDavid S. Miller <davem@davemloft.net>2015-05-03 23:08:54 -0400
commitc2c8a901660dcc647ffe5f6dcb1e4c500a5442aa (patch)
treec3587da63227bc63f281af80432df5b5de3576c0 /lib
parent1aa661f5c3df15432530f01f1023d556fa81b95d (diff)
rhashtable-test: Get rid of ptr in test_obj structure
This only blows up the size of the test structure for no gain in test coverage. Reduces size of test_obj from 24 to 16 bytes. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'lib')
-rw-r--r--lib/test_rhashtable.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/test_rhashtable.c b/lib/test_rhashtable.c
index e3d31bf527a9..d6d6719b61b7 100644
--- a/lib/test_rhashtable.c
+++ b/lib/test_rhashtable.c
@@ -22,7 +22,6 @@
22#include <linux/slab.h> 22#include <linux/slab.h>
23 23
24 24
25#define TEST_PTR ((void *) 0xdeadbeef)
26#define MAX_ENTRIES 1000000 25#define MAX_ENTRIES 1000000
27 26
28static int entries = 50000; 27static int entries = 50000;
@@ -46,7 +45,6 @@ module_param(size, int, 0);
46MODULE_PARM_DESC(size, "Initial size hint of table (default: 8)"); 45MODULE_PARM_DESC(size, "Initial size hint of table (default: 8)");
47 46
48struct test_obj { 47struct test_obj {
49 void *ptr;
50 int value; 48 int value;
51 struct rhash_head node; 49 struct rhash_head node;
52}; 50};
@@ -78,9 +76,9 @@ static int __init test_rht_lookup(struct rhashtable *ht)
78 key); 76 key);
79 return -EEXIST; 77 return -EEXIST;
80 } else if (expected && obj) { 78 } else if (expected && obj) {
81 if (obj->ptr != TEST_PTR || obj->value != i) { 79 if (obj->value != i) {
82 pr_warn("Test failed: Lookup value mismatch %p!=%p, %u!=%u\n", 80 pr_warn("Test failed: Lookup value mismatch %u!=%u\n",
83 obj->ptr, TEST_PTR, obj->value, i); 81 obj->value, i);
84 return -EINVAL; 82 return -EINVAL;
85 } 83 }
86 } 84 }
@@ -153,7 +151,6 @@ static s64 __init test_rhashtable(struct rhashtable *ht)
153 goto error; 151 goto error;
154 } 152 }
155 153
156 obj->ptr = TEST_PTR;
157 obj->value = i * 2; 154 obj->value = i * 2;
158 155
159 err = rhashtable_insert_fast(ht, &obj->node, test_rht_params); 156 err = rhashtable_insert_fast(ht, &obj->node, test_rht_params);