On Sun, Nov 15, 2026 at 10:54:27PM +0100, Leon Pelzmann wrote:
sw_i2c_wait() is meant to insert a delay between the bit-banged I2C
operations, but it only consists of a loop that computes a value into
a local variable which is never read. The loop has no side effects, so
the compiler removes it entirely and the function compiles to nothing.
With W=1 this also triggers:
ddk750_swi2c.c:95:16: error: variable 'tmp' set but not used
[-Werror=unused-but-set-variable=]
Remove the function and all of its call sites. The I2C timing is not
changed by this: the object code of ddk750_swi2c.o (x86_64, gcc,
allmodconfig) is identical before and after this change.
The W=1 warning was found by building the driver, and the change was
prepared with the help of an AI coding assistant (Claude); it was
verified by comparing the objdump output before and after the change.
Please read https://lore.kernel.org/r/2026080354-skater-urgent-31b2@gregkh (local)