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
This commit is contained in:
arybchik 2016-12-30 12:19:40 +00:00
parent 39d8387c67
commit 8cba11d283
4 changed files with 16 additions and 14 deletions

View File

@ -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 ||

View File

@ -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) \

View File

@ -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);

View File

@ -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