Skip to content

Commit 61104a0

Browse files
authored
Merge pull request torvalds#847 from ojeda/cleanups
treewide: cleanups and clarifications
2 parents 5f48fa8 + ecd8e1f commit 61104a0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+206
-131
lines changed

Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,8 +1716,9 @@ help:
17161716
@echo ' rust-analyzer - Generate rust-project.json rust-analyzer support file'
17171717
@echo ' (requires kernel .config)'
17181718
@echo ' dir/file.[os] - Build specified target only'
1719-
@echo ' dir/file.rsi - Build macro expanded source, similar to C preprocessing'
1720-
@echo ' (run with RUSTFMT=n to skip reformatting if needed)'
1719+
@echo ' dir/file.rsi - Build macro expanded source, similar to C preprocessing.'
1720+
@echo ' Run with RUSTFMT=n to skip reformatting if needed.'
1721+
@echo ' The output is not intended to be compilable.'
17211722
@echo ' dir/file.ll - Build the LLVM assembly file'
17221723
@echo ''
17231724
@$(if $(dtstree), \

drivers/android/transaction.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,10 @@ impl Transaction {
196196

197197
impl DeliverToRead for Transaction {
198198
fn do_work(self: Ref<Self>, thread: &Thread, writer: &mut UserSlicePtrWriter) -> Result<bool> {
199-
/* TODO: Initialise the following fields from tr:
200-
pub sender_pid: pid_t,
201-
pub sender_euid: uid_t,
202-
*/
199+
// TODO: Initialise the following fields from `tr`:
200+
// - `pub sender_pid: pid_t`.
201+
// - `pub sender_euid: uid_t`.
202+
203203
let send_failed_reply = ScopeGuard::new(|| {
204204
if self.node_ref.is_some() && self.flags & TF_ONE_WAY == 0 {
205205
let reply = Either::Right(BR_FAILED_REPLY);

include/linux/compiler_types.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
#ifndef __ASSEMBLY__
66

7+
/*
8+
* Skipped when running bindgen due to a libclang issue;
9+
* see https://github.com/rust-lang/rust-bindgen/issues/2244.
10+
*/
711
#if defined(CONFIG_DEBUG_INFO_BTF) && defined(CONFIG_PAHOLE_HAS_BTF_TAG) && \
812
__has_attribute(btf_type_tag) && !defined(__BINDGEN__)
913
# define BTF_TYPE_TAG(value) __attribute__((btf_type_tag(#value)))

include/linux/spinlock.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -338,11 +338,11 @@ static inline void __spin_lock_init(spinlock_t *lock, const char *name,
338338
__raw_spin_lock_init(spinlock_check(lock), name, key, LD_WAIT_CONFIG);
339339
}
340340

341-
# define spin_lock_init(lock) \
342-
do { \
343-
static struct lock_class_key __key; \
344-
\
345-
__spin_lock_init(lock, #lock, &__key); \
341+
# define spin_lock_init(lock) \
342+
do { \
343+
static struct lock_class_key __key; \
344+
\
345+
__spin_lock_init(lock, #lock, &__key); \
346346
} while (0)
347347

348348
#else

rust/alloc/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# `alloc`
22

33
These source files come from the Rust standard library, hosted in
4-
the https://github.com/rust-lang/rust repository, licensed under
4+
the <https://github.com/rust-lang/rust> repository, licensed under
55
"Apache-2.0 OR MIT" and adapted for kernel use. For copyright details,
6-
see https://github.com/rust-lang/rust/blob/master/COPYRIGHT.
6+
see <https://github.com/rust-lang/rust/blob/master/COPYRIGHT>.
77

88
Please note that these files should be kept as close as possible to
99
upstream. In general, only additions should be performed (e.g. new

rust/alloc/boxed/thin.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: Apache-2.0 OR MIT
2+
13
// Based on
24
// https://github.com/matthieu-m/rfc2580/blob/b58d1d3cba0d4b5e859d3617ea2d0943aaa31329/examples/thin.rs
35
// by matthieu-m

rust/alloc/ffi/c_str.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: Apache-2.0 OR MIT
2+
13
#[cfg(test)]
24
mod tests;
35

rust/alloc/ffi/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// SPDX-License-Identifier: Apache-2.0 OR MIT
2+
13
//! Utilities related to FFI bindings.
24
//!
35
//! This module provides utilities to handle data across non-Rust

rust/bindings/bindings_helper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <linux/errname.h>
1414
#include <linux/file.h>
1515
#include <linux/fs.h>
16+
#include <linux/fs_parser.h>
1617
#include <linux/gpio/driver.h>
1718
#include <linux/hw_random.h>
1819
#include <linux/interrupt.h>
@@ -36,7 +37,6 @@
3637
#include <linux/uaccess.h>
3738
#include <linux/uio.h>
3839
#include <uapi/linux/android/binder.h>
39-
#include <linux/fs_parser.h>
4040

4141
/* `bindgen` gets confused at certain things. */
4242
const gfp_t BINDINGS_GFP_KERNEL = GFP_KERNEL;

rust/bindings/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
1111
#![no_std]
1212
#![feature(core_ffi_c)]
13-
// See https://github.com/rust-lang/rust-bindgen/issues/1651.
13+
// See <https://github.com/rust-lang/rust-bindgen/issues/1651>.
1414
#![cfg_attr(test, allow(deref_nullptr))]
1515
#![cfg_attr(test, allow(unaligned_references))]
1616
#![cfg_attr(test, allow(unsafe_op_in_unsafe_fn))]

0 commit comments

Comments
 (0)