From nobody Tue Dec 26 19:22:17 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4T04Qy1FR3z55Nqh; Tue, 26 Dec 2023 19:22:18 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4T04Qy0r4Lz3MBT; Tue, 26 Dec 2023 19:22:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703618538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yyt9dhBHchZl/NTM0tSwO9/F6c6g/ur9wZUMGfCITbg=; b=Ni63rS+iHwtVuiEpjOskFLB5+a6H9fYNINsYF8EXr0ugbrIVK4wmGU/ARVHcKNZ68bK7pl wft5kLJJzqvp4lt3qw01qdEwnl16mNYm/xTLBryngfZHDfWWE92ij75a7moGu1eXLlzMQx 2LqRY8UUjYiHe/iSoVn7f8YPi4d7RenF/ltJhi4BJEicFfK8wE/o1W2BDtKtfsdeUM8mO2 ohysSw+ma0X7wmVJTWu1gxs621CwFIGOdSwHRBCwVKfI3qsjF2Be8qDgjF0IsVz1FFRLgr Nt+KxuBmi8stUlfZii1GpfKyoIM4iq8sYYvZx0+ERLlfLrLm7e0hzFkT35DgEQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1703618538; a=rsa-sha256; cv=none; b=kXn4gimVGxDyySP3pzyuy1ErupKR/mWDW0rp+dZ5LAxYJDDyYfPbHXF63bLQKuXN/WyWxx 3aebbym1wtAT4c4HikBMqzurVCLiNpXCBm/ybyunok+XfBk3cD+i0U1vXu6xQythWD/KGJ +Ki9ffe+F6Q5QLj7nePgWtD20FfJdhPjJ/whV57gh+KMZUmXRrVAaM/oHHYgGFPNNwZaKi fb1xqWPGm9NwsmMu31WIkv9Y95Fhi04+NrLEpk2yhZaFYHzILbmyCi2NEKWVriSCjpP/Qj lRn8RUyvsQadTLMZNPk7LU5GgwBLYUkCbgGSDECVZeFjPubd75YJZiuOWKMBiQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1703618538; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=yyt9dhBHchZl/NTM0tSwO9/F6c6g/ur9wZUMGfCITbg=; b=olIDsifosmJebOwiKg+48I5jADw7Hni8J11QoPMk4hqz/6jDFWrKcmAEnJFnImOVjwMnJ4 +DWH1+3velMOSKrnYbWLrg4VUyl26UIJtKIOzc8vi8ma9st8uLV7ms65A+vDX9sJYpycxn b7g4Y51ZxEUCIX3Q/SXt+z2Dye7RKEPgU5YPWVhUwGT0wuJ/KkFuOUAlQI48j0gmNlnikI fr7UDpZE5ODPzEcdilGvmeCMuG+fl71/MyQchB2vcUuJYLr9atxNgV1GwaKZF5i7wA4S65 RM5gfrsVXVMFsQd8uDGLDn2crF8kEk7slyVWV/Wv1dUoOFhzsj33Ba93IDHhXQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4T04Qx7134z16gM; Tue, 26 Dec 2023 19:22:17 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 3BQJMHPS046201; Tue, 26 Dec 2023 19:22:17 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 3BQJMHaW046198; Tue, 26 Dec 2023 19:22:17 GMT (envelope-from git) Date: Tue, 26 Dec 2023 19:22:17 GMT Message-Id: <202312261922.3BQJMHaW046198@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: bf7830d79dd0 - main - ofed: use ANSI C functions definitions in opensm/sm.c List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: bf7830d79dd02a84225c93130c2dce68e0a541d6 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=bf7830d79dd02a84225c93130c2dce68e0a541d6 commit bf7830d79dd02a84225c93130c2dce68e0a541d6 Author: Konstantin Belousov AuthorDate: 2023-12-26 19:16:49 +0000 Commit: Konstantin Belousov CommitDate: 2023-12-26 19:22:01 +0000 ofed: use ANSI C functions definitions in opensm/sm.c Sponsored by: NVidia networking MFC after: 1 week --- contrib/ofed/opensm/opensm/st.c | 71 ++++++++++++----------------------------- 1 file changed, 21 insertions(+), 50 deletions(-) diff --git a/contrib/ofed/opensm/opensm/st.c b/contrib/ofed/opensm/opensm/st.c index c2ee01474c23..7dba30644d61 100644 --- a/contrib/ofed/opensm/opensm/st.c +++ b/contrib/ofed/opensm/opensm/st.c @@ -174,7 +174,7 @@ static int new_size(int size) static int collision = 0; static int init_st = 0; -static void stat_col() +static void stat_col(void) { FILE *f = fopen("/var/log/osm_st_col", "w"); fprintf(f, "collision: %d\n", collision); @@ -182,9 +182,7 @@ static void stat_col() } #endif -st_table *st_init_table_with_size(type, size) -struct st_hash_type *type; -size_t size; +st_table *st_init_table_with_size(struct st_hash_type *type, size_t size) { st_table *tbl; @@ -208,8 +206,7 @@ size_t size; return tbl; } -st_table *st_init_table(type) -struct st_hash_type *type; +st_table *st_init_table(struct st_hash_type *type) { return st_init_table_with_size(type, 0); } @@ -219,8 +216,7 @@ st_table *st_init_numtable(void) return st_init_table(&type_numhash); } -st_table *st_init_numtable_with_size(size) -size_t size; +st_table *st_init_numtable_with_size(size_t size) { return st_init_table_with_size(&type_numhash, size); } @@ -230,14 +226,12 @@ st_table *st_init_strtable(void) return st_init_table(&type_strhash); } -st_table *st_init_strtable_with_size(size) -size_t size; +st_table *st_init_strtable_with_size(size_t size) { return st_init_table_with_size(&type_strhash, size); } -void st_free_table(table) -st_table *table; +void st_free_table(st_table *table) { register st_table_entry *ptr, *next; int i; @@ -276,10 +270,7 @@ st_table *table; }\ } while (0) -int st_lookup(table, key, value) -st_table *table; -register st_data_t key; -st_data_t *value; +int st_lookup(st_table *table, st_data_t key, st_data_t *value) { unsigned int hash_val, bin_pos; register st_table_entry *ptr; @@ -315,10 +306,7 @@ do {\ table->num_entries++;\ } while (0); -int st_insert(table, key, value) -register st_table *table; -register st_data_t key; -st_data_t value; +int st_insert(st_table *table, st_data_t key, st_data_t value) { unsigned int hash_val, bin_pos; register st_table_entry *ptr; @@ -335,10 +323,7 @@ st_data_t value; } } -void st_add_direct(table, key, value) -st_table *table; -st_data_t key; -st_data_t value; +void st_add_direct(st_table *table, st_data_t key, st_data_t value) { unsigned int hash_val, bin_pos; @@ -347,8 +332,7 @@ st_data_t value; ADD_DIRECT(table, key, value, hash_val, bin_pos); } -static void rehash(table) -register st_table *table; +static void rehash(st_table *table) { register st_table_entry *ptr, *next, **new_bins; int i, old_num_bins = table->num_bins, new_num_bins; @@ -376,8 +360,7 @@ register st_table *table; table->bins = new_bins; } -st_table *st_copy(old_table) -st_table *old_table; +st_table *st_copy(st_table *old_table) { st_table *new_table; st_table_entry *ptr, *entry; @@ -416,10 +399,7 @@ st_table *old_table; return new_table; } -int st_delete(table, key, value) -register st_table *table; -register st_data_t *key; -st_data_t *value; +int st_delete(st_table *table, st_data_t *key, st_data_t *value) { unsigned int hash_val; st_table_entry *tmp; @@ -460,11 +440,8 @@ st_data_t *value; return 0; } -int st_delete_safe(table, key, value, never) -register st_table *table; -register st_data_t *key; -st_data_t *value; -st_data_t never; +int st_delete_safe(st_table *table, st_data_t *key, st_data_t *value, + st_data_t never) { unsigned int hash_val; register st_table_entry *ptr; @@ -499,9 +476,7 @@ static int delete_never(st_data_t key, st_data_t value, st_data_t never) return ST_CONTINUE; } -void st_cleanup_safe(table, never) -st_table *table; -st_data_t never; +void st_cleanup_safe(st_table *table, st_data_t never) { int num_entries = table->num_entries; @@ -509,10 +484,9 @@ st_data_t never; table->num_entries = num_entries; } -void st_foreach(table, func, arg) -st_table *table; -int (*func) (st_data_t key, st_data_t val, st_data_t arg); -st_data_t arg; +void st_foreach(st_table *table, + int (*func)(st_data_t key, st_data_t val, st_data_t arg), + st_data_t arg) { st_table_entry *ptr, *last, *tmp; enum st_retval retval; @@ -544,8 +518,7 @@ st_data_t arg; } } -static int strhash(string) -register const char *string; +static int strhash(const char *string) { register int c; @@ -578,14 +551,12 @@ register const char *string; #endif } -static int numcmp(x, y) -void *x, *y; +static int numcmp(void *x, void *y) { return (st_ptr_t) x != (st_ptr_t) y; } -static st_ptr_t numhash(n) -void *n; +static st_ptr_t numhash(void *n) { return (st_ptr_t) n; }