if(apmerrors < 10) timeout(apm_periodic_check, sc, hz); #ifdef DIAGNOSTIC else printf("APM: too many errors, turning off timeout\n"); #endif
timeout(apm_periodic_check, sc, hz);
apm_periodic_check(arg)	void *arg;{	register struct apm_softc *sc = arg;	struct apmregs regs;	while (apm_get_event(regs) == 0)		apm_event_handle(sc, &regs);	if (APM_ERR_CODE(&regs) != APM_ERR_NOEVENTS)		apm_perror("get event", &regs);	if (apm_suspends /*|| (apm_battlow && apm_userstandbys)*/) {		/* stupid TI TM5000! */		apm_suspend();	} else if (apm_standbys || apm_userstandbys) {		apm_standby();	}	apm_suspends = apm_standbys = apm_battlow = apm_userstandbys = 0;	if(apmerrors < 10)		timeout(apm_periodic_check, sc, hz);#ifdef DIAGNOSTIC	else		printf("APM: too many errors, turning off timeout\n");#endif}