From nobody Sat Sep 28 21:26:50 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 4XGL4p4VPTz5Xs3Q; Sat, 28 Sep 2024 21:26:50 +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 4XGL4p3c2cz40rf; Sat, 28 Sep 2024 21:26:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727558810; 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=UmeHROIHgSeoOvs2/YGNtUxHxttrDD9iVtu6JDTClRo=; b=WzfspCeYOMQZQHaW17gFtT4HhBIufNbRd3xtEV60W9u89CtApxa5+1IRRaOTH/5a4M/78z BXyjT82FrUfJ74xYLXdWQx4kktbCbPXAaj+nX0P6xfAOgBI1CeLSYOH3woMhuJ3rTCHCR4 RDb+6BRIlmCK6hBrkE/pQ52kkijao27NuLQgKLcNHrBxv4JE9ntbt27svRgC+LWpvnpbUx 7OcC2HLoY8Wv9PBdx2L8TzKrI4glCE4jKblVYYCwnmq2Mnkc2D6jCzwDo/nOAtDLExFUFG XlGqAM+nnq2dnZfryjNbEKIcOLVkHirEz2LjhTaQ5rnPZS/zNqv1YN+Z4RvdGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1727558810; 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=UmeHROIHgSeoOvs2/YGNtUxHxttrDD9iVtu6JDTClRo=; b=b25lmp2T4FgzyLHz09lii+d9LbSWgfEzEwDfQCVG9RaqTk+UXUn5qAouWqHikSEM/Xfdgb mrNDDmwXJA2M2nmyKqTId7rjrmK65etkV66RE+1JjIQGZHMJJVGX2xTv+1DJhs6hWTR43V 4FQIQ4Eb00Kmo/mmMPqpru9LNq//ZBYDZNZpeSBaTdL9FDLz2rMIlsLeyZ/6jvw0SODe4O R99GueFJP0JKhTzKclvAn4ZxCqs9OeNiFRvK6DMRvCuoFgeSnV+0d/WVbS1nR0hf/Z0Uxl QbQzGZ3qRyTAEf8CD4kYQe2AlIIPlUnceAjKNJNk12mEhiVnSpHxG0hLkYgB9g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1727558810; a=rsa-sha256; cv=none; b=ypALjhnz9vZP9TJ+RekiQgu1iGidgBEUEhm305tDIuMLNB1ke0hCCRD/5xhXu5J0i59Oqe 48684vejkL5k9BrqpUmhxM7KqQNLPKQZNKeajkg+UdRVAS6HnXcF+CkecHMmsNboLEMQgB 37mlfUrCHonnQ+78xy8lhZe6yoHZ4g5JHUCWGnWcwm6JjMQqY0unK5RYKHVEW8UJWX+L1D D88ax3vcEZvVIZG2O3Fb9z+YdIKUqyyQ/4iDA2SYLIDeNmpIIWf7207I+JzS551RXpXpuo mc1DScJXBBVWe+NotytCMB0Zvbg7oOFy2sEEk8YuTI3gjLfUZNe1I3wEkS6big== 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 4XGL4p3DQzzhWf; Sat, 28 Sep 2024 21:26:50 +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 48SLQo4c000597; Sat, 28 Sep 2024 21:26:50 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 48SLQoDD000594; Sat, 28 Sep 2024 21:26:50 GMT (envelope-from git) Date: Sat, 28 Sep 2024 21:26:50 GMT Message-Id: <202409282126.48SLQoDD000594@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: 3873b9a8b3a5 - main - mlx4: use is_power_of_2 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: dougm X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3873b9a8b3a51731e5db92ab0c5c59797e416015 Auto-Submitted: auto-generated The branch main has been updated by dougm: URL: https://cgit.FreeBSD.org/src/commit/?id=3873b9a8b3a51731e5db92ab0c5c59797e416015 commit 3873b9a8b3a51731e5db92ab0c5c59797e416015 Author: Doug Moore AuthorDate: 2024-09-28 21:23:17 +0000 Commit: Doug Moore CommitDate: 2024-09-28 21:23:17 +0000 mlx4: use is_power_of_2 It's faster to use is_power_of_2 than it is to compute roundup_power_of_two and then compare. So do that. Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D46838 --- sys/dev/mlx4/mlx4_core/mlx4_alloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/mlx4/mlx4_core/mlx4_alloc.c b/sys/dev/mlx4/mlx4_core/mlx4_alloc.c index dcf6204dfc1a..fa68625f5ab9 100644 --- a/sys/dev/mlx4/mlx4_core/mlx4_alloc.c +++ b/sys/dev/mlx4/mlx4_core/mlx4_alloc.c @@ -173,7 +173,7 @@ int mlx4_bitmap_init(struct mlx4_bitmap *bitmap, u32 num, u32 mask, u32 reserved_bot, u32 reserved_top) { /* num must be a power of 2 */ - if (num != roundup_pow_of_two(num)) + if (!is_power_of_2(num)) return -EINVAL; bitmap->last = 0;