netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: build warning in Linus'  tree
@ 2010-05-25  1:46 Stephen Rothwell
  2010-05-25  4:58 ` David Miller
  0 siblings, 1 reply; 10+ messages in thread
From: Stephen Rothwell @ 2010-05-25  1:46 UTC (permalink / raw)
  To: David Miller, netdev; +Cc: linux-next, linux-kernel, Neil Jones

[-- Attachment #1: Type: text/plain, Size: 574 bytes --]

Hi Dave,

Today's linux-next build (x86_64 allmodconfig) produced this 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

Introduced by commit 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
("drivers/net/usb/asix.c: Fix unaligned accesses").  This commit casts
skb->data to u32.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: linux-next: build warning in Linus' tree
  2010-05-25  1:46 Stephen Rothwell
@ 2010-05-25  4:58 ` David Miller
  2010-05-25 23:19   ` David Miller
  0 siblings, 1 reply; 10+ messages in thread
From: David Miller @ 2010-05-25  4:58 UTC (permalink / raw)
  To: sfr; +Cc: netdev, linux-next, linux-kernel, NeilJay

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Tue, 25 May 2010 11:46:14 +1000

> Hi Dave,
> 
> Today's linux-next build (x86_64 allmodconfig) produced this 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
> 
> Introduced by commit 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
> ("drivers/net/usb/asix.c: Fix unaligned accesses").  This commit casts
> skb->data to u32.

Thanks I'll look into this.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: linux-next: build warning in Linus' tree
  2010-05-25  4:58 ` David Miller
@ 2010-05-25 23:19   ` David Miller
  2010-05-25 23:24     ` David Miller
  0 siblings, 1 reply; 10+ messages in thread
From: David Miller @ 2010-05-25 23:19 UTC (permalink / raw)
  To: sfr; +Cc: netdev, linux-next, linux-kernel, NeilJay

From: David Miller <davem@davemloft.net>
Date: Mon, 24 May 2010 21:58:22 -0700 (PDT)

> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Tue, 25 May 2010 11:46:14 +1000
> 
>> Hi Dave,
>> 
>> Today's linux-next build (x86_64 allmodconfig) produced this 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
>> 
>> Introduced by commit 3f78d1f210ff89af77f042ab7f4a8fee39feb1c9
>> ("drivers/net/usb/asix.c: Fix unaligned accesses").  This commit casts
>> skb->data to u32.
> 
> Thanks I'll look into this.

Here is how I fixed this:

--------------------
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 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
index 31b7331..ea75f47 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
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: linux-next: build warning in Linus' tree
  2010-05-25 23:19   ` David Miller
@ 2010-05-25 23:24     ` David Miller
  2010-05-26  2:04       ` Stephen Rothwell
  0 siblings, 1 reply; 10+ messages in thread
From: David Miller @ 2010-05-25 23:24 UTC (permalink / raw)
  To: sfr; +Cc: netdev, linux-next, linux-kernel, NeilJay

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

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* linux-next: build warning in Linus' tree
@ 2010-05-26  1:43 Stephen Rothwell
  2010-05-26  1:51 ` Herbert Xu
  0 siblings, 1 reply; 10+ messages in thread
From: Stephen Rothwell @ 2010-05-26  1:43 UTC (permalink / raw)
  To: David Miller, netdev; +Cc: linux-next, linux-kernel, Linus, Herbert Xu

