aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sfc/rx.c
diff options
context:
space:
mode:
authorBen Hutchings <bhutchings@solarflare.com>2008-09-01 07:46:50 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-09-03 09:53:45 -0400
commitdc8cfa55da8c21e0b3290c29677a9d05c0a3e595 (patch)
treea4c8bedad12a15d1e7c9fcfc99f873280ca644b4 /drivers/net/sfc/rx.c
parentcc12dac2e512c2b6185ed91899e09e9910630315 (diff)
sfc: Use explicit bool for boolean variables, parameters and return values
Replace (cond ? 1 : 0) with cond or !!cond as appropriate, and (cond ? 0 : 1) with !cond. Remove some redundant boolean temporaries. Rename one field that looks like a flag but isn't. Signed-off-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/sfc/rx.c')
-rw-r--r--drivers/net/sfc/rx.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/net/sfc/rx.c b/drivers/net/sfc/rx.c
index 0d27dd39bc09..17aa81e66a89 100644
--- a/drivers/net/sfc/rx.c
+++ b/drivers/net/sfc/rx.c
@@ -508,8 +508,8 @@ void efx_rx_work(struct work_struct *data)
508 508
509static inline void efx_rx_packet__check_len(struct efx_rx_queue *rx_queue, 509static inline void efx_rx_packet__check_len(struct efx_rx_queue *rx_queue,
510 struct efx_rx_buffer *rx_buf, 510 struct efx_rx_buffer *rx_buf,
511 int len, int *discard, 511 int len, bool *discard,
512 int *leak_packet) 512 bool *leak_packet)
513{ 513{
514 struct efx_nic *efx = rx_queue->efx; 514 struct efx_nic *efx = rx_queue->efx;
515 unsigned max_len = rx_buf->len - efx->type->rx_buffer_padding; 515 unsigned max_len = rx_buf->len - efx->type->rx_buffer_padding;
@@ -520,7 +520,7 @@ static inline void efx_rx_packet__check_len(struct efx_rx_queue *rx_queue,
520 /* The packet must be discarded, but this is only a fatal error 520 /* The packet must be discarded, but this is only a fatal error
521 * if the caller indicated it was 521 * if the caller indicated it was
522 */ 522 */
523 *discard = 1; 523 *discard = true;
524 524
525 if ((len > rx_buf->len) && EFX_WORKAROUND_8071(efx)) { 525 if ((len > rx_buf->len) && EFX_WORKAROUND_8071(efx)) {
526 EFX_ERR_RL(efx, " RX queue %d seriously overlength " 526 EFX_ERR_RL(efx, " RX queue %d seriously overlength "
@@ -621,11 +621,11 @@ static inline struct sk_buff *efx_rx_mk_skb(struct efx_rx_buffer *rx_buf,
621} 621}
622 622
623void efx_rx_packet(struct efx_rx_queue *rx_queue, unsigned int index, 623void efx_rx_packet(struct efx_rx_queue *rx_queue, unsigned int index,
624 unsigned int len, int checksummed, int discard) 624 unsigned int len, bool checksummed, bool discard)
625{ 625{
626 struct efx_nic *efx = rx_queue->efx; 626 struct efx_nic *efx = rx_queue->efx;
627 struct efx_rx_buffer *rx_buf; 627 struct efx_rx_buffer *rx_buf;
628 int leak_packet = 0; 628 bool leak_packet = false;
629 629
630 rx_buf = efx_rx_buffer(rx_queue, index); 630 rx_buf = efx_rx_buffer(rx_queue, index);
631 EFX_BUG_ON_PARANOID(!rx_buf->data); 631 EFX_BUG_ON_PARANOID(!rx_buf->data);
@@ -683,11 +683,11 @@ void efx_rx_packet(struct efx_rx_queue *rx_queue, unsigned int index,
683 683
684/* Handle a received packet. Second half: Touches packet payload. */ 684/* Handle a received packet. Second half: Touches packet payload. */
685void __efx_rx_packet(struct efx_channel *channel, 685void __efx_rx_packet(struct efx_channel *channel,
686 struct efx_rx_buffer *rx_buf, int checksummed) 686 struct efx_rx_buffer *rx_buf, bool checksummed)
687{ 687{
688 struct efx_nic *efx = channel->efx; 688 struct efx_nic *efx = channel->efx;
689 struct sk_buff *skb; 689 struct sk_buff *skb;
690 int lro = efx->net_dev->features & NETIF_F_LRO; 690 bool lro = !!(efx->net_dev->features & NETIF_F_LRO);
691 691
692 /* If we're in loopback test, then pass the packet directly to the 692 /* If we're in loopback test, then pass the packet directly to the
693 * loopback layer, and free the rx_buf here 693 * loopback layer, and free the rx_buf here