Re: [PATCH 2/5] hsu, earlyprintk: add early printk for hsu_port2 console

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

 



> Please Cc: x86 patches to the x86 maintainers.

Sure - I should probably have also cc'd Feng - I've forwarded it and
added Feng so it doesn't get missed.

> > +static int hsu_inited;
> 
> 'initialized' is the proper English word i think.

Then we should probably run /sbin/initialize in future ;) inited is
perfectly fine computerspeak and much less typing.

> > +static void early_hsu_init(void)
> > +{
> > +	u8 lcr;
> > +
> > +	if (phsu && hsu_inited)
> > +		return;
> 
> Surely one of those will suffice as a "have we initialized" flag?
> 
> Also, under what circumstances can we call early_hsu_init() twice?

Don't think we can

> > +	/* GPIO workaround */
> > +	set_fixmap_nocache(FIX_EARLYCON_MEM_BASE,
> > MFD_GPIO_HSU_REG);
> > +	phsu = (void *)(__fix_to_virt(FIX_EARLYCON_MEM_BASE) +
> > +			(MFD_GPIO_HSU_REG & (PAGE_SIZE - 1)));
> > +
> > +	*((u32 *)phsu) = 0x55465;
> 
> What does 0x55465 stand for?

It's a firmware fixup. Its a magic value (even to most of us who work
here ;)). Feng - am I right in thinking we don't need that anyway with
the current firmware ?

> > +{
> > +	unsigned int timeout = 10000; /* 10ms*/
> > +	u8 status;
> > +
> > +	while (timeout--) {
> > +		status = readb(phsu + UART_LSR);
> > +		if (status & BOTH_EMPTY)
> > +			break;
> > +
> > +		udelay(1);
> > +	}
> > +
> > +	if (timeout == 0xffffffff)
> > +		return;
> 
> Using the -1 literal will dtrt too, and will be slightly clearer to
> the potentially overworked reader of such patches.

If they have a degree in C sign propagation. Better is probably 

	while (--timeout) {..
	}

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


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux