From: Joachim Eastwood <manabian@gmail.com>
To: nicolas.ferre@atmel.com, davem@davemloft.net,
hskinnemoen@gmail.com, egtvedt@samfundet.no,
plagnioj@jcrosoft.com, bgat@billgatliff.com
Cc: netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
Joachim Eastwood <manabian@gmail.com>
Subject: [PATCH v3 1/4] net/macb: fix truncate warnings
Date: Mon, 22 Oct 2012 20:45:31 +0200 [thread overview]
Message-ID: <1350931534-8416-2-git-send-email-manabian@gmail.com> (raw)
In-Reply-To: <1350931534-8416-1-git-send-email-manabian@gmail.com>
When building macb on x86_64 the following warnings show up:
drivers/net/ethernet/cadence/macb.c: In function macb_interrupt:
drivers/net/ethernet/cadence/macb.c:556:4: warning: large integer implicitly truncated to unsigned type [-Woverflow]
drivers/net/ethernet/cadence/macb.c: In function macb_reset_hw:
drivers/net/ethernet/cadence/macb.c:792:2: warning: large integer implicitly truncated to unsigned type [-Woverflow]
drivers/net/ethernet/cadence/macb.c:793:2: warning: large integer implicitly truncated to unsigned type [-Woverflow]
drivers/net/ethernet/cadence/macb.c:796:2: warning: large integer implicitly truncated to unsigned type [-Woverflow]
Use -1 insted of ~0UL, as done in other places in the driver,
to silence these warnings.
Signed-off-by: Joachim Eastwood <manabian@gmail.com>
---
drivers/net/ethernet/cadence/macb.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/cadence/macb.c b/drivers/net/ethernet/cadence/macb.c
index 6c84a11..6a4f499 100644
--- a/drivers/net/ethernet/cadence/macb.c
+++ b/drivers/net/ethernet/cadence/macb.c
@@ -553,7 +553,7 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id)
while (status) {
/* close possible race with dev_close */
if (unlikely(!netif_running(dev))) {
- macb_writel(bp, IDR, ~0UL);
+ macb_writel(bp, IDR, -1);
break;
}
@@ -789,11 +789,11 @@ static void macb_reset_hw(struct macb *bp)
macb_writel(bp, NCR, MACB_BIT(CLRSTAT));
/* Clear all status flags */
- macb_writel(bp, TSR, ~0UL);
- macb_writel(bp, RSR, ~0UL);
+ macb_writel(bp, TSR, -1);
+ macb_writel(bp, RSR, -1);
/* Disable all interrupts */
- macb_writel(bp, IDR, ~0UL);
+ macb_writel(bp, IDR, -1);
macb_readl(bp, ISR);
}
--
1.7.12.4
next prev parent reply other threads:[~2012-10-22 18:47 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-22 18:45 [PATCH v3 0/4] make cadence ethernet drivers build on any architecture Joachim Eastwood
2012-10-22 18:45 ` Joachim Eastwood [this message]
2012-10-23 8:21 ` [PATCH v3 1/4] net/macb: fix truncate warnings David Laight
2012-10-23 8:48 ` David Miller
2012-10-23 12:00 ` Lothar Waßmann
2012-10-23 17:20 ` Joachim Eastwood
2012-10-22 18:45 ` [PATCH v3 2/4] net/cadence: get rid of HAVE_NET_MACB Joachim Eastwood
2012-10-22 18:45 ` [PATCH v3 3/4] net/at91_ether: select MACB in Kconfig Joachim Eastwood
2012-10-22 18:45 ` [PATCH v3 4/4] net/at91_ether: add pdata flag for reverse Eth addr Joachim Eastwood
2012-10-23 6:40 ` [PATCH v3 0/4] make cadence ethernet drivers build on any architecture David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1350931534-8416-2-git-send-email-manabian@gmail.com \
--to=manabian@gmail.com \
--cc=bgat@billgatliff.com \
--cc=davem@davemloft.net \
--cc=egtvedt@samfundet.no \
--cc=hskinnemoen@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=netdev@vger.kernel.org \
--cc=nicolas.ferre@atmel.com \
--cc=plagnioj@jcrosoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).