All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] Permit big console scrolls
       [not found] <200306210621.h5L6LbUo011422@hera.kernel.org>
@ 2003-06-22  9:04 ` Geert Uytterhoeven
  2003-06-22  9:36   ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2003-06-22  9:04 UTC (permalink / raw)
  To: Samuel Thibault, Andrew Morton; +Cc: Linux Kernel Development

On Sat, 21 Jun 2003, Linux Kernel Mailing List wrote:
> ChangeSet 1.1381, 2003/06/20 22:14:31-07:00, akpm@digeo.com
> 
> 	[PATCH] Permit big console scrolls
> 	
> 	From: Samuel Thibault <Samuel.Thibault@ens-lyon.fr>
> 	
> 	Changes the new console scrolling ioctl to permit distances greater than
> 	+127/-128.
> 
> 
> # This patch includes the following deltas:
> #	           ChangeSet	1.1380  -> 1.1381 
> #	   drivers/char/vt.c	1.52    -> 1.53   
> #
> 
>  vt.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletion(-)
> 
> 
> diff -Nru a/drivers/char/vt.c b/drivers/char/vt.c
> --- a/drivers/char/vt.c	Fri Jun 20 23:21:41 2003
> +++ b/drivers/char/vt.c	Fri Jun 20 23:21:41 2003
> @@ -75,6 +75,7 @@
>   */
>  
>  #include <linux/module.h>
> +#include <linux/types.h>
>  #include <linux/sched.h>
>  #include <linux/tty.h>
>  #include <linux/tty_flip.h>
> @@ -2279,7 +2280,7 @@
>  			ret = fg_console;
>  			break;
>  		case TIOCL_SCROLLCONSOLE:
> -			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?

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


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

* Re: [PATCH] Permit big console scrolls
  2003-06-22  9:04 ` [PATCH] Permit big console scrolls Geert Uytterhoeven
@ 2003-06-22  9:36   ` Andrew Morton
  2003-06-22  9:47     ` Geert Uytterhoeven
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2003-06-22  9:36 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Samuel.Thibault, linux-kernel

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?

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

* Re: [PATCH] Permit big console scrolls
  2003-06-22  9:36   ` Andrew Morton
@ 2003-06-22  9:47     ` Geert Uytterhoeven
  2003-06-22 10:04       ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2003-06-22  9:47 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Samuel.Thibault, Linux Kernel Development

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?

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds


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

* Re: [PATCH] Permit big console scrolls
  2003-06-22  9:47     ` Geert Uytterhoeven
@ 2003-06-22 10:04       ` Andrew Morton
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2003-06-22 10:04 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Samuel.Thibault, linux-kernel

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;
	};



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

end of thread, other threads:[~2003-06-22  9:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <200306210621.h5L6LbUo011422@hera.kernel.org>
2003-06-22  9:04 ` [PATCH] Permit big console scrolls Geert Uytterhoeven
2003-06-22  9:36   ` Andrew Morton
2003-06-22  9:47     ` Geert Uytterhoeven
2003-06-22 10:04       ` Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.