Skip to contentSkip to conversation

2.6.x build warning

NET Jeff Garzik 3 participants 3 messages May 26, 2005 – May 27, 2005

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

from current git tree:

net/ipv6/ip6_flowlabel.c: In function `ipv6_flowlabel_opt':
net/ipv6/ip6_flowlabel.c:540: warning: ignoring return value of `copy_to_user', declared with attribute warn_unused_result

maintainer
#1 lore raw

From: Jeff Garzik <[email protected]>
Date: Thu, 26 May 2005 15:09:15 -0400

Quoted 5 lines

from current git tree:

net/ipv6/ip6_flowlabel.c: In function `ipv6_flowlabel_opt':
net/ipv6/ip6_flowlabel.c:540: warning: ignoring return value of `copy_to_user', declared with attribute warn_unused_result

I've fixed this warning in my tree, thanks Jeff.

#2 lore raw
In reply to Jeff Garzik

In article <[email protected]> (at Thu, 26 May 2005 15:09:15 -0400), Jeff Garzik <[email protected]> says:

Quoted 5 lines

from current git tree:

net/ipv6/ip6_flowlabel.c: In function `ipv6_flowlabel_opt':
net/ipv6/ip6_flowlabel.c:540: warning: ignoring return value of `copy_to_user', declared with attribute warn_unused_result

As before, it is intentional.
Okay, let's just waste the result for avoiding the warning.

net/ipv6/ip6_flowlabel.c (mode:100644) +5 -4
Index: net/ipv6/ip6_flowlabel.c
===================================================================
@@ -535,10 +535,11 @@
 		if (err)
 			goto done;
 
-		/* Do not check for fault */
-		if (!freq.flr_label)
-			copy_to_user(&((struct in6_flowlabel_req __user *) optval)->flr_label,
-				     &fl->label, sizeof(fl->label));
+		if (!freq.flr_label) {
+			/* Do not check for fault */
+			int dummy = copy_to_user(&((struct in6_flowlabel_req __user *) optval)->flr_label,
+						 &fl->label, sizeof(fl->label));
+		}
 
 		sfl1->fl = fl;
 		sfl1->next = np->ipv6_fl_list;
Signature · 2 lines
YOSHIFUJI Hideaki @ USAGI Project  <[email protected]>
GPG-FP  : 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA