Re: [PATCH v2 4/7] i2c: i2c-core-acpi: Add i2c_acpi_dev_name()

From
Daniel Scally <djrscally@gmail.com>
Date
2021-01-28 09:21:48
Also in
linux-acpi, linux-i2c, lkml, platform-driver-x86
Reply to
Wolfram Sang, 2021-01-28
On 28/01/2021 09:00, Wolfram Sang wrote:
quoted
quoted
There's a real danger of a memory leak, as the function name sounds very
similar to dev_name() or acpi_dev_name() and those don't allocate
memory. I'm not sure what a better name would be, but given that this
function is only used in patch 6/7 and not in the I2C subsystem itself,
I wonder if we should inline this kasprintf() call in the caller and
drop this patch.
IMO if this is a one-off usage, it's better to open-code it.
Sounds reasonable to me, too.
Just to clarify; "open-code" meaning inline it in the caller like
Laurent said, right?
Thread (98 messages) 98 messages, 11 authors, last reply 2021-02-07
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help