netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] bonding: fix sparse warnings
@ 2006-05-10 23:14 Stephen Hemminger
  2006-05-10 23:22 ` Al Viro
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2006-05-10 23:14 UTC (permalink / raw)
  To: ctindel, Jay Vosburgh; +Cc: bonding-devel, netdev

Fix warning from sparse in bonding code about "incorrect type in assignment"

Signed-off-by: Stephen Hemminger <shemminger@osdl.org>


--- orig/drivers/net/bonding/bond_main.c	2006-05-04 16:22:10.000000000 -0700
+++ new/drivers/net/bonding/bond_main.c	2006-05-10 16:04:38.000000000 -0700
@@ -629,7 +629,7 @@
 	ioctl = slave_dev->do_ioctl;
 	strncpy(ifr.ifr_name, slave_dev->name, IFNAMSIZ);
 	etool.cmd = ETHTOOL_GSET;
-	ifr.ifr_data = (char*)&etool;
+	ifr.ifr_data = (void __user *) &etool;
 	if (!ioctl || (IOCTL(slave_dev, &ifr, SIOCETHTOOL) < 0)) {
 		return -1;
 	}
@@ -726,7 +726,7 @@
 	if (ioctl) {
 		strncpy(ifr.ifr_name, slave_dev->name, IFNAMSIZ);
 		etool.cmd = ETHTOOL_GLINK;
-		ifr.ifr_data = (char*)&etool;
+		ifr.ifr_data = (void __user *) &etool;
 		if (IOCTL(slave_dev, &ifr, SIOCETHTOOL) == 0) {
 			if (etool.data == 1) {
 				return BMSR_LSTATUS;

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

* Re: [PATCH] bonding: fix sparse warnings
  2006-05-10 23:14 [PATCH] bonding: fix sparse warnings Stephen Hemminger
@ 2006-05-10 23:22 ` Al Viro
  2006-05-11  3:45   ` Stephen Hemminger
  0 siblings, 1 reply; 3+ messages in thread
From: Al Viro @ 2006-05-10 23:22 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: ctindel, Jay Vosburgh, bonding-devel, netdev

On Wed, May 10, 2006 at 04:14:05PM -0700, Stephen Hemminger wrote:
> Fix warning from sparse in bonding code about "incorrect type in assignment"

*snerk*

Only if you are building without -Wcast-to-as.  It _is_ incorrect type in
assignment.  And the real fix is to expand the call, killing set_fs()
in there.

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

* Re: [PATCH] bonding: fix sparse warnings
  2006-05-10 23:22 ` Al Viro
@ 2006-05-11  3:45   ` Stephen Hemminger
  0 siblings, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2006-05-11  3:45 UTC (permalink / raw)
  To: Al Viro; +Cc: ctindel, Jay Vosburgh, bonding-devel, netdev

On Thu, 11 May 2006 00:22:03 +0100
Al Viro <viro@ftp.linux.org.uk> wrote:

> On Wed, May 10, 2006 at 04:14:05PM -0700, Stephen Hemminger wrote:
> > Fix warning from sparse in bonding code about "incorrect type in assignment"
> 
> *snerk*
> 
> Only if you are building without -Wcast-to-as.  It _is_ incorrect type in
> assignment.  And the real fix is to expand the call, killing set_fs()
> in there.

More like this (in br_if.c)?

	struct ethtool_cmd ecmd = { ETHTOOL_GSET };
	struct ifreq ifr;
	mm_segment_t old_fs;
	int err;

	strncpy(ifr.ifr_name, dev->name, IFNAMSIZ);
	ifr.ifr_data = (void __user *) &ecmd;

	old_fs = get_fs();
	set_fs(KERNEL_DS);
	err = dev_ethtool(&ifr);
	set_fs(old_fs);
	
	if (!err)
		...

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

end of thread, other threads:[~2006-05-11  3:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-10 23:14 [PATCH] bonding: fix sparse warnings Stephen Hemminger
2006-05-10 23:22 ` Al Viro
2006-05-11  3:45   ` Stephen Hemminger

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