netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] isdn: Use kernel_{send,recv}msg instead of open coding
@ 2009-05-21 15:41 Arnaldo Carvalho de Melo
  2009-05-21 22:14 ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2009-05-21 15:41 UTC (permalink / raw)
  To: David Miller, Karsten Keil
  Cc: Paul Moore, Linux Networking Development Mailing List,
	Chris Van Hoof, Clark Williams, linux-security-module

Reducing the number of direct users of sock_{recv,send}msg.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

diff --git a/drivers/isdn/mISDN/l1oip_core.c b/drivers/isdn/mISDN/l1oip_core.c
index abe5749..8caf40e 100644
--- a/drivers/isdn/mISDN/l1oip_core.c
+++ b/drivers/isdn/mISDN/l1oip_core.c
@@ -279,7 +279,6 @@ l1oip_socket_send(struct l1oip *hc, u8 localcodec, u8 channel, u32 chanmask,
 	int multi = 0;
 	u8 frame[len+32];
 	struct socket *socket = NULL;
-	mm_segment_t oldfs;
 
 	if (debug & DEBUG_L1OIP_MSG)
 		printk(KERN_DEBUG "%s: sending data to socket (len = %d)\n",
@@ -352,10 +351,7 @@ l1oip_socket_send(struct l1oip *hc, u8 localcodec, u8 channel, u32 chanmask,
 			"= %d)\n", __func__, len);
 	hc->sendiov.iov_base = frame;
 	hc->sendiov.iov_len  = len;
-	oldfs = get_fs();
-	set_fs(KERNEL_DS);
-	len = sock_sendmsg(socket, &hc->sendmsg, len);
-	set_fs(oldfs);
+	len = kernel_sendmsg(socket, &hc->sendmsg, len);
 	/* give socket back */
 	hc->socket = socket; /* no locking required */
 
@@ -661,7 +657,6 @@ l1oip_socket_thread(void *data)
 	int ret = 0;
 	struct msghdr msg;
 	struct iovec iov;
-	mm_segment_t oldfs;
 	struct sockaddr_in sin_rx;
 	unsigned char recvbuf[1500];
 	int recvlen;
@@ -731,10 +726,7 @@ l1oip_socket_thread(void *data)
 	while (!signal_pending(current)) {
 		iov.iov_base = recvbuf;
 		iov.iov_len = sizeof(recvbuf);
-		oldfs = get_fs();
-		set_fs(KERNEL_DS);
-		recvlen = sock_recvmsg(socket, &msg, sizeof(recvbuf), 0);
-		set_fs(oldfs);
+		recvlen = kernel_recvmsg(socket, &msg, sizeof(recvbuf), 0);
 		if (recvlen > 0) {
 			l1oip_socket_parse(hc, &sin_rx, recvbuf, recvlen);
 		} else {

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

* Re: [PATCH 1/1] isdn: Use kernel_{send,recv}msg instead of open coding
  2009-05-21 15:41 [PATCH 1/1] isdn: Use kernel_{send,recv}msg instead of open coding Arnaldo Carvalho de Melo
@ 2009-05-21 22:14 ` David Miller
  2009-05-21 23:49   ` David Miller
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2009-05-21 22:14 UTC (permalink / raw)
  To: acme; +Cc: isdn, paul.moore, netdev, vanhoof, williams,
	linux-security-module

From: Arnaldo Carvalho de Melo <acme@redhat.com>
Date: Thu, 21 May 2009 12:41:26 -0300

> Reducing the number of direct users of sock_{recv,send}msg.
> 
> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

Nice work, applied, thanks!

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

* Re: [PATCH 1/1] isdn: Use kernel_{send,recv}msg instead of open coding
  2009-05-21 22:14 ` David Miller
@ 2009-05-21 23:49   ` David Miller
  2009-05-22  1:34     ` Arnaldo Carvalho de Melo
  0 siblings, 1 reply; 4+ messages in thread
From: David Miller @ 2009-05-21 23:49 UTC (permalink / raw)
  To: acme; +Cc: isdn, paul.moore, netdev, vanhoof, williams,
	linux-security-module

From: David Miller <davem@davemloft.net>
Date: Thu, 21 May 2009 15:14:43 -0700 (PDT)

> From: Arnaldo Carvalho de Melo <acme@redhat.com>
> Date: Thu, 21 May 2009 12:41:26 -0300
> 
>> Reducing the number of direct users of sock_{recv,send}msg.
>> 
>> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> 
> Nice work, applied, thanks!

Nevermind, I'm reverting, this doesn't even build:

drivers/isdn/mISDN/l1oip_core.c: In function 'l1oip_socket_send':
drivers/isdn/mISDN/l1oip_core.c:354: warning: passing argument 3 of 'kernel_sendmsg' makes pointer from integer without a cast
drivers/isdn/mISDN/l1oip_core.c:354: error: too few arguments to function 'kernel_sendmsg'
drivers/isdn/mISDN/l1oip_core.c: In function 'l1oip_socket_thread':
drivers/isdn/mISDN/l1oip_core.c:729: warning: passing argument 3 of 'kernel_recvmsg' makes pointer from integer without a cast
drivers/isdn/mISDN/l1oip_core.c:729: error: too few arguments to function 'kernel_recvmsg'


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

* Re: [PATCH 1/1] isdn: Use kernel_{send,recv}msg instead of open coding
  2009-05-21 23:49   ` David Miller
@ 2009-05-22  1:34     ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2009-05-22  1:34 UTC (permalink / raw)
  To: David Miller
  Cc: isdn, paul.moore, netdev, vanhoof, williams,
	linux-security-module

Em Thu, May 21, 2009 at 04:49:29PM -0700, David Miller escreveu:
> From: David Miller <davem@davemloft.net>
> Date: Thu, 21 May 2009 15:14:43 -0700 (PDT)
> 
> > From: Arnaldo Carvalho de Melo <acme@redhat.com>
> > Date: Thu, 21 May 2009 12:41:26 -0300
> > 
> >> Reducing the number of direct users of sock_{recv,send}msg.
> >> 
> >> Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
> > 
> > Nice work, applied, thanks!
> 
> Nevermind, I'm reverting, this doesn't even build:
> 
> drivers/isdn/mISDN/l1oip_core.c: In function 'l1oip_socket_send':
> drivers/isdn/mISDN/l1oip_core.c:354: warning: passing argument 3 of 'kernel_sendmsg' makes pointer from integer without a cast
> drivers/isdn/mISDN/l1oip_core.c:354: error: too few arguments to function 'kernel_sendmsg'
> drivers/isdn/mISDN/l1oip_core.c: In function 'l1oip_socket_thread':
> drivers/isdn/mISDN/l1oip_core.c:729: warning: passing argument 3 of 'kernel_recvmsg' makes pointer from integer without a cast
> drivers/isdn/mISDN/l1oip_core.c:729: error: too few arguments to function 'kernel_recvmsg'

I should have said "not even compile tested".

Will understand stricter questioning in the future.

Damn, these are not present in at least the distro kernel build I
tried...

- Arnaldo

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

end of thread, other threads:[~2009-05-22  1:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-21 15:41 [PATCH 1/1] isdn: Use kernel_{send,recv}msg instead of open coding Arnaldo Carvalho de Melo
2009-05-21 22:14 ` David Miller
2009-05-21 23:49   ` David Miller
2009-05-22  1:34     ` Arnaldo Carvalho de Melo

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