From nobody Sat Sep 28 21:26:49 2024 X-Original-To: dev-commits-src-main@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 4XGL4n3l6wz5XsRt; Sat, 28 Sep 2024 21:26:49 +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 4XGL4n3993z40bK; Sat, 28 Sep 2024 21:26:49 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727558809; 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=7aPhN2x5cwgfXf797J514xGU0OI/YazIvx2gBmohqzI=; b=p+30yEY+J6uQZBu6CmjqlYOlKlQenu1ggrMSa0uVkiamqWZEQodk2WCyWvKHZItcPso91X w2ktn7+TprGbsWj54Sj0aLXdz/PsEUriBWZ+zliFNtlH8lsIx0xNLufP88wIVgVtaLc0ZE XgbGwyA9wdZ3JfF0o+tfyEUaYhXwuLdbz/AK7HtnjIdF+jYCI5F4WIaPEuB2z6KAlmx+hp 0854K7qcLPVFTHfsiUmcNIThsii1UfV5kFHAoc0cyjGdl5/ond7ulxnCUsru2rCVqXshi0 XOVsQecRHcYvH9PrzmUoOKCNvnrFGfWMRkI//L7hxucC5m2UAX6Nogo11CD9Xg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727558809; 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=7aPhN2x5cwgfXf797J514xGU0OI/YazIvx2gBmohqzI=; b=SSmRd6FsY0XzXtGm7OCf+my6gLRbuSvxBVPnzxalng8Dxrm+47tT79MUYmJ3BkEIaCRlD1 2eIr5aeD2Np61RYr2gqAQW8H588GZ9MGM3qQoPNaU1yZ4Zad7zAWmoR77v0D4aLe8BZKm5 sx2hwcqep0o1RMiLEmmKpnHcMy6ZDfseER+x/z9RBRVQ5qWa6tYiYOqWrHi0jS/Q2R+NIp iE75vRJVjVSrCrxa9ut/e1AZRW2AftBqjlio+Caof9aqm8hBobb7mwJtGDpg0nWHVQey4v ETJYUjsUtWA71rNLM2ABA/NOInUgj9oy7gjd9jeIPTA7fRikmTqJpboyXOpxXQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727558809; a=rsa-sha256; cv=none; b=wnrIhhJf4XLu97dYc/1Hw/eSTVeSHE9D++F64n6F454Ix5p9TGiNf5h6xLu+T/qhHA4Mw1 gbhyT5JxpgyuC0obXtqAkC+bXrkae9Bna5X90oZzeVCnNa2sqY7nozFDgCM3hOEYvs4wKF QAcEFtG1Kq1dXe6wi3Km1Idebg/GCxtW93FFUvAG6RzvvhYXj2SgLyA3f7a//wb0k2bleq MgoloW11eTR0TTt/8SHEMSYJlpvpMACb/3p2vIVze4Oj+RgD2I6GsQeecUDkWWSFp9IqvH qlWBkfQhiVMJJFRsadYf5rmNHsC6Ia5YQV18ChG+pfwdbQ5lH64CJikUuJPq8Q== 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 4XGL4n2mZ6zhMN; Sat, 28 Sep 2024 21:26:49 +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 48SLQnHa000561; Sat, 28 Sep 2024 21:26:49 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48SLQn8h000558; Sat, 28 Sep 2024 21:26:49 GMT (envelope-from git) Date: Sat, 28 Sep 2024 21:26:49 GMT Message-Id: <202409282126.48SLQn8h000558@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Doug Moore Subject: git: 65c4ec887eec - main - gdma: use ispower2 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 65c4ec887eec1f1967557cc3f2656df76b5898bb Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=65c4ec887eec1f1967557cc3f2656df76b5898bb commit 65c4ec887eec1f1967557cc3f2656df76b5898bb Author: Doug Moore AuthorDate: 2024-09-28 21:17:03 +0000 Commit: Doug Moore CommitDate: 2024-09-28 21:17:03 +0000 gdma: use ispower2 It's faster to use ispower2(n) than it is to compute roundup_pow_of_two and do a comparison. So do the former. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D46838 --- sys/dev/mana/gdma_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/mana/gdma_main.c b/sys/dev/mana/gdma_main.c index 13f2617ad7d4..59ac6911c784 100644 --- a/sys/dev/mana/gdma_main.c +++ b/sys/dev/mana/gdma_main.c @@ -221,7 +221,7 @@ mana_gd_alloc_memory(struct gdma_context *gc, unsigned int length, if (!gc || !gmi) return EINVAL; - if (length < PAGE_SIZE || (length != roundup_pow_of_two(length))) + if (length < PAGE_SIZE || !powerof2(length)) return EINVAL; err = bus_dma_tag_create(bus_get_dma_tag(gc->dev), /* parent */