From owner-svn-src-head@freebsd.org Fri Dec 30 12:19:42 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 42B7CC972F7; Fri, 30 Dec 2016 12:19:42 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 03BB516B6; Fri, 30 Dec 2016 12:19:41 +0000 (UTC) (envelope-from arybchik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id uBUCJfFW072777; Fri, 30 Dec 2016 12:19:41 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id uBUCJeHV072773; Fri, 30 Dec 2016 12:19:40 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201612301219.uBUCJeHV072773@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Fri, 30 Dec 2016 12:19:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310819 - head/sys/dev/sfxge/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Dec 2016 12:19:42 -0000 Author: arybchik Date: Fri Dec 30 12:19:40 2016 New Revision: 310819 URL: https://svnweb.freebsd.org/changeset/base/310819 Log: sfxge(4): cleanup: add efsys_lock_state_t for type of state param in EFSYS_LOCK() This allows the common code to use the correct type for the lock state local variable passed to EFSYS_LOCK() and EFSYS_UNLOCK(). On Windows, this allows warning supression pragmas to be removed. Submitted by: Andy Moreton Sponsored by: Solarflare Communications, Inc. MFC after: 2 days Modified: head/sys/dev/sfxge/common/ef10_filter.c head/sys/dev/sfxge/common/efsys.h head/sys/dev/sfxge/common/efx_filter.c head/sys/dev/sfxge/common/efx_mcdi.c Modified: head/sys/dev/sfxge/common/ef10_filter.c ============================================================================== --- head/sys/dev/sfxge/common/ef10_filter.c Fri Dec 30 12:10:15 2016 (r310818) +++ head/sys/dev/sfxge/common/ef10_filter.c Fri Dec 30 12:19:40 2016 (r310819) @@ -471,7 +471,7 @@ ef10_filter_restore( efx_filter_spec_t *spec; ef10_filter_table_t *eftp = enp->en_filter.ef_ef10_filter_table; boolean_t restoring; - int state; + efsys_lock_state_t state; efx_rc_t rc; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || @@ -546,7 +546,7 @@ ef10_filter_add_internal( int ins_index; boolean_t replacing = B_FALSE; unsigned int i; - int state; + efsys_lock_state_t state; boolean_t locked = B_FALSE; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || @@ -748,7 +748,7 @@ ef10_filter_delete_internal( efx_rc_t rc; ef10_filter_table_t *table = enp->en_filter.ef_ef10_filter_table; efx_filter_spec_t *spec; - int state; + efsys_lock_state_t state; uint32_t filter_idx = filter_id % EFX_EF10_FILTER_TBL_ROWS; /* @@ -822,7 +822,7 @@ ef10_filter_delete( unsigned int hash; unsigned int depth; unsigned int i; - int state; + efsys_lock_state_t state; boolean_t locked = B_FALSE; EFSYS_ASSERT(enp->en_family == EFX_FAMILY_HUNTINGTON || Modified: head/sys/dev/sfxge/common/efsys.h ============================================================================== --- head/sys/dev/sfxge/common/efsys.h Fri Dec 30 12:10:15 2016 (r310818) +++ head/sys/dev/sfxge/common/efsys.h Fri Dec 30 12:19:40 2016 (r310819) @@ -1094,6 +1094,8 @@ typedef struct efsys_lock_s { #define SFXGE_EFSYS_LOCK_ASSERT_OWNED(_eslp) \ mtx_assert(&(_eslp)->lock, MA_OWNED) +typedef int efsys_lock_state_t; + #define EFSYS_LOCK_MAGIC 0x000010c4 #define EFSYS_LOCK(_lockp, _state) \ Modified: head/sys/dev/sfxge/common/efx_filter.c ============================================================================== --- head/sys/dev/sfxge/common/efx_filter.c Fri Dec 30 12:10:15 2016 (r310818) +++ head/sys/dev/sfxge/common/efx_filter.c Fri Dec 30 12:19:40 2016 (r310819) @@ -1047,7 +1047,7 @@ siena_filter_tbl_clear( siena_filter_t *sfp = enp->en_filter.ef_siena_filter; siena_filter_tbl_t *sftp = &sfp->sf_tbl[tbl_id]; int index; - int state; + efsys_lock_state_t state; EFSYS_LOCK(enp->en_eslp, state); @@ -1195,7 +1195,7 @@ siena_filter_restore( siena_filter_spec_t *spec; efx_oword_t filter; int filter_idx; - int state; + efsys_lock_state_t state; uint32_t key; efx_rc_t rc; @@ -1253,7 +1253,7 @@ siena_filter_add( efx_oword_t filter; int filter_idx; unsigned int depth; - int state; + efsys_lock_state_t state; uint32_t key; @@ -1334,7 +1334,7 @@ siena_filter_delete( efx_oword_t filter; int filter_idx; unsigned int depth; - int state; + efsys_lock_state_t state; uint32_t key; EFSYS_ASSERT3P(spec, !=, NULL); Modified: head/sys/dev/sfxge/common/efx_mcdi.c ============================================================================== --- head/sys/dev/sfxge/common/efx_mcdi.c Fri Dec 30 12:10:15 2016 (r310818) +++ head/sys/dev/sfxge/common/efx_mcdi.c Fri Dec 30 12:19:40 2016 (r310819) @@ -183,7 +183,7 @@ efx_mcdi_new_epoch( __in efx_nic_t *enp) { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); - int state; + efsys_lock_state_t state; /* Start a new epoch (allow fresh MCDI requests to succeed) */ EFSYS_LOCK(enp->en_eslp, state); @@ -254,7 +254,7 @@ efx_mcdi_request_start( unsigned int seq; unsigned int xflags; boolean_t new_epoch; - int state; + efsys_lock_state_t state; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MCDI); @@ -502,7 +502,7 @@ efx_mcdi_request_poll( { efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); efx_mcdi_req_t *emrp; - int state; + efsys_lock_state_t state; efx_rc_t rc; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); @@ -570,7 +570,7 @@ efx_mcdi_request_abort( efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); efx_mcdi_req_t *emrp; boolean_t aborted; - int state; + efsys_lock_state_t state; EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MCDI); @@ -756,7 +756,7 @@ efx_mcdi_ev_cpl( efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; efx_mcdi_req_t *emrp; - int state; + efsys_lock_state_t state; EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_MCDI); EFSYS_ASSERT3U(enp->en_features, &, EFX_FEATURE_MCDI); @@ -867,7 +867,7 @@ efx_mcdi_ev_death( const efx_mcdi_transport_t *emtp = enp->en_mcdi.em_emtp; efx_mcdi_req_t *emrp = NULL; boolean_t ev_cpl; - int state; + efsys_lock_state_t state; /* * The MCDI request (if there is one) has been terminated, either