From: Andy Moreton Date: Thu, 16 Nov 2017 08:04:01 +0000 (+0000) Subject: net/sfc/base: remove duplicate NVRAM asserts X-Git-Tag: spdx-start~672 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e5fff4ee25ce572a10c04b06d09d94b9d8d4b21c;p=dpdk.git net/sfc/base: remove duplicate NVRAM asserts The checking performed in the ->envo_type_to_partn internal method make these assertions unnecessary. Signed-off-by: Andy Moreton Signed-off-by: Andrew Rybchenko --- diff --git a/drivers/net/sfc/base/ef10_nvram.c b/drivers/net/sfc/base/ef10_nvram.c index 68f14d54d2..5d7a66f09d 100644 --- a/drivers/net/sfc/base/ef10_nvram.c +++ b/drivers/net/sfc/base/ef10_nvram.c @@ -2207,6 +2207,7 @@ ef10_nvram_type_to_partn( size_t parttbl_rows = 0; unsigned int i; + EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); EFSYS_ASSERT(partnp != NULL); diff --git a/drivers/net/sfc/base/efx_nvram.c b/drivers/net/sfc/base/efx_nvram.c index affe496732..6bd7fc2f97 100644 --- a/drivers/net/sfc/base/efx_nvram.c +++ b/drivers/net/sfc/base/efx_nvram.c @@ -162,8 +162,6 @@ efx_nvram_size( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; @@ -196,8 +194,6 @@ efx_nvram_get_version( EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; @@ -228,9 +224,6 @@ efx_nvram_rw_start( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; @@ -266,9 +259,6 @@ efx_nvram_read_chunk( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; @@ -307,9 +297,6 @@ efx_nvram_read_backup( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; @@ -343,9 +330,6 @@ efx_nvram_erase( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; @@ -384,9 +368,6 @@ efx_nvram_write_chunk( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; @@ -419,9 +400,6 @@ efx_nvram_rw_finish( EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; @@ -465,8 +443,6 @@ efx_nvram_set_version( EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; @@ -506,9 +482,6 @@ efx_nvram_validate( EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_PROBE); EFSYS_ASSERT3U(enp->en_mod_flags, &, EFX_MOD_NVRAM); - EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); - - if ((rc = envop->envo_type_to_partn(enp, type, &partn)) != 0) goto fail1; diff --git a/drivers/net/sfc/base/siena_nvram.c b/drivers/net/sfc/base/siena_nvram.c index bb78ae0ff4..33628c3eff 100644 --- a/drivers/net/sfc/base/siena_nvram.c +++ b/drivers/net/sfc/base/siena_nvram.c @@ -240,6 +240,7 @@ siena_nvram_type_to_partn( efx_mcdi_iface_t *emip = &(enp->en_mcdi.em_emip); unsigned int i; + EFSYS_ASSERT3U(type, !=, EFX_NVRAM_INVALID); EFSYS_ASSERT3U(type, <, EFX_NVRAM_NTYPES); EFSYS_ASSERT(partnp != NULL);