Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1607422
| From | Vignesh R <vigneshr@ti.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 1/2] tty: serial_core: Add name field to uart_port struct |
| Date | 2017-03-23 13:20 +0100 |
| Message-ID | <to9SF-25x-11@gated-at.bofh.it> (permalink) |
| References | <tnsb0-3W4-27@gated-at.bofh.it> <tnsb0-3W4-31@gated-at.bofh.it> <tnTux-6TD-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Thursday 23 March 2017 12:15 AM, Andy Shevchenko wrote: > On Tue, Mar 21, 2017 at 3:36 PM, Vignesh R <vigneshr@ti.com> 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(). > Ok, will you use kasprintf() (and corresponding kfree()) as device is not yet allocated at this stage to use devm_*. -- Regards Vignesh
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/2] serial: Add name field to uart_port Vignesh R <vigneshr@ti.com> - 2017-03-21 14:40 +0100
[PATCH 2/2] serial: 8250: 8250_core: Fix irq name for 8250 serial irq Vignesh R <vigneshr@ti.com> - 2017-03-21 14:40 +0100
Re: [PATCH 2/2] serial: 8250: 8250_core: Fix irq name for 8250 serial irq Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-03-22 19:50 +0100
[PATCH 1/2] tty: serial_core: Add name field to uart_port struct Vignesh R <vigneshr@ti.com> - 2017-03-21 14:40 +0100
Re: [PATCH 1/2] tty: serial_core: Add name field to uart_port struct Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-03-22 19:50 +0100
Re: [PATCH 1/2] tty: serial_core: Add name field to uart_port struct Vignesh R <vigneshr@ti.com> - 2017-03-23 13:20 +0100
Re: [PATCH 0/2] serial: Add name field to uart_port Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-03-22 19:50 +0100
Re: [PATCH 0/2] serial: Add name field to uart_port Vignesh R <vigneshr@ti.com> - 2017-03-23 13:30 +0100
Re: [PATCH 0/2] serial: Add name field to uart_port Andy Shevchenko <andy.shevchenko@gmail.com> - 2017-03-23 18:10 +0100
csiph-web