From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB9223C4167; Wed, 30 Sep 2026 18:47:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790794056; cv=none; b=dJ8FrWXLyPg3CP7B3wI/If9Ragl5iyv1VvxN9nwTVjiTAFcd+2+9HYR8e4xUxIgIGrymulT4V6AJ/bdkbNMeG6eyUYiKHrDvOLxDkZW6GTdRLxWdgesX09xmuN3M7OfMp4t9l6kMVM6xcnqJpMwIjLRkMK8pf0fDyjsva4qpJfE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790794056; c=relaxed/simple; bh=KsI5v3tqRYjZwftPjligCvY0TXG0VugvOQzoc+/+Bds=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uRm9Nr+3YXUZlhAVrjHFGe1NNUrfjR5kk8I33NMrL88C3XOxiVP2RSDsR1p3guqTWRB0MoiSB0waLs0+WgA7ZdX/JZW4+Vryvy0zYh0+NqOIEkh8H/U7Ho+54ShslVEC6R4buwbFERBcZu85oZFzVMH7s8jPUdrWe1VOywkjyX4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=a0Uixq2C; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="a0Uixq2C" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 427191F00899; Wed, 30 Sep 2026 18:47:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1790794054; bh=R2AfJu7efLpiaO/Q3tOm3psyJnxR3yKSyNvIUEM5AUw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=a0Uixq2C1tErOEMITjljaQciXkLWe2RU1NJQTBne6H/7u14zxMtLNDzM5xB58R+wG ficIESh9BincepMD1bMJfq2i8nVViZw9xZxM+2Kd1xEfMh1ISJw5XNm+yPhuKKdnle ZSUcgrGtAQWIZvZN12Mys+v8fNWWy4HXA8dPBP7w= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Matt Coster , Yury Norov , Sasha Levin Subject: [PATCH 6.6 0076/1193] bitfield: wire __bf_shf to __builtin_ctzll Date: Wed, 30 Sep 2026 17:12:40 +0200 Message-ID: <20260930152435.948025469@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260930152434.301151190@linuxfoundation.org> References: <20260930152434.301151190@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yury Norov [ Upstream commit 09472f591aa0b72c2dd6c693f48b2d6fea66c7ba ] __bf_shf() is currently based on built-in ffsll. It's more straightforward to wire it to __builtin_ctzll, which makes it a pure rename. Worth to notice that __builtin_ffsll() is buggy on GCC before 14.1: int main() { sizeof(struct { int t : !(__builtin_ffsll(~0ULL) + 1 < 0); }); } test.c: In function 'main': test.c:3:21: error: bit-field 't' width not an integer constant 3 | int t : !(__builtin_ffsll(~0ULL) + 1 < 0); | ^ Link: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124699 Reported-by: Matt Coster Closes: https://lore.kernel.org/oe-kbuild-all/202603222211.A2XiR1YU-lkp@intel.com/ Signed-off-by: Yury Norov Signed-off-by: Sasha Levin --- include/linux/bitfield.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/bitfield.h b/include/linux/bitfield.h index ebfa12f695012..87eb3a210bc20 100644 --- a/include/linux/bitfield.h +++ b/include/linux/bitfield.h @@ -42,7 +42,7 @@ * reg |= FIELD_PREP(REG_FIELD_C, c); */ -#define __bf_shf(x) (__builtin_ffsll(x) - 1) +#define __bf_shf __builtin_ctzll #define __scalar_type_to_unsigned_cases(type) \ unsigned type: (unsigned type)0, \ -- 2.53.0