Skip to contentSkip to conversation

clean up sparse cast warning in do_ip_getsockopt

PATCH In review Karoly Kemeny 3 participants 4 messages Jul 20, 2014 – Jul 21, 2014

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

PATCH 1/1 clean up sparse cast warning in do_ip_getsockopt

There is a sparse warning because of the implicit pointer cast in do_ip_getsockopt.

---
 net/ipv4/ip_sockglue.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/ip_sockglue.c +1 -1
index 64741b9..3e4af06 100644
@@ -1319,7 +1319,7 @@ static int do_ip_getsockopt(struct sock *sk, int level, int optname,
 		if (sk->sk_type != SOCK_STREAM)
 			return -ENOPROTOOPT;
 
-		msg.msg_control = optval;
+		msg.msg_control = (__force void*) optval;
 		msg.msg_controllen = len;
 		msg.msg_flags = flags;
 
Signature · 1 line
1.9.1
maintainer
#1 lore raw

From: Karoly Kemeny <[email protected]>
Date: Sun, 20 Jul 2014 13:30:17 +0200

Quoted 4 lines

There is a sparse warning because of the implicit pointer cast in do_ip_getsockopt.

Please format your subject line correctly, it should be of the form:

	[PATCH] ${SUBSYSTEM}: Description.

Your's is missing the subsystem prefix, which in this case should be "ipv4: "

net/ipv4/ip_sockglue.c static int do_ip_getsockopt(struct sock *sk, int level, int optname, · line 1322

Quoted 2 lines
net/ipv4/ip_sockglue.c +1 -1
-		msg.msg_control = optval;
+		msg.msg_control = (__force void*) optval;

Please put a space between "void" and "*" in the cast.

#2 lore raw

From: David Miller

Quoted 12 lines

From: Karoly Kemeny <[email protected]>
Date: Sun, 20 Jul 2014 13:30:17 +0200

Quoted 4 lines

There is a sparse warning because of the implicit pointer cast in do_ip_getsockopt.

Please format your subject line correctly, it should be of the form:

	[PATCH] ${SUBSYSTEM}: Description.
Quoted 7 lines

Your's is missing the subsystem prefix, which in this case should be "ipv4: "

net/ipv4/ip_sockglue.c static int do_ip_getsockopt(struct sock *sk, int level, int optname, · line 1322

Quoted 2 lines
net/ipv4/ip_sockglue.c +1 -1
-		msg.msg_control = optval;
+		msg.msg_control = (__force void*) optval;

Please put a space between "void" and "*" in the cast.

And remove the one after the ')' ?

David

maintainer
#3 lore raw

From: David Laight <[email protected]>
Date: Mon, 21 Jul 2014 08:54:02 +0000

Quoted 16 lines

From: David Miller

Quoted 15 lines

From: Karoly Kemeny <[email protected]>
Date: Sun, 20 Jul 2014 13:30:17 +0200

Quoted 4 lines

There is a sparse warning because of the implicit pointer cast in do_ip_getsockopt.

Please format your subject line correctly, it should be of the form:

	[PATCH] ${SUBSYSTEM}: Description.

Your's is missing the subsystem prefix, which in this case should be "ipv4: "

Quoted 6 lines
Quoted 4 lines

net/ipv4/ip_sockglue.c static int do_ip_getsockopt(struct sock *sk, int level, int optname, · line 1322

Quoted 2 lines
net/ipv4/ip_sockglue.c +1 -1
-		msg.msg_control = optval;
+		msg.msg_control = (__force void*) optval;

Please put a space between "void" and "*" in the cast.

And remove the one after the ')' ?

Not necessarily, I don't like when the closing parens and the variable "touch".