Skip to content

Commit e53f960

Browse files
authored
Merge pull request #12 from Rust-for-Linux/patch-inline-always
Add patch to fix the CI with cg_gcc
2 parents 9e4ed20 + c43b055 commit e53f960

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

.github/workflows/ci.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ jobs:
9393
# TODO: remove if this patch is indeed not necessary. (It seems the patch is now included upstream.)
9494
# - run: git -C linux apply ../ci/x86-boot-Use-std-gnu11-to-fix-build-with-GCC-15.patch
9595

96+
# TODO: remove when fixed in the above branch.
97+
- run: git -C linux apply ../ci/0001-Use-inline-always-for-bit_T-functions.patch
98+
9699
# Setup: `busybox`.
97100
- run: |
98101
git clone --depth 1 -b 1_30_1 https://git.busybox.net/busybox/
@@ -261,7 +264,8 @@ jobs:
261264
- run: make -C linux ${{ env.MAKE_ARCH }} ${{ env.MAKE_CROSS_COMPILE }} ${{ env.MAKE_TOOLCHAIN }} ${{ env.MAKE_OUTPUT }} ${{ env.MAKE_KRUSTFLAGS }} ${{ env.JOBS }} rusttest
262265

263266
# Check formatting.
264-
- run: make -C linux ${{ env.MAKE_ARCH }} ${{ env.MAKE_CROSS_COMPILE }} ${{ env.MAKE_TOOLCHAIN }} ${{ env.MAKE_OUTPUT }} ${{ env.MAKE_KRUSTFLAGS }} ${{ env.JOBS }} rustfmtcheck
267+
# TODO: re-enable when fixed upstream.
268+
#- run: make -C linux ${{ env.MAKE_ARCH }} ${{ env.MAKE_CROSS_COMPILE }} ${{ env.MAKE_TOOLCHAIN }} ${{ env.MAKE_OUTPUT }} ${{ env.MAKE_KRUSTFLAGS }} ${{ env.JOBS }} rustfmtcheck
265269

266270
# Test single targets.
267271
- run: |
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From 826b2b4116d7d204132a2ec1afd2fcb57061994c Mon Sep 17 00:00:00 2001
2+
From: Antoni Boucher <bouanto@zoho.com>
3+
Date: Fri, 5 Dec 2025 07:51:25 -0500
4+
Subject: [PATCH] Use #[inline(always)] for bit_T functions
5+
6+
---
7+
rust/kernel/bits.rs | 2 +-
8+
1 file changed, 1 insertion(+), 1 deletion(-)
9+
10+
diff --git a/rust/kernel/bits.rs b/rust/kernel/bits.rs
11+
index 553d50265883..d39aed20bc6f 100644
12+
--- a/rust/kernel/bits.rs
13+
+++ b/rust/kernel/bits.rs
14+
@@ -27,7 +27,7 @@ pub fn [<checked_bit_ $ty>](n: u32) -> Option<$ty> {
15+
///
16+
/// This version is the default and should be used if `n` is known at
17+
/// compile time.
18+
- #[inline]
19+
+ #[inline(always)]
20+
pub const fn [<bit_ $ty>](n: u32) -> $ty {
21+
build_assert!(n < <$ty>::BITS);
22+
(1 as $ty) << n
23+
--
24+
2.52.0
25+

0 commit comments

Comments
 (0)