lkml.org 
[lkml]   [2000]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] cleanup on selection.c: take 2
Hi,

Please consider applying. I've included making patches to eliminate
the _ret macroses for copy_to_user et al in my TODO list.

- Arnaldo

--- linux-2.4.0-test7/drivers/char/selection.c Tue Aug 31 15:30:48 1999
+++ linux-2.4.0-test7.acme/drivers/char/selection.c Fri Aug 25 16:37:35 2000
@@ -96,11 +96,7 @@
/* set inwordLut contents. Invoked by ioctl(). */
int sel_loadlut(const unsigned long arg)
{
- int err = -EFAULT;
-
- if (!copy_from_user(inwordLut, (u32 *)(arg+4), 32))
- err = 0;
- return err;
+ return copy_from_user(inwordLut, (u32 *)(arg+4), 32) ? -EFAULT : 0;
}

/* does screen address p correspond to character at LH/RH edge of screen? */
@@ -134,11 +130,11 @@
err = verify_area(VERIFY_READ, args, sizeof(short) * 5);
if (err)
return err;
- get_user(xs, args++);
- get_user(ys, args++);
- get_user(xe, args++);
- get_user(ye, args++);
- get_user(sel_mode, args);
+ __get_user(xs, args++);
+ __get_user(ys, args++);
+ __get_user(xe, args++);
+ __get_user(ye, args++);
+ __get_user(sel_mode, args);
} else {
xs = *(args++); /* set selection from kernel */
ys = *(args++);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 12:38    [W:1.103 / U:0.988 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site