From nobody Mon Feb 9 07:23:06 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=quarantine dis=none) header.from=suse.com ARC-Seal: i=1; a=rsa-sha256; t=1642778507; cv=none; d=zohomail.com; s=zohoarc; b=AxJXTSJzrjCB/q4ZUTJQv5yqUNET53GPxsZjlbDxGH9mG5t0O62vrFvmyBGn+xbT8ggAhermryCQoypdO7bxBjvlT5z8tAC5mWeGhBFfS6qFfsmdxgi7oz8itIgH1etUJgptjYDheVFCMyxwnej3/l4gG+bcrZSNXLwIgTLsIwk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1642778507; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=O9732WdVSEHkO7bksmSTG5m8vSoXsF5+FW9lmh0rLLs=; b=ZcZfRLS0P74kohqqiZ4fDsMN3H//oBPlTVo3btjlbArIvokxxcCfNdng7DuBI82YJee9fjmQo5zjHrJNtQak4bGd8KGYeAVV+D0cr6Nwk3TzWPcg7d16Ma1zyKmd06FpvqF5LHDbGUvB6ExGwKvQDJLc4PI+eIdPEgg5IYqTRRU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1642778507680366.3462398342127; Fri, 21 Jan 2022 07:21:47 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.259391.447717 (Exim 4.92) (envelope-from ) id 1nAvjE-00041B-AB; Fri, 21 Jan 2022 15:21:28 +0000 Received: by outflank-mailman (output) from mailman id 259391.447717; Fri, 21 Jan 2022 15:21:28 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nAvjE-0003zL-47; Fri, 21 Jan 2022 15:21:28 +0000 Received: by outflank-mailman (input) for mailman id 259391; Fri, 21 Jan 2022 15:21:26 +0000 Received: from se1-gles-flk1-in.inumbo.com ([94.247.172.50] helo=se1-gles-flk1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1nAvjC-0003JS-Ad for xen-devel@lists.xenproject.org; Fri, 21 Jan 2022 15:21:26 +0000 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by se1-gles-flk1.inumbo.com (Halon) with ESMTPS id cb099909-7acd-11ec-bc18-3156f6d857e4; Fri, 21 Jan 2022 16:21:23 +0100 (CET) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 6711F21984; Fri, 21 Jan 2022 15:21:23 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 3ACA5139FE; Fri, 21 Jan 2022 15:21:23 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 0MAlDXPP6mFpAgAAMHmgww (envelope-from ); Fri, 21 Jan 2022 15:21:23 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: cb099909-7acd-11ec-bc18-3156f6d857e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1642778483; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=O9732WdVSEHkO7bksmSTG5m8vSoXsF5+FW9lmh0rLLs=; b=AZDKhfiG9ScnlbZp73vc2ZT78gHhwJjaDRasVlqh2mfTanN95N5NS7AJsS3avwPnfBPaJ6 Lq5Gg5Qruh2s3af7gY5qF5BenHa4H/0Rvz4DD9qem81SbgIwbeW7iTKen7FM8srYuZIpXq /+H/EKtn6V+Sw7DkcTMl5rpBorhFAfo= From: Juergen Gross To: xen-devel@lists.xenproject.org Cc: Juergen Gross , Wei Liu , Julien Grall , Anthony PERARD Subject: [PATCH v2 3/3] tools/xenstore: drop DEFINE_HASHTABLE_* macros and usage intro Date: Fri, 21 Jan 2022 16:21:20 +0100 Message-Id: <20220121152120.23160-4-jgross@suse.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220121152120.23160-1-jgross@suse.com> References: <20220121152120.23160-1-jgross@suse.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @suse.com) X-ZM-MESSAGEID: 1642778509319100004 Content-Type: text/plain; charset="utf-8" The DEFINE_HASHTABLE_* macros are used nowhere, so drop them. The usage intro isn't really needed either. Signed-off-by: Juergen Gross Reviewed-by: Anthony PERARD --- V2: - reword commit message (Anthony PERARD) --- tools/xenstore/hashtable.h | 76 -------------------------------------- 1 file changed, 76 deletions(-) diff --git a/tools/xenstore/hashtable.h b/tools/xenstore/hashtable.h index b90781abd4..62fef6081a 100644 --- a/tools/xenstore/hashtable.h +++ b/tools/xenstore/hashtable.h @@ -5,62 +5,6 @@ =20 struct hashtable; =20 -/* Example of use: - * - * struct hashtable *h; - * struct some_key *k; - * struct some_value *v; - * - * static unsigned int hash_from_key_fn( void *k ); - * static int keys_equal_fn ( void *key1, void *key2= ); - * - * h =3D create_hashtable(16, hash_from_key_fn, keys_equal_fn); - * k =3D (struct some_key *) malloc(sizeof(struct some_key)); - * v =3D (struct some_value *) malloc(sizeof(struct some_value)); - * - * (initialise k and v to suitable values) - *=20 - * if (! hashtable_insert(h,k,v) ) - * { exit(-1); } - * - * if (NULL =3D=3D (found =3D hashtable_search(h,k) )) - * { printf("not found!"); } - * - * if (NULL =3D=3D (found =3D hashtable_remove(h,k) )) - * { printf("Not found\n"); } - * - */ - -/* Macros may be used to define type-safe(r) hashtable access functions, w= ith - * methods specialized to take known key and value types as parameters. - *=20 - * Example: - * - * Insert this at the start of your file: - * - * DEFINE_HASHTABLE_INSERT(insert_some, struct some_key, struct some_value= ); - * DEFINE_HASHTABLE_SEARCH(search_some, struct some_key, struct some_value= ); - * DEFINE_HASHTABLE_REMOVE(remove_some, struct some_key, struct some_value= ); - * - * This defines the functions 'insert_some', 'search_some' and 'remove_som= e'. - * These operate just like hashtable_insert etc., with the same parameters, - * but their function signatures have 'struct some_key *' rather than - * 'void *', and hence can generate compile time errors if your program is - * supplying incorrect data as a key (and similarly for value). - * - * Note that the hash and key equality functions passed to create_hashtable - * still take 'void *' parameters instead of 'some key *'. This shouldn't = be - * a difficult issue as they're only defined and passed once, and the other - * functions will ensure that only valid keys are supplied to them. - * - * The cost for this checking is increased code size and runtime overhead - * - if performance is important, it may be worth switching back to the - * unsafe methods once your program has been debugged with the safe method= s. - * This just requires switching to some simple alternative defines - eg: - * #define insert_some hashtable_insert - * - */ - /*************************************************************************= **** * create_hashtable =20 @@ -98,12 +42,6 @@ create_hashtable(unsigned int minsize, int=20 hashtable_insert(struct hashtable *h, void *k, void *v); =20 -#define DEFINE_HASHTABLE_INSERT(fnname, keytype, valuetype) \ -int fnname (struct hashtable *h, keytype *k, valuetype *v) \ -{ \ - return hashtable_insert(h,k,v); \ -} - /*************************************************************************= **** * hashtable_search =20 @@ -116,12 +54,6 @@ int fnname (struct hashtable *h, keytype *k, valuetype = *v) \ void * hashtable_search(struct hashtable *h, void *k); =20 -#define DEFINE_HASHTABLE_SEARCH(fnname, keytype, valuetype) \ -valuetype * fnname (struct hashtable *h, keytype *k) \ -{ \ - return (valuetype *) (hashtable_search(h,k)); \ -} - /*************************************************************************= **** * hashtable_remove =20 @@ -134,13 +66,6 @@ valuetype * fnname (struct hashtable *h, keytype *k) \ void * /* returns value */ hashtable_remove(struct hashtable *h, void *k); =20 -#define DEFINE_HASHTABLE_REMOVE(fnname, keytype, valuetype) \ -valuetype * fnname (struct hashtable *h, keytype *k) \ -{ \ - return (valuetype *) (hashtable_remove(h,k)); \ -} - - /*************************************************************************= **** * hashtable_count =20 @@ -151,7 +76,6 @@ valuetype * fnname (struct hashtable *h, keytype *k) \ unsigned int hashtable_count(struct hashtable *h); =20 - /*************************************************************************= **** * hashtable_destroy =20 --=20 2.31.1