lkml.org 
[lkml]   [2003]   [Jun]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Permit big console scrolls
Geert Uytterhoeven <geert@linux-m68k.org> wrote:
>
> On Sun, 22 Jun 2003, Andrew Morton wrote:
> > Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> > >
> > > > - if (get_user(lines, (char *)arg+1)) {
> > > ^^^^^
> > > > + if (get_user(lines, (s32 *)((char *)arg+4))) {
> > > ^^^^^
> > > > ret = -EFAULT;
> > > > } else {
> > > > scrollfront(lines);
> > >
> > > Why was the `arg+1' changed to `arg+4'? Do we really want to skip 12 bytes?
> >
> > It skips three bytes?
>
> Oops, you're right. But my first question remains: why skip 3 bytes?

Well we want to use a 32-bit quantity, not an 8-bit one. So Samuel aligned
that quantity 32 bits beyond the 8-bit ioctl `type' arg.

So I guess you'd do:

struct foo {
char type;
char pad[3];
s32 distance;
};


-
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:36    [W:0.036 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site