* [PATCH net-next] myri10ge: fix most sparse warnings
@ 2012-12-04 20:17 Andrew Gallatin
2012-12-05 21:25 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Gallatin @ 2012-12-04 20:17 UTC (permalink / raw)
To: davem; +Cc: netdev, Andrew Gallatin
- convert remaining htonl/ntohl +__raw_read/__raw_writel to
swab32 + readl/writel
- add missing __iomem qualifier in myri10ge_open()
- fix dubious: x & !y warning by switching from logical to bitwise not
The swab32 conversion fixes a bug in myri10ge_led() where
big-endian machines would write the wrong pattern.
The only remaining warning (lock context imbalance) is due to
the use of __netif_tx_trylock(), and cannot easily be fixed.
Signed-off-by: Andrew Gallatin <gallatin@myri.com>
---
drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
index a40234e..f8408d6 100644
--- a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
+++ b/drivers/net/ethernet/myricom/myri10ge/myri10ge.c
@@ -1885,7 +1885,7 @@ static int myri10ge_led(struct myri10ge_priv *mgp, int on)
}
if (!on)
pattern = swab32(readl(mgp->sram + pattern_off + 4));
- writel(htonl(pattern), mgp->sram + pattern_off);
+ writel(swab32(pattern), mgp->sram + pattern_off);
return 0;
}
@@ -2294,7 +2294,7 @@ static int myri10ge_open(struct net_device *dev)
struct myri10ge_priv *mgp = netdev_priv(dev);
struct myri10ge_cmd cmd;
int i, status, big_pow2, slice;
- u8 *itable;
+ u8 __iomem *itable;
if (mgp->running != MYRI10GE_ETH_STOPPED)
return -EBUSY;
@@ -2757,7 +2757,7 @@ again:
flags_next |= next_is_first *
MXGEFW_FLAGS_FIRST;
rdma_count |= -(chop | next_is_first);
- rdma_count += chop & !next_is_first;
+ rdma_count += chop & ~next_is_first;
} else if (likely(cum_len_next >= 0)) { /* header ends */
int small;
@@ -3836,9 +3836,9 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
goto abort_with_mtrr;
}
hdr_offset =
- ntohl(__raw_readl(mgp->sram + MCP_HEADER_PTR_OFFSET)) & 0xffffc;
+ swab32(readl(mgp->sram + MCP_HEADER_PTR_OFFSET)) & 0xffffc;
ss_offset = hdr_offset + offsetof(struct mcp_gen_header, string_specs);
- mgp->sram_size = ntohl(__raw_readl(mgp->sram + ss_offset));
+ mgp->sram_size = swab32(readl(mgp->sram + ss_offset));
if (mgp->sram_size > mgp->board_span ||
mgp->sram_size <= MYRI10GE_FW_OFFSET) {
dev_err(&pdev->dev,
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net-next] myri10ge: fix most sparse warnings
2012-12-04 20:17 [PATCH net-next] myri10ge: fix most sparse warnings Andrew Gallatin
@ 2012-12-05 21:25 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2012-12-05 21:25 UTC (permalink / raw)
To: gallatin; +Cc: netdev
From: Andrew Gallatin <gallatin@myri.com>
Date: Tue, 4 Dec 2012 15:17:15 -0500
> - convert remaining htonl/ntohl +__raw_read/__raw_writel to
> swab32 + readl/writel
> - add missing __iomem qualifier in myri10ge_open()
> - fix dubious: x & !y warning by switching from logical to bitwise not
>
> The swab32 conversion fixes a bug in myri10ge_led() where
> big-endian machines would write the wrong pattern.
>
> The only remaining warning (lock context imbalance) is due to
> the use of __netif_tx_trylock(), and cannot easily be fixed.
>
> Signed-off-by: Andrew Gallatin <gallatin@myri.com>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-12-05 21:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-04 20:17 [PATCH net-next] myri10ge: fix most sparse warnings Andrew Gallatin
2012-12-05 21:25 ` 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).