Re: [PATCH v2] x86/early_printk: add MMIO-based UARTs

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

 



* Denis Mukhin via B4 Relay <devnull+dmukhin.ford.com@xxxxxxxxxx> wrote:

> +	if (!strncmp(s, "nocfg", 5))
> +		baudrate = 0;
> +	else {
> +		baudrate = simple_strtoul(s, &e, 0);
> +		if (baudrate == 0 || s == e)
> +			baudrate = DEFAULT_BAUD;
> +	}

In standard kernel coding style we always balance curly braces and 
don't skip them in the single-statement case. Ie. the above should be:

	if (!strncmp(s, "nocfg", 5)) {
		baudrate = 0;
	} else {


> +	if (baudrate)
> +		early_serial_hw_init(115200 / baudrate);

Hm, I think that division will go poorly if 'baudrate' ends up being 0 
in the 'nocfg' case ... ;-)

Thanks,

	Ingo




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux