From 4603262b4cdb8244379f532782b1579fe5520f5f Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Mon, 10 Nov 2008 00:57:02 +0100 Subject: [PATCH] Cosmetic cleanups. --- user.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/user.c b/user.c index 1bdd34b..5151025 100644 --- 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; -- 2.39.2