diff options
author | Ben Pfaff <blp@nicira.com> | 2010-08-03 14:37:22 -0700 |
---|---|---|
committer | Ben Pfaff <blp@nicira.com> | 2010-08-06 11:40:04 -0700 |
commit | c393047875e2c9dc76b2f19092fff6bbf69ec4f9 (patch) | |
tree | b87ccdf41ad2e13c7bb1a6811729ed67fb43df92 /lib/tag.c | |
parent | d54ff9987c3bbd9989ee7fef574bdab3207aca60 (diff) |
tag: Use existing macro instead of constant.
N_TAG_BITS is always 32, currently, because tag_type is a typedef
for uint32_t, so this does not fix an actual bug.
Diffstat (limited to 'lib/tag.c')
-rw-r--r-- | lib/tag.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ /* - * Copyright (c) 2008, 2009 Nicira Networks. + * Copyright (c) 2008, 2009, 2010 Nicira Networks. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,7 +49,7 @@ tag_type tag_create_deterministic(uint32_t seed) { int x = seed & (N_TAG_BITS - 1); - int y = (seed >> LOG2_N_TAG_BITS) % 31; + int y = (seed >> LOG2_N_TAG_BITS) % (N_TAG_BITS - 1); y += y >= x; return (1u << x) | (1u << y); } |