]> git.tuebingen.mpg.de Git - adu.git/commitdiff
Cosmetic cleanups.
authorAndre Noll <maan@systemlinux.org>
Sun, 9 Nov 2008 23:57:02 +0000 (00:57 +0100)
committerAndre Noll <maan@systemlinux.org>
Sun, 9 Nov 2008 23:57:02 +0000 (00:57 +0100)
user.c

diff --git a/user.c b/user.c
index 1bdd34bbc9274ebe74ffd8d0401e9ecdae3cdf9e..51510256b9994e9291989177b83edae695775045 100644 (file)
--- a/user.c
+++ b/user.c
@@ -54,7 +54,7 @@ static uint32_t uid_hash_table_size;
 static int *uid_hash_table_sort_idx;
 
 /** The number of used slots in the hash table. */
-static uint32_t num_uids = 0;
+static uint32_t num_uids;
 
 /*
  * The columns of the per-user tables.
@@ -346,7 +346,7 @@ void close_user_tables(void)
 
 /*
  * We use a hash table of size s=2^uid_hash_bits to map the uids into the
- * interval [0..s]. Hash collisions are treated by open addressing, i.e.
+ * interval [0..s-1]. Hash collisions are treated by open addressing, i.e.
  * unused slots in the table are used to store different uids that hash to the
  * same slot.
  *
@@ -358,7 +358,7 @@ void close_user_tables(void)
  * An odd number is sufficient to make sure each entry of the hash table gets
  * probed for probe_num between 0 and s-1 because s is a power of two, hence
  * the second hash value has never a common divisor with the hash table size.
- * IOW: h is invertible in the ring [0..s].
+ * IOW: h is invertible in the ring [0..s-1].
  */
 static uint32_t double_hash(uint32_t uid, uint32_t probe_num)
 {
@@ -424,9 +424,8 @@ int open_admissible_user_tables(struct uid_range *admissible_uids)
        FOR_EACH_USER(ui) {
                int ret;
 
-               if (!ui_used(ui)) {
+               if (!ui_used(ui))
                        continue;
-               }
                if (!uid_is_admissible(ui->uid, admissible_uids)) {
                        DEBUG_LOG("uid %u is not admissible\n", ui->uid);
                        ui->flags &= ~UI_FL_ADMISSIBLE;