|
From: David G. <dga...@gm...> - 2018-05-18 14:33:36
|
2018-05-18 11:29 GMT+02:00 Thorsten Otto <ad...@th...>: > On Freitag, 18. Mai 2018 10:57:10 CEST David Gálvez wrote: >> I've attached the patch for you to take a look in case you want to >> comment anything. > > Might be cleaner to write ndelay as > > #define ndelay(n) ndelay_loops(getloops4ns(n)) > Good idea, thanks! > Also i'm not entirely sure whether the DIV_ROUND_UP macro is used correctly > there, you are rounding up the number of loops there? Wouldn't that give way > too large values on slower processors? > The aim of these functions (mdelay, udelay and ndelay) is not to be very very precise but give "at least" the delay requested. On slow CPUs (for example a 030 at 16MHz) the loop count would be 0 for any given value of nanoseconds below 1000, so the loop count will be round up to 1 to get at least the delay requested. |