[-- Attachment #1: Type: text/plain, Size: 586 bytes --]

Hi Dave,

Today's linux-next build (x86_64 allmodconfig) produced this warning:

net/core/sock.c: In function 'sock_update_classid':
include/net/cls_cgroup.h:42: warning: 'classid' may be used uninitialized in this function
include/net/cls_cgroup.h:42: note: 'classid' was declared here

In the case that rcu_dereference() returns a value < 0, classid will not
be assigned in task_cls_classid().  I don't know if this is possible - if
not, then why is the test there?
-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: linux-next: build warning in Linus' tree
  2010-05-26  1:43 linux-next: build warning in Linus' tree Stephen Rothwell
@ 2010-05-26  1:51 ` Herbert Xu
  2010-05-26  1:54   ` David Miller
  0 siblings, 1 reply; 10+ messages in thread
From: Herbert Xu @ 2010-05-26  1:51 UTC (permalink / raw)
  To: Stephen Rothwell; +Cc: David Miller, netdev, linux-next, linux-kernel, Linus

On Wed, May 26, 2010 at 11:43:06AM +1000, Stephen Rothwell wrote:
> Hi Dave,
> 
> Today's linux-next build (x86_64 allmodconfig) produced this warning:
> 
> net/core/sock.c: In function 'sock_update_classid':
> include/net/cls_cgroup.h:42: warning: 'classid' may be used uninitialized in this function
> include/net/cls_cgroup.h:42: note: 'classid' was declared here
> 
> In the case that rcu_dereference() returns a value < 0, classid will not
> be assigned in task_cls_classid().  I don't know if this is possible - if
> not, then why is the test there?

This is a genuine bug.  I don't know why my gcc didn't warn about
it.

cls_cgroup: Initialise classid when module is absent

When the cls_cgroup module is not loaded, task_cls_classid will
return an uninitialised classid instead of zero.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

diff --git a/include/net/cls_cgroup.h b/include/net/cls_cgroup.h
index 6cf4486..726cc35 100644
--- a/include/net/cls_cgroup.h
+++ b/include/net/cls_cgroup.h
@@ -39,7 +39,7 @@ extern int net_cls_subsys_id;
 static inline u32 task_cls_classid(struct task_struct *p)
 {
 	int id;
-	u32 classid;
+	u32 classid = 0;
 
 	if (in_interrupt())
 		return 0;

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: linux-next: build warning in Linus' tree
  2010-05-26  1:51 ` Herbert Xu
@ 2010-05-26  1:54   ` David Miller
  0 siblings, 0 replies; 10+ messages in thread
From: David Miller @ 2010-05-26  1:54 UTC (permalink / raw)
  To: herbert; +Cc: sfr, netdev, linux-next, linux-kernel, torvalds

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Wed, 26 May 2010 11:51:10 +1000

> cls_cgroup: Initialise classid when module is absent
> 
> When the cls_cgroup module is not loaded, task_cls_classid will
> return an uninitialised classid instead of zero.
> 
> Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

Applied, thanks Herbert.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: linux-next: build warning in Linus' tree
  2010-05-25 23:24     ` David Miller
@ 2010-05-26  2:04       ` Stephen Rothwell
  0 siblings, 0 replies; 10+ messages in thread
From: Stephen Rothwell @ 2010-05-26  2:04 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, linux-next, linux-kernel, NeilJay

[-- Attachment #1: Type: text/plain, Size: 530 bytes --]

Hi Dave,

On Tue, 25 May 2010 16:24:46 -0700 (PDT) David Miller <davem@davemloft.net> wrote:
>
> 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.

Thanks, looks good.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* linux-next: build warning in Linus' tree
@ 2013-12-17 22:52 Stephen Rothwell
  2013-12-18  2:54 ` Skidmore, Donald C
  0 siblings, 1 reply; 10+ messages in thread
From: Stephen Rothwell @ 2013-12-17 22:52 UTC (permalink / raw)
  To: David Miller, netdev
  Cc: linux-next, linux-kernel, John Fastabend, Neil Horman

[-- Attachment #1: Type: text/plain, Size: 574 bytes --]

Hi all,

While building Linus' tree, today's linux-next build (powerpc
ppc64_defconfig) produced this warning:

drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c: In function 'ixgbe_pci_sriov_disable':
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c:294:6: warning: unused variable 'current_flags' [-Wunused-variable]
  u32 current_flags = adapter->flags;
      ^

Introduced by commit 2a47fa45d4df ("ixgbe: enable l2 forwarding
acceleration for macvlans") which was merged before v3.13-rc1.

-- 
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au

[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

* RE: linux-next: build warning in Linus' tree
  2013-12-17 22:52 Stephen Rothwell
@ 2013-12-18  2:54 ` Skidmore, Donald C
  0 siblings, 0 replies; 10+ messages in thread
From: Skidmore, Donald C @ 2013-12-18  2:54 UTC (permalink / raw)
  To: Stephen Rothwell, David Miller, netdev@vger.kernel.org
  Cc: linux-next@vger.kernel.org, linux-kernel@vger.kernel.org,
	Fastabend, John R, Neil Horman



> -----Original Message-----
> From: netdev-owner@vger.kernel.org [mailto:netdev-
> owner@vger.kernel.org] On Behalf Of Stephen Rothwell
> Sent: Tuesday, December 17, 2013 2:52 PM
> To: David Miller; netdev@vger.kernel.org
> Cc: linux-next@vger.kernel.org; linux-kernel@vger.kernel.org; Fastabend,
> John R; Neil Horman
> Subject: linux-next: build warning in Linus' tree
> 
> Hi all,
> 
> While building Linus' tree, today's linux-next build (powerpc
> ppc64_defconfig) produced this warning:
> 
> drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c: In function
> 'ixgbe_pci_sriov_disable':
> drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c:294:6: warning: unused
> variable 'current_flags' [-Wunused-variable]
>   u32 current_flags = adapter->flags;
>       ^
> 
> Introduced by commit 2a47fa45d4df ("ixgbe: enable l2 forwarding
> acceleration for macvlans") which was merged before v3.13-rc1.
> 
> --
> Cheers,
> Stephen Rothwell                    sfr@canb.auug.org.au


Hey Stephen,

Thanks for letting us know about this.   As it turns out we already have a patch to fix this in our internal tree (Jeff K's) just waiting final validation.  It shouldn't be long before he submits it.

Thanks again,
-Don Skidmore <donald.c.skidmore@intel.com>

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-12-18  2:54 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-26  1:43 linux-next: build warning in Linus' tree Stephen Rothwell
2010-05-26  1:51 ` Herbert Xu
2010-05-26  1:54   ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2013-12-17 22:52 Stephen Rothwell
2013-12-18  2:54 ` Skidmore, Donald C
2010-05-25  1:46 Stephen Rothwell
2010-05-25  4:58 ` David Miller
2010-05-25 23:19   ` David Miller
2010-05-25 23:24     ` David Miller
2010-05-26  2:04       ` Stephen Rothwell

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).