Subject: Re: Fix for get/putwschar
To: None <tech-kern@netbsd.org>
From: Julio M. Merino Vidal <jmmv84@gmail.com>
List: tech-kern
Date: 04/13/2006 23:53:56
On 4/13/06, Valeriy E. Ushakov <uwe@ptc.spbu.ru> wrote:
>
> Please, don't use casts like thas. &scr->pcs is shorter and is easier
> to read and understand (see below).
Done.
> > @@ -87,8 +88,8 @@ static void vcons_putchar(void *, int, i
> > static void vcons_cursor(void *, int, int, int);
> >
> > /* support for readin/writing text buffers. For wsmoused */
> > -static int vcons_putwschar(void *, struct wsdisplay_char *);
> > -static int vcons_getwschar(void *, struct wsdisplay_char *);
> > +static int vcons_putwschar(struct rasops_info *, struct wsdisplay_cha=
r *);
> > +static int vcons_getwschar(struct rasops_info *, struct wsdisplay_cha=
r *);
>
> Is rasops_info semantically correct way to refer to a vcons screen?
> Admittedly I haven't checked it thoroughly, but I suspect - no.
> Michael?
I do not know. This is what the original code used.
> > @@ -361,6 +366,34 @@ vcons_redraw_screen(struct vcons_screen
> > }
> >
> > static int
> > +vcons_ioctl(void *v, void *vs, u_long cmd, caddr_t data, int flag,
> > + struct lwp *l)
> > +{
> > + struct vcons_data *vd =3D v;
> > + int error;
> > +
> > + switch (cmd) {
> > + case WSDISPLAYIO_GETWSCHAR:
> > + error =3D vcons_getwschar(vd->cookie,
> > + (struct wsdisplay_char *)data);
> > + break;
>
> vd->cookie is driver's cookie to vcons. It cannot be rasops (see
> prototype in the previous hunk). E.g. isgfb passes struct
> igsfb_devconfig as cookie.
So what has it to be?
> > +
> > + default:
> > + if (vd->ioctl !=3D NULL)
> > + error =3D (*vd->ioctl)(v, vs, cmd, data, flag, l)=
;
> > + else
> > + error =3D EINVAL;
> > + }
> > +
> > + return error;
> > +}
>
> Use EPASSTHROUGH instead. Upper layers will handle it.
Done.
--
Julio M. Merino Vidal <jmmv84@gmail.com>
The Julipedia - http://julipedia.blogspot.com/