Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Jun 2024 07:27:51 GMT
From:      Doug Moore <dougm@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: a94ed493b507 - main - dev/mana: replace power2 function
Message-ID:  <202406240727.45O7RppS044289@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by dougm:

URL: https://cgit.FreeBSD.org/src/commit/?id=a94ed493b50752cee09245fc312c63b00331f217

commit a94ed493b50752cee09245fc312c63b00331f217
Author:     Doug Moore <dougm@FreeBSD.org>
AuthorDate: 2024-06-24 06:55:01 +0000
Commit:     Doug Moore <dougm@FreeBSD.org>
CommitDate: 2024-06-24 06:55:01 +0000

    dev/mana: replace power2 function
    
    Replace is_power_of_2(length) with power2(length).  When length != 0, as in
    this case, they produce the same result.  This will allow an implementation
    of is_power_of_two to be dropped.
    
    Reviewed by:    alc, markj
    Differential Revision:  https://reviews.freebsd.org/D45536
---
 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 6be3e148d0da..6f3e182ba1eb 100644
--- a/sys/dev/mana/gdma_main.c
+++ b/sys/dev/mana/gdma_main.c
@@ -942,7 +942,7 @@ mana_gd_create_dma_region(struct gdma_dev *gd,
 	int err;
 	int i;
 
-	if (length < PAGE_SIZE || !is_power_of_2(length)) {
+	if (length < PAGE_SIZE || !powerof2(length)) {
 		mana_err(NULL, "gmi size incorrect: %u\n", length);
 		return EINVAL;
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202406240727.45O7RppS044289>