Thread (87 messages) 87 messages, 10 authors, 2022-01-22

Re: [PATCH 2/4] iio: imu: add Bosch Sensortec BNO055 core driver

From: Andy Shevchenko <hidden>
Date: 2021-08-04 19:28:21
Also in: lkml

On Wed, Aug 4, 2021 at 7:51 PM Jonathan Cameron
[off-list ref] wrote:
On Wed, 4 Aug 2021 12:06:46 +0200
Andrea Merello [off-list ref] wrote:
quoted
Il giorno sab 31 lug 2021 alle ore 19:58 Jonathan Cameron
[off-list ref] ha scritto:
...
quoted
Isn't this like doing a cut-and-paste of check+dev_err() in more than
a dozen places in the code?

If you just want more information about the caller then we could
macroize those functions, so they can also print the caller code line
number (or they could accept an additional argument, which is the code
line number to print, and then a macro helper that adds that last
argument can be used to invoke them).. But this wouldn't address your
second point..
It's a trade off between reviewability which these wrappers make worse
and short code.

My personal preference is don't bother with messages on simple reg read /write
failures.  If it happens you either get an error reported to userspace and
can do some more debug, or the driver doesn't probe - again, more debug to
be done even if you know it was a read or write.
The advantage of regmap is that it has already established trace
events. No need to add additional stuff (at least it's easy to see,
read or write or what values were there). I personally put messages on
regmap reads and writes in the specific cases only, when it indeed may
shed a light on some events.


-- 
With Best Regards,
Andy Shevchenko
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help