lkml.org 
[lkml]   [2023]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/1] iio: adc: qcom-spmi-adc5: Fix the channel name
On 2023-01-18 16:29:24, Andy Shevchenko wrote:
...
> The devm_kstrdup(fwnode_get_name()) is an open coded variant of the above.
> I don't think we need to open code and produce NIH even a single API. And
> no, there is no magic behind that. At least from the fwnode point of view.
>
> You may very well say that > 1500 instances of "%pOF" is a magic...

Forgive me for not having a clear definition of "open coding" in mind
(showing a different way of implementing something, compared to the
"status quo" that I was not yet aware of?), nor knowing what NIH is
supposed to mean in this context. We're in bike-shedding territory
anyway, guess I should just bookmark the page that details all the many
`%` format strings available.

...
> > I find the latter clearer as it doesn't require the reader to figure out
> > that name - name cancels itself out. Alternatively we can write
> > strchrnul(name, '@')[0].
>
> I don't like to have Pythonisms in the C code, really.
>
> P.S. I guess this little patch already emptied my bandwidth, so I leave
> any further discussion to you and IIO maintainers. Thank you for the
> review!

Just soaking up kernel coding standards here :)

- Marijn

\
 
 \ /
  Last update: 2023-03-26 23:46    [W:0.651 / U:1.676 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site