Re: [tip: objtool/urgent] objtool, pwm: mediatek: Prevent theoretical divide-by-zero in pwm_mediatek_config()

From: Peter Zijlstra
Date: Wed Mar 26 2025 - 07:17:55 EST


On Wed, Mar 26, 2025 at 11:35:28AM +0100, Uwe Kleine-König wrote:

> and the build works fine for me and there is no warning about
> drivers/pwm/pwm-mediatek.o. What am I missing?

Could be compiler related; IIRC it is mostly clang that does this. When
it finds /0 it simply stops code-gen.

I *really* dislike this behaviour, but since C declares this UB, they're
basically free to do whatever.

IMO it should just emit the code; kernel has exceptions to deal with
this and userspace gets signals.

Attachment: signature.asc
Description: PGP signature