Commit 0bd2f269 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull rust fixes from Miguel Ojeda:
 "Toolchain and infrastructure:

   - Fix missing KASAN LLVM flags on first build (and fix spurious
     rebuilds) by skipping '--target'

   - Fix Make < 4.3 build error by using '$(pound)'

   - Fix UML build error by removing 'volatile' qualifier from io
     helpers

   - Fix UML build error by adding 'dma_{alloc,free}_attrs()' helpers

   - Clean gendwarfksyms warnings by avoiding to export '__pfx' symbols

   - Clean objtool warning by adding a new 'noreturn' function for
     1.86.0

   - Disable 'needless_continue' Clippy lint due to new 1.86.0 warnings

   - Add missing 'ffi' crate to 'generate_rust_analyzer.py'

  'pin-init' crate:

   - Import a couple fixes from upstream"

* tag 'rust-fixes-6.15' of git://git.kernel.org/pub/scm/linux/kernel/git/ojeda/linux:
  rust: helpers: Add dma_alloc_attrs() and dma_free_attrs()
  rust: helpers: Remove volatile qualifier from io helpers
  rust: kbuild: use `pound` to support GNU Make < 4.3
  objtool/rust: add one more `noreturn` Rust function for Rust 1.86.0
  rust: kasan/kbuild: fix missing flags on first build
  rust: disable `clippy::needless_continue`
  rust: kbuild: Don't export __pfx symbols
  rust: pin-init: use Markdown autolinks in Rust comments
  rust: pin-init: alloc: restrict `impl ZeroableOption` for `Box` to `T: Sized`
  scripts: generate_rust_analyzer: Add ffi crate
parents 51c7960b c1b4071e
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -7021,6 +7021,7 @@ L: rust-for-linux@vger.kernel.org
S:	Supported
W:	https://rust-for-linux.com
T:	git https://github.com/Rust-for-Linux/linux.git alloc-next
F:	rust/helpers/dma.c
F:	rust/kernel/dma.rs
F:	samples/rust/rust_dma.rs
+0 −1
Original line number Diff line number Diff line
@@ -477,7 +477,6 @@ export rust_common_flags := --edition=2021 \
			    -Wclippy::ignored_unit_patterns \
			    -Wclippy::mut_mut \
			    -Wclippy::needless_bitwise_bool \
			    -Wclippy::needless_continue \
			    -Aclippy::needless_lifetimes \
			    -Wclippy::no_mangle_with_rust_abi \
			    -Wclippy::undocumented_unsafe_blocks \
+1 −1
Original line number Diff line number Diff line
@@ -368,7 +368,7 @@ $(obj)/bindings/bindings_helpers_generated.rs: private bindgen_target_extra = ;
$(obj)/bindings/bindings_helpers_generated.rs: $(src)/helpers/helpers.c FORCE
	$(call if_changed_dep,bindgen)

rust_exports = $(NM) -p --defined-only $(1) | awk '$$2~/(T|R|D|B)/ && $$3!~/__cfi/ && $$3!~/__odr_asan/ { printf $(2),$$3 }'
rust_exports = $(NM) -p --defined-only $(1) | awk '$$2~/(T|R|D|B)/ && $$3!~/__(pfx|cfi|odr_asan)/ { printf $(2),$$3 }'

quiet_cmd_exports = EXPORTS $@
      cmd_exports = \

rust/helpers/dma.c

0 → 100644
+16 −0
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0

#include <linux/dma-mapping.h>

void *rust_helper_dma_alloc_attrs(struct device *dev, size_t size,
				  dma_addr_t *dma_handle, gfp_t flag,
				  unsigned long attrs)
{
	return dma_alloc_attrs(dev, size, dma_handle, flag, attrs);
}

void rust_helper_dma_free_attrs(struct device *dev, size_t size, void *cpu_addr,
				dma_addr_t dma_handle, unsigned long attrs)
{
	dma_free_attrs(dev, size, cpu_addr, dma_handle, attrs);
}
+1 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@
#include "cpumask.c"
#include "cred.c"
#include "device.c"
#include "dma.c"
#include "err.c"
#include "fs.c"
#include "io.c"
Loading