Re: [PATCH 1/2] tty: serial_core: Add name field to uart_port struct

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

 



On Tue, Mar 21, 2017 at 3:36 PM, Vignesh R <vigneshr@xxxxxx> wrote:
> Introduce a field to store name of uart_port that can be used to easily
> identify uart port instances on a system that has more than one uart

uart -> UART

> instance. The name is of the form ttyXN(eg. ttyS0, ttyAMA0,..) where N
> is number that particular uart instance.
> This field will be useful when printing debug info for a particular port
> or in register irqs with unique irq name. Port name is populated during

irq(s) -> IRQ(s)

> uart_add_one_port().

> +       snprintf(uport->name, sizeof(uport->name), "%s%d", drv->dev_name,
> +                drv->tty_driver->name_base + uport->line);

This is fragile. dev_name is defined as pointer, so, it would be any length.
So, better to use [devm_]kasprintf().

-- 
With Best Regards,
Andy Shevchenko
--
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