From nobody Sat Oct 12 20:58:45 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XQwnx4YWhz5YyVv; Sat, 12 Oct 2024 20:58:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XQwnx38yRz4SSg; Sat, 12 Oct 2024 20:58:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728766725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WgPBFOU7nq8cqrKMKzcK3I9QxG5xsdUxnm5pI2kFrLE=; b=sApfUsBfsOQIxdpW0TjXdgDdk+ehTqvAdJJKCb4Q/103bpfLWMk7wPp0iTbTqFOIOccaq2 Euwk2YVw5sRKmLkRwtxMuk1K0BSGMUhYmDYbRNSsOpVHQlYEODhTh7dY6nSMKsnctNwODk dLClYq2CO1GaOniQQj43Oltt/WRwF2qtKeNWxy8qFDPbFnUcGRMjwrRmoUBhPKRU4cr/nH EUiOpp4JUr49Ors6AfmT0edX06e9aP9AiGebywJW31yhEri8BT5c/UIsn+16huS6JoSK44 yYb+jSREt+1/XA32sSJ25OjDLJj5GJxzfILgJAqwNhuO45O7CTPdk/pN7i/5/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728766725; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WgPBFOU7nq8cqrKMKzcK3I9QxG5xsdUxnm5pI2kFrLE=; b=vXrldJ9cg6wOS5G+UEFfj/psXFroIPE9OJsINDUxNbc775Uo23rH2gZwzk7Esn1N7r+VEK lp87bpzbG/xrJ8TXX8VHo+DK90f1x9MGycKGunDFKgBvuwTqdscFiT3ZTdURssfGcIk7y8 As43u83ZI+RrpeussyD53S66rt3ar9+/r/Q+YK5Nr1oVjFYrk/R8rAcQJWocFXWZhMZka6 RnH7hy3DGOXF5nt7anMVs+Os3efENX+hoV7dQgsQf1maIhylacTADCaPOaPWQuj6YgYsAH JmRPjFN4Zm+8S0qjp63sUTUOMzGGRwtMkdA8nA/AEnZd0ClaFan6QkVXBDGGZQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728766725; a=rsa-sha256; cv=none; b=YiX7Ne4ar8CqU0xZvIbU8DcQh9K0eEZSY5CEWJQO3SVnzhv8pbRkKtFWIQWzMoHmDAjGYB 8reSefLjNxEzJXGZcyI+GK6s6NwWl0Id95tuKWtGdUfwCSeLFoq29bV7BSD8PMTqR+1xC6 nMzkxQp8zcFokqkDmhI62xMa+SJqFzpMOLe5ZKlpP28VFkvvWP+y17uw0/WuuUmZvbPqJa XPoEe7b70UsDjgqnyZoJIuWRKxUcU1wLeHNCd0mi1HiimkKpAfeReDwp1RzzodjFd0Z7rj VAiJMOEQK1YGkcMtF2XtlfJtV3VkwXDf5aBmDpvOrcmqyJj+ETfuVKHgOLJ8ng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XQwnx2m6wzPpZ; Sat, 12 Oct 2024 20:58:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 49CKwjYQ038139; Sat, 12 Oct 2024 20:58:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49CKwjox038136; Sat, 12 Oct 2024 20:58:45 GMT (envelope-from git) Date: Sat, 12 Oct 2024 20:58:45 GMT Message-Id: <202410122058.49CKwjox038136@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 4584c8f0ef54 - main - lpt: check readiness with predefined macros List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 4584c8f0ef54e19f7be79aeee1ba1c1154af14e1 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=4584c8f0ef54e19f7be79aeee1ba1c1154af14e1 commit 4584c8f0ef54e19f7be79aeee1ba1c1154af14e1 Author: Arvydas Sidorenko AuthorDate: 2024-10-11 22:54:17 +0000 Commit: Warner Losh CommitDate: 2024-10-12 20:40:24 +0000 lpt: check readiness with predefined macros Replace spelled-out bits with pre-defined macros for those same bits. No functional change. PR: 170076 Reviewed by: imp --- sys/dev/ppbus/lpt.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/sys/dev/ppbus/lpt.c b/sys/dev/ppbus/lpt.c index 994adcc6a608..d6f5b34d0e60 100644 --- a/sys/dev/ppbus/lpt.c +++ b/sys/dev/ppbus/lpt.c @@ -238,8 +238,7 @@ lpt_port_test(device_t ppbus, u_char data, u_char mask) do { DELAY(10); temp = ppb_rdtr(ppbus) & mask; - } - while (temp != data && --timeout); + } while (temp != data && --timeout); lprintf(("out=%x\tin=%x\ttout=%d\n", data, temp, timeout)); return (temp == data); } @@ -560,9 +559,7 @@ lptopen(struct cdev *dev, int flags, int fmt, struct thread *td) } /* is printer online and ready for output */ - } while ((ppb_rstr(ppbus) & - (LPS_SEL|LPS_OUT|LPS_NBSY|LPS_NERR)) != - (LPS_SEL|LPS_NBSY|LPS_NERR)); + } while ((ppb_rstr(ppbus) & RDY_MASK) != LP_READY); sc->sc_control = LPC_SEL|LPC_NINIT; if (sc->sc_flags & LP_AUTOLF) @@ -619,9 +616,7 @@ lptclose(struct cdev *dev, int flags, int fmt, struct thread *td) /* if the last write was interrupted, don't complete it */ if ((!(sc->sc_state & INTERRUPTED)) && (sc->sc_irq & LP_USE_IRQ)) - while ((ppb_rstr(ppbus) & - (LPS_SEL|LPS_OUT|LPS_NBSY|LPS_NERR)) != - (LPS_SEL|LPS_NBSY|LPS_NERR) || sc->sc_xfercnt) + while ((ppb_rstr(ppbus) & RDY_MASK) != LP_READY || sc->sc_xfercnt) /* wait 1 second, give up if we get a signal */ if (ppb_sleep(ppbus, lptdev, LPPRI | PCATCH, "lpclose", hz) != EWOULDBLOCK)