Re: [PATCH] staging: sm750fb: remove unused variable 'tmp' in sw_i2c_wait

From: Dan Carpenter

Date: Wed Sep 23 2026 - 03:39:58 EST


On Wed, Sep 23, 2026 at 03:35:26AM +0200, Eduard Zateev wrote:
> The variable 'tmp' in sw_i2c_wait() is written but never read outside
> the loop, triggering a set-but-not-used warning with W=1. The loop
> itself is a fixed-count busy-wait with no side effects; remove the
> unused variable and keep the empty loop body.
>
> Signed-off-by: Eduard Zateev <hackerowskiy@xxxxxxxxx>
> ---

Search the archives to see if someone has sent a patch like this
before.

https://lore.kernel.org/all/abfFn_AET_xAVjji@stanley.mountain/

Compilers often remove empty busy loops so that probably explains
why they added the nonsense code.

We don't want to silence this warning because the code is legitimately
bad and should trigger a warning. But until someone can test it, then
it's impossible to fix.

regards,
dan carpenter