qca: ipq: fix to correct wrong delay obtained from udelay function

If usec >= 224000 usec, then:
usec * GPT_FREQ_KHZ = 224000 * 19200 >= 0x100590000,
which is a 33 bits value

To fix this usec is typecasted to 64 bit
(unsigned long long)usec * GPT_FREQ_KHZ

Change-Id: Ib1642d39b0581d2c04c62e415a1fd2dfed47fff1
Signed-off-by: Timple Raj M <quic_timple@quicinc.com>
This commit is contained in:
Timple Raj M 2023-11-17 20:52:20 +05:30
parent e5277a298e
commit 72d8ec613f

View file

@ -153,7 +153,7 @@ void __udelay(unsigned long usec)
if (usec == 0)
return;
val = (usec * GPT_FREQ_KHZ) / 1000;
val = ((unsigned long long)usec * GPT_FREQ_KHZ) / 1000;
if (val == 0 )
val = 1; /* Wait for atleast 1 tick */