From 46ce32e1701eefe9ae98604ab04ce1163d582c48 Mon Sep 17 00:00:00 2001 From: dg Date: Sun, 17 Sep 2000 23:04:57 +0000 Subject: As a minor optimization, do suspended checking more like it was originally in the PR - before the while loop. --- sys/dev/fxp/if_fxp.c | 7 ++++++- sys/pci/if_fxp.c | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sys/dev/fxp/if_fxp.c b/sys/dev/fxp/if_fxp.c index 08dd15c..f10e58c 100644 --- a/sys/dev/fxp/if_fxp.c +++ b/sys/dev/fxp/if_fxp.c @@ -1218,7 +1218,12 @@ fxp_intr(arg) FXP_LOCK(sc, s); - while (!sc->suspended && (statack = CSR_READ_1(sc, FXP_CSR_SCB_STATACK)) != 0) { + if (sc->suspended) { + FXP_UNLOCK(sc, s); + return; + } + + while ((statack = CSR_READ_1(sc, FXP_CSR_SCB_STATACK)) != 0) { #if defined(__NetBSD__) claimed = 1; #endif diff --git a/sys/pci/if_fxp.c b/sys/pci/if_fxp.c index 08dd15c..f10e58c 100644 --- a/sys/pci/if_fxp.c +++ b/sys/pci/if_fxp.c @@ -1218,7 +1218,12 @@ fxp_intr(arg) FXP_LOCK(sc, s); - while (!sc->suspended && (statack = CSR_READ_1(sc, FXP_CSR_SCB_STATACK)) != 0) { + if (sc->suspended) { + FXP_UNLOCK(sc, s); + return; + } + + while ((statack = CSR_READ_1(sc, FXP_CSR_SCB_STATACK)) != 0) { #if defined(__NetBSD__) claimed = 1; #endif -- cgit v1.1