lkml.org 
[lkml]   [2003]   [Apr]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] reduce stack in cpqarray.c::ida_ioctl()
On Fri, 4 Apr 2003 02:30:44 +0200 Jörn Engel <joern@wohnheim.fh-wedel.de> wrote:

| On Thu, 3 April 2003 12:03:08 +0000, Randy.Dunlap wrote:
| >
| > Comments on the patch?
|
| Your patch looks just fine. The original code is a bit odd, though.
| If you want to change that in one go, read on. If not, please ignore
| this.
|
| > + error = ida_ctlr_ioctl(ctlr, dsk, my_io);
| > + if (error) goto iocfree;
|
| Wouldn't an extra line be nicer?

Probably. I would normally do that. In this case I was just
maintaining the style that is already used in that source file.

| > + error = copy_to_user(io, my_io, sizeof(*my_io)) ? -EFAULT : 0;
|
| copy_to_user returns the bytes successfully copied.
| error is set to -EFAULT, if there was actually data transferred?

Did you verify that?


| How about:
| + error = copy_to_user(io, my_io, sizeof(*my_io)) < sizeof(*my_io) ? -EFAULT : 0;


--
~Randy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:34    [W:0.113 / U:0.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site