From: Vignesh R <vigneshr@ti.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jiri Slaby <jslaby@suse.com>,
"linux-serial@vger.kernel.org" <linux-serial@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>,
Jisheng Zhang <jszhang@marvell.com>
Subject: Re: [PATCH 1/2] tty: serial_core: Add name field to uart_port struct
Date: Thu, 23 Mar 2017 17:43:36 +0530 [thread overview]
Message-ID: <61fd3976-1160-f0cb-15ce-91c46f3d749e@ti.com> (raw)
In-Reply-To: <CAHp75VfHtTV6L0GE61kMiHMCQrUSwGJPRxsiNuOCD9mY7MPpZQ@mail.gmail.com>
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
next prev parent reply other threads:[~2017-03-23 12:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-03-21 13:36 [PATCH 0/2] serial: Add name field to uart_port Vignesh R
2017-03-21 13:36 ` [PATCH 1/2] tty: serial_core: Add name field to uart_port struct Vignesh R
2017-03-22 18:45 ` Andy Shevchenko
2017-03-23 12:13 ` Vignesh R [this message]
2017-03-21 13:36 ` [PATCH 2/2] serial: 8250: 8250_core: Fix irq name for 8250 serial irq Vignesh R
2017-03-22 18:48 ` Andy Shevchenko
2017-03-22 18:46 ` [PATCH 0/2] serial: Add name field to uart_port Andy Shevchenko
2017-03-23 12:22 ` Vignesh R
2017-03-23 17:07 ` Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=61fd3976-1160-f0cb-15ce-91c46f3d749e@ti.com \
--to=vigneshr@ti.com \
--cc=andy.shevchenko@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jslaby@suse.com \
--cc=jszhang@marvell.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®