Re: [PATCH] serial: serial_txx9 driver update

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Russell King <[email protected]> wrote:
>
> On Sat, Jan 21, 2006 at 11:36:49PM -0800, Andrew Morton wrote:
> > Atsushi Nemoto <[email protected]> wrote:
> > >
> > >  serial_txx9_verify_port(struct uart_port *port, struct serial_struct *ser)
> > >   {
> > >  -	if (ser->irq < 0 ||
> > >  -	    ser->baud_base < 9600 || ser->type != PORT_TXX9)
> > >  +	unsigned long new_port = (unsigned long)ser->port +
> > >  +		((unsigned long)ser->port_high << ((sizeof(long) - sizeof(int)) * 8));
> > 
> > Are you sure about this part?  Shifting something left by sizeof(something)
> > seems very strange.  It'll give different results on 64-bit machines for
> > the same hardware.  Are you sure it wasn't supposed to be an addition?
> 
> There is a definition for that constant - it's called HIGH_BITS_OFFSET.

There are two definitions, actually.  drivers/serial/serial_core.c and
drivers/serial/8250.h.

> No need to try to buggily recreate it.

Where's the bug in the proposed code?

Can you tell us what HIGH_BITS_OFFSET actually does?  Stuffing the port
address into the upper 32-bits of a ulong on 64-bit machines.  Am consumed
by curiosity.

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

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux