* [patch -next] net: macb: OR vs AND typos
@ 2015-05-12 18:15 Dan Carpenter
2015-05-12 18:28 ` Harini Katakam
2015-05-14 4:49 ` David Miller
0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2015-05-12 18:15 UTC (permalink / raw)
To: Nicolas Ferre, Harini Katakam; +Cc: netdev, kernel-janitors
The bitwise tests are always true here because it uses '|' where '&' is
intended.
Fixes: 98b5a0f4a228 ('net: macb: Add support for jumbo frames')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index e7c10b0..5fca309 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -1644,7 +1644,7 @@ static void macb_init_hw(struct macb *bp)
config |= MACB_BF(RBOF, NET_IP_ALIGN); /* Make eth data aligned */
config |= MACB_BIT(PAE); /* PAuse Enable */
config |= MACB_BIT(DRFCS); /* Discard Rx FCS */
- if (bp->caps | MACB_CAPS_JUMBO)
+ if (bp->caps & MACB_CAPS_JUMBO)
config |= MACB_BIT(JFRAME); /* Enable jumbo frames */
else
config |= MACB_BIT(BIG); /* Receive oversized frames */
@@ -1656,12 +1656,12 @@ static void macb_init_hw(struct macb *bp)
config |= MACB_BIT(NBC); /* No BroadCast */
config |= macb_dbw(bp);
macb_writel(bp, NCFGR, config);
- if ((bp->caps | MACB_CAPS_JUMBO) && bp->jumbo_max_len)
+ if ((bp->caps & MACB_CAPS_JUMBO) && bp->jumbo_max_len)
gem_writel(bp, JML, bp->jumbo_max_len);
bp->speed = SPEED_10;
bp->duplex = DUPLEX_HALF;
bp->rx_frm_len_mask = MACB_RX_FRMLEN_MASK;
- if (bp->caps | MACB_CAPS_JUMBO)
+ if (bp->caps & MACB_CAPS_JUMBO)
bp->rx_frm_len_mask = MACB_RX_JFRMLEN_MASK;
macb_configure_dma(bp);
@@ -1875,7 +1875,7 @@ static int macb_change_mtu(struct net_device *dev, int new_mtu)
return -EBUSY;
max_mtu = ETH_DATA_LEN;
- if (bp->caps | MACB_CAPS_JUMBO)
+ if (bp->caps & MACB_CAPS_JUMBO)
max_mtu = gem_readl(bp, JML) - ETH_HLEN - ETH_FCS_LEN;
if ((new_mtu > max_mtu) || (new_mtu < GEM_MTU_MIN_SIZE))
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [patch -next] net: macb: OR vs AND typos
2015-05-12 18:15 [patch -next] net: macb: OR vs AND typos Dan Carpenter
@ 2015-05-12 18:28 ` Harini Katakam
2015-05-14 4:49 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: Harini Katakam @ 2015-05-12 18:28 UTC (permalink / raw)
To: Dan Carpenter; +Cc: Nicolas Ferre, Harini Katakam, netdev, kernel-janitors
Hi,
On Tue, May 12, 2015 at 11:45 PM, Dan Carpenter
<dan.carpenter@oracle.com> wrote:
> The bitwise tests are always true here because it uses '|' where '&' is
> intended.
Yes. I'm sorry about that.
It slipped through my testing as well because I was using an SoC with
jumbo support.
Regards,
Harini
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [patch -next] net: macb: OR vs AND typos
2015-05-12 18:15 [patch -next] net: macb: OR vs AND typos Dan Carpenter
2015-05-12 18:28 ` Harini Katakam
@ 2015-05-14 4:49 ` David Miller
1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2015-05-14 4:49 UTC (permalink / raw)
To: dan.carpenter; +Cc: nicolas.ferre, harini.katakam, netdev, kernel-janitors
From: Dan Carpenter <dan.carpenter@oracle.com>
Date: Tue, 12 May 2015 21:15:24 +0300
> The bitwise tests are always true here because it uses '|' where '&' is
> intended.
>
> Fixes: 98b5a0f4a228 ('net: macb: Add support for jumbo frames')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-05-14 4:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-12 18:15 [patch -next] net: macb: OR vs AND typos Dan Carpenter
2015-05-12 18:28 ` Harini Katakam
2015-05-14 4:49 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).