diff options
author | Edward Cree <ecree@solarflare.com> | 2016-12-02 15:51:33 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-12-03 16:11:00 -0500 |
commit | e01b16a7e217a23eb97e08d0a591735d5aee5efc (patch) | |
tree | 9b060200cd2c308fc968c0f03097c7ff22d496d8 /drivers/net/ethernet/sfc/net_driver.h | |
parent | 816fba3529040d253cef0047bdef850014e746b9 (diff) | |
download | linux-e01b16a7e217a23eb97e08d0a591735d5aee5efc.tar.bz2 |
sfc: remove EFX_BUG_ON_PARANOID, use EFX_WARN_ON_[ONCE_]PARANOID instead
Logically, EFX_BUG_ON_PARANOID can never be correct. For, BUG_ON should
only be used if it is not possible to continue without potential harm;
and since the non-DEBUG driver will continue regardless (as the BUG_ON is
compiled out), clearly the BUG_ON cannot be needed in the DEBUG driver.
So, replace every EFX_BUG_ON_PARANOID with either an EFX_WARN_ON_PARANOID
or the newly defined EFX_WARN_ON_ONCE_PARANOID.
Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sfc/net_driver.h')
-rw-r--r-- | drivers/net/ethernet/sfc/net_driver.h | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/net/ethernet/sfc/net_driver.h b/drivers/net/ethernet/sfc/net_driver.h index 0bbd7e252a03..8692e829b40f 100644 --- a/drivers/net/ethernet/sfc/net_driver.h +++ b/drivers/net/ethernet/sfc/net_driver.h @@ -44,10 +44,10 @@ #define EFX_DRIVER_VERSION "4.1" #ifdef DEBUG -#define EFX_BUG_ON_PARANOID(x) BUG_ON(x) +#define EFX_WARN_ON_ONCE_PARANOID(x) WARN_ON_ONCE(x) #define EFX_WARN_ON_PARANOID(x) WARN_ON(x) #else -#define EFX_BUG_ON_PARANOID(x) do {} while (0) +#define EFX_WARN_ON_ONCE_PARANOID(x) do {} while (0) #define EFX_WARN_ON_PARANOID(x) do {} while (0) #endif @@ -1409,7 +1409,7 @@ struct efx_nic_type { static inline struct efx_channel * efx_get_channel(struct efx_nic *efx, unsigned index) { - EFX_BUG_ON_PARANOID(index >= efx->n_channels); + EFX_WARN_ON_ONCE_PARANOID(index >= efx->n_channels); return efx->channel[index]; } @@ -1430,8 +1430,8 @@ efx_get_channel(struct efx_nic *efx, unsigned index) static inline struct efx_tx_queue * efx_get_tx_queue(struct efx_nic *efx, unsigned index, unsigned type) { - EFX_BUG_ON_PARANOID(index >= efx->n_tx_channels || - type >= EFX_TXQ_TYPES); + EFX_WARN_ON_ONCE_PARANOID(index >= efx->n_tx_channels || + type >= EFX_TXQ_TYPES); return &efx->channel[efx->tx_channel_offset + index]->tx_queue[type]; } @@ -1444,8 +1444,8 @@ static inline bool efx_channel_has_tx_queues(struct efx_channel *channel) static inline struct efx_tx_queue * efx_channel_get_tx_queue(struct efx_channel *channel, unsigned type) { - EFX_BUG_ON_PARANOID(!efx_channel_has_tx_queues(channel) || - type >= EFX_TXQ_TYPES); + EFX_WARN_ON_ONCE_PARANOID(!efx_channel_has_tx_queues(channel) || + type >= EFX_TXQ_TYPES); return &channel->tx_queue[type]; } @@ -1482,7 +1482,7 @@ static inline bool efx_channel_has_rx_queue(struct efx_channel *channel) static inline struct efx_rx_queue * efx_channel_get_rx_queue(struct efx_channel *channel) { - EFX_BUG_ON_PARANOID(!efx_channel_has_rx_queue(channel)); + EFX_WARN_ON_ONCE_PARANOID(!efx_channel_has_rx_queue(channel)); return &channel->rx_queue; } @@ -1578,9 +1578,9 @@ efx_tx_queue_get_insert_buffer(const struct efx_tx_queue *tx_queue) struct efx_tx_buffer *buffer = __efx_tx_queue_get_insert_buffer(tx_queue); - EFX_BUG_ON_PARANOID(buffer->len); - EFX_BUG_ON_PARANOID(buffer->flags); - EFX_BUG_ON_PARANOID(buffer->unmap_len); + EFX_WARN_ON_ONCE_PARANOID(buffer->len); + EFX_WARN_ON_ONCE_PARANOID(buffer->flags); + EFX_WARN_ON_ONCE_PARANOID(buffer->unmap_len); return buffer; } |