Skip to content

Commit

Permalink
dev/mana: replace power2 function
Browse files Browse the repository at this point in the history
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

(cherry picked from commit a94ed493b50752cee09245fc312c63b00331f217)
  • Loading branch information
Doug Moore authored and fichtner committed Feb 18, 2025
1 parent 59333e8 commit e33a9f9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sys/dev/mana/gdma_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,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;
}
Expand Down

0 comments on commit e33a9f9

Please sign in to comment.