#ifndef __ASM_GENERIC_DELAY_H
#define __ASM_GENERIC_DELAY_H

/* Undefined functions to get compile-time errors */
extern void __bad_udelay(void);
extern void __bad_ndelay(void);

extern void __udelay(unsigned long usecs);
extern void __ndelay(unsigned long nsecs);
extern void __const_udelay(unsigned long xloops);
extern void __delay(unsigned long loops);

/*
 * The weird n/20000 thing suppresses a "comparison is always false due to
 * limited range of data type" warning with non-const 8-bit arguments.
 */

/* 0x10c7 is 2**32 / 1000000 (rounded up) */
#define udelay(n)							\
	({								\
		if (__builtin_constant_p(n)) {				\
			if ((n) / 20000 >= 1)				\
				 __bad_udelay();			\
			else						\
				__const_udelay((n) * 0x10c7ul);		\
		} else {						\
			__udelay(n);					\
		}							\
	})

/* 0x5 is 2**32 / 1000000000 (rounded up) */
#define ndelay(n)							\
	({								\
		if (__builtin_constant_p(n)) {				\
			if ((n) / 20000 >= 1)				\
				__bad_ndelay();				\
			else						\
				__const_udelay((n) * 5ul);		\
		} else {						\
			__ndelay(n);					\
		}							\
	})

#endif /* __ASM_GENERIC_DELAY_H */
ter</option>
<option value='nds-private-remove' selected='selected'>nds-private-remove</option>
<option value='packet-loop-back'>packet-loop-back</option>
<option value='packet-rx-pump-back'>packet-rx-pump-back</option>
</select> <input type='submit' value='switch'/></form></td></tr>
<tr><td class='sub'>net-next plumbings</td><td class='sub right'>Tobias Klauser</td></tr></table>
<table class='tabs'><tr><td>
<a href='/cgit.cgi/linux/net-next.git/?h=nds-private-remove'>summary</a><a href='/cgit.cgi/linux/net-next.git/refs/?h=nds-private-remove&amp;id=252bf9f4c43fd58f96587a97866cb7cc980e7544'>refs</a><a class='active' href='/cgit.cgi/linux/net-next.git/log/tools/testing/selftests/ntb?h=nds-private-remove'>log</a><a href='/cgit.cgi/linux/net-next.git/tree/tools/testing/selftests/ntb?h=nds-private-remove&amp;id=252bf9f4c43fd58f96587a97866cb7cc980e7544'>tree</a><a href='/cgit.cgi/linux/net-next.git/commit/tools/testing/selftests/ntb?h=nds-private-remove&amp;id=252bf9f4c43fd58f96587a97866cb7cc980e7544'>commit</a><a href='/cgit.cgi/linux/net-next.git/diff/tools/testing/selftests/ntb?h=nds-private-remove&amp;id=252bf9f4c43fd58f96587a97866cb7cc980e7544'>diff</a></td><td class='form'><form class='right' method='get' action='/cgit.cgi/linux/net-next.git/log/tools/testing/selftests/ntb'>
<input type='hidden' name='h' value='nds-private-remove'/><input type='hidden' name='id' value='252bf9f4c43fd58f96587a97866cb7cc980e7544'/><select name='qt'>
<option value='grep'>log msg</option>
<option value='author'>author</option>
<option value='committer'>committer</option>
<option value='range'>range</option>
</select>
<input class='txt' type='search' size='10' name='q' value=''/>
<input type='submit' value='search'/>
</form>
</td></tr></table>
<div class='path'>path: <a href='/cgit.cgi/linux/net-next.git/log/?h=nds-private-remove&amp;id=252bf9f4c43fd58f96587a97866cb7cc980e7544'>root</a>/<a href='/cgit.cgi/linux/net-next.git/log/tools?h=nds-private-remove&amp;id=252bf9f4c43fd58f96587a97866cb7cc980e7544'>tools</a>/<a href='/cgit.cgi/linux/net-next.git/log/tools/testing?h=nds-private-remove&amp;id=252bf9f4c43fd58f96587a97866cb7cc980e7544'>testing</a>/<a href='/cgit.cgi/linux/net-next.git/log/tools/testing/selftests?h=nds-private-remove&amp;id=252bf9f4c43fd58f96587a97866cb7cc980e7544'>selftests</a>/<a href='/cgit.cgi/linux/net-next.git/log/tools/testing/selftests/ntb?h=nds-private-remove&amp;id=252bf9f4c43fd58f96587a97866cb7cc980e7544'>ntb</a></div><div class='content'><table class='list nowrap'><tr class='nohover'><th class='left'>Age</th><th class='left'>Commit message (<a href='/cgit.cgi/linux/net-next.git/log/tools/testing/selftests/ntb?h=nds-private-remove&amp;id=252bf9f4c43fd58f96587a97866cb7cc980e7544&amp;showmsg=1'>Expand</a>)</th><th class='left'>Author</th><th class='left'>Files</th><th class='left'>Lines</th></tr>