[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aXn3KAIpVDr8la1o@stanley.mountain>
Date: Wed, 28 Jan 2026 14:46:48 +0300
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Madhumitha Sundar <madhuananda18@...il.com>
Cc: sudipm.mukherjee@...il.com, teddy.wang@...iconmotion.com,
gregkh@...uxfoundation.org, linux-fbdev@...r.kernel.org,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: sm750fb: replace magic number with defined
constant
On Tue, Jan 27, 2026 at 01:27:58PM +0000, Madhumitha Sundar wrote:
> The hardware wait loop in hw_sm750_de_wait uses a hardcoded magic
> number (0x10000000) for the timeout counter.
>
> Define a constant SM750_MAX_LOOP in sm750.h and use it to improve
> code readability and maintainability.
Timeout counters have no special meaning. They aren't intended to be
re-used in multiple places.
There is a kind of bug where people think we exit with the counter set
to zero but actually we exit with it set the -1. Normally, when I see
this sort of bug, I change the timer from cnt-- to --cnt which changes
loop from iterating 100 times to iterating 99 times. It's fine. No
one cares if about the exact number, just the approximate range.
The original was more clear.
regards,
dan carpenter
Powered by blists - more mailing lists