Date: Fri, 30 Dec 2016 12:19:40 +0000 (UTC) From: Andrew Rybchenko <arybchik@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r310819 - head/sys/dev/sfxge/common Message-ID: <201612301219.uBUCJeHV072773@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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 <amoreton at solarflare.com> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201612301219.uBUCJeHV072773>