Re: [PATCH v7 1/3] clocksource/drivers/timer-tegra186: add WDIOC_GETTIMELEFT support

From: Daniel Lezcano
Date: Mon May 05 2025 - 04:37:13 EST


On 05/05/2025 07:34, Robert Lin wrote:

[ ... ]

Yes so WARN sounds appropriate. It should never happen. I
don't see the issue.

The issue is if there is an userspace application reading the
ioctl and or the sysfs, then the warning will be emitted each
time if the never- happen condition exists. Preferably replace
the WARN_ON by pr_warn_once() as suggested if the bug must be
reported.

Sounds a bit funny 'if the never-happen condition exists' :-)

However, I will be fine with WARN_ON_ONCE(). I think that this
warrants more of a large WARN splat than pr_warn() because it
should never happen.


I believe the two WARN_ON I used here are the "this-should-never-
happen" situations. In my opinion, we are good to keep. But I am
also good with WARN_ON_ONCE for compromise. I wonder if Daniel is
good with this then I can fix them.

I'm fine with this


--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog