From: David Miller <davem@davemloft.net>
To: sfr@canb.auug.org.au
Cc: netdev@vger.kernel.org, linux-next@vger.kernel.org,
linux-kernel@vger.kernel.org, NeilJay@gmail.com
Subject: Re: linux-next: build warning in Linus' tree
Date: Tue, 25 May 2010 16:24:46 -0700 (PDT) [thread overview]
Message-ID: <20100525.162446.183058933.davem@davemloft.net> (raw)
In-Reply-To: <20100525.161929.112591425.davem@davemloft.net>
From: David Miller <davem@davemloft.net>
Date: Tue, 25 May 2010 16:19:29 -0700 (PDT)
> Here is how I fixed this:
>
> --------------------
> drivers/net/usb/asix.c: Fix pointer cast.
Sorry, that only took care of one of the two warnings :-)
This patch is better.
--------------------
drivers/net/usb/asix.c: Fix pointer cast.
Stephen Rothwell reports the following new warning:
drivers/net/usb/asix.c: In function 'asix_rx_fixup':
drivers/net/usb/asix.c:325: warning: cast from pointer to integer of different size
drivers/net/usb/asix.c:354: warning: cast from pointer to integer of different size
The code just cares about the low alignment bits, so use
an "unsigned long" cast instead of one to "u32".
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/net/usb/asix.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
index 31b7331..1f802e9 100644
--- a/drivers/net/usb/asix.c
+++ b/drivers/net/usb/asix.c
@@ -322,7 +322,7 @@ static int asix_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
size = (u16) (header & 0x0000ffff);
if ((skb->len) - ((size + 1) & 0xfffe) == 0) {
- u8 alignment = (u32)skb->data & 0x3;
+ u8 alignment = (unsigned long)skb->data & 0x3;
if (alignment != 0x2) {
/*
* not 16bit aligned so use the room provided by
@@ -351,7 +351,7 @@ static int asix_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
}
ax_skb = skb_clone(skb, GFP_ATOMIC);
if (ax_skb) {
- u8 alignment = (u32)packet & 0x3;
+ u8 alignment = (unsigned long)packet & 0x3;
ax_skb->len = size;
if (alignment != 0x2) {
--
1.7.0.4
next prev parent reply other threads:[~2010-05-25 23:24 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-25 1:46 linux-next: build warning in Linus' tree Stephen Rothwell
2010-05-25 4:58 ` David Miller
2010-05-25 23:19 ` David Miller
2010-05-25 23:24 ` David Miller [this message]
2010-05-26 2:04 ` Stephen Rothwell
-- strict thread matches above, loose matches on Subject: below --
2010-05-26 1:43 Stephen Rothwell
2010-05-26 1:51 ` Herbert Xu
2010-05-26 1:54 ` David Miller
2013-12-17 22:52 Stephen Rothwell
2013-12-18 2:54 ` Skidmore, Donald C
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=20100525.162446.183058933.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=NeilJay@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
/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).