summaryrefslogtreecommitdiffstats
path: root/sys/dev/sfxge/common/efx_intr.c
diff options
context:
space:
mode:
authorarybchik <arybchik@FreeBSD.org>2016-01-14 14:16:26 +0000
committerarybchik <arybchik@FreeBSD.org>2016-01-14 14:16:26 +0000
commit32c1c2e354459d1baea313b01632cca7a5e02f04 (patch)
tree0c3a009d301a204ebd7c1d45b889801c99123da3 /sys/dev/sfxge/common/efx_intr.c
parent7d62d26c36c13762336f12576615907a2d4679ee (diff)
downloadFreeBSD-src-32c1c2e354459d1baea313b01632cca7a5e02f04.zip
FreeBSD-src-32c1c2e354459d1baea313b01632cca7a5e02f04.tar.gz
MFC r291436
sfxge: add prefast annotation to common code return types Using a typedef for common code return types (rather than "int") allows the Prefast static analyser to understand when a function has been successful (and thus when its postconditions must hold). This greatly reduces then number of false positives reported by prefast for error paths in common code functions. Submitted by: Andy Moreton <amoreton at solarflare.com> Sponsored by: Solarflare Communications, Inc.
Diffstat (limited to 'sys/dev/sfxge/common/efx_intr.c')
-rw-r--r--sys/dev/sfxge/common/efx_intr.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/sys/dev/sfxge/common/efx_intr.c b/sys/dev/sfxge/common/efx_intr.c
index d40f57f..48ec3cb 100644
--- a/sys/dev/sfxge/common/efx_intr.c
+++ b/sys/dev/sfxge/common/efx_intr.c
@@ -40,7 +40,7 @@ __FBSDID("$FreeBSD$");
#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_intr_init(
__in efx_nic_t *enp,
__in efx_intr_type_t type,
@@ -58,7 +58,7 @@ static void
falconsiena_intr_disable_unlocked(
__in efx_nic_t *enp);
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_intr_trigger(
__in efx_nic_t *enp,
__in unsigned int level);
@@ -113,7 +113,7 @@ static efx_intr_ops_t __efx_intr_hunt_ops = {
#endif /* EFSYS_OPT_HUNTINGTON */
- __checkReturn int
+ __checkReturn efx_rc_t
efx_intr_init(
__in efx_nic_t *enp,
__in efx_intr_type_t type,
@@ -121,7 +121,7 @@ efx_intr_init(
{
efx_intr_t *eip = &(enp->en_intr);
efx_intr_ops_t *eiop;
- int rc;
+ efx_rc_t rc;
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NIC);
@@ -174,7 +174,7 @@ fail3:
fail2:
EFSYS_PROBE(fail2);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
@@ -235,7 +235,7 @@ efx_intr_disable_unlocked(
}
- __checkReturn int
+ __checkReturn efx_rc_t
efx_intr_trigger(
__in efx_nic_t *enp,
__in unsigned int level)
@@ -336,7 +336,7 @@ efx_intr_fatal(
#if EFSYS_OPT_FALCON || EFSYS_OPT_SIENA
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_intr_init(
__in efx_nic_t *enp,
__in efx_intr_type_t type,
@@ -417,7 +417,7 @@ falconsiena_intr_disable_unlocked(
&oword, B_FALSE);
}
-static __checkReturn int
+static __checkReturn efx_rc_t
falconsiena_intr_trigger(
__in efx_nic_t *enp,
__in unsigned int level)
@@ -426,7 +426,7 @@ falconsiena_intr_trigger(
efx_oword_t oword;
unsigned int count;
uint32_t sel;
- int rc;
+ efx_rc_t rc;
/* bug16757: No event queues can be initialized */
EFSYS_ASSERT(!(enp->en_mod_flags & EFX_MOD_EV));
@@ -480,7 +480,7 @@ falconsiena_intr_trigger(
return (0);
fail1:
- EFSYS_PROBE1(fail1, int, rc);
+ EFSYS_PROBE1(fail1, efx_rc_t, rc);
return (rc);
}
OpenPOWER on IntegriCloud