Re: [PATCH 3/4] Intel PTI implementaiton of MIPI 1149.7.

From: J Freyensee
Date: Thu May 05 2011 - 18:30:52 EST



> >
> > static void pti_tty_cleanup(struct tty_struct *tty)
> > {
> > if (!tty->driver_data)
> > return;
> > pti_release_masterchannel(tty->driver_data->mc);
> > kfree(tty->driver_data);
> > }
> >
>
> I think I answered this already; I like the suggestion and will tweak.
>
> > ...
> > > +static int pti_tty_driver_write(struct tty_struct *tty,
> > > + const unsigned char *buf, int len)
> > > +{
> > > + struct pti_masterchannel *mc;
> > > + struct pti_tty *pti_tty_data;
> > > +
> > > + pti_tty_data = tty->driver_data;
> > > + mc = pti_tty_data->mc;
> > > + pti_write_to_aperture(mc, (u8 *)buf, len);
> > > +
> > > + return len;
> > > +}
> >
> > I'd like to suggest this as an alternative:
> >
> > static int pti_tty_driver_write(struct tty_struct *tty,
> > const unsigned char *buf, int len)
> > {
> > pti_write_to_aperture(tty->driver_data->mc, (u8 *)buf, len);
> > return len;
> > }
> >
> >
>
> If there is no objections I will do it. What I've coded is the observed
> coding style I've seen, if for no other reason that to shorten up the
> number of '->' used in accessing a member of driver_data. But this
> doesn't look so bad/ugly.
>

Ok, so now I remember why this suggestion isn't good and I am going to
have to go back to what I had before. Some picky compilers do not like
for you to do operations on (void *) variables, other than a beginning
assign statement to a variable with an actual type.


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