Skip to content

Commit

Permalink
Merge pull request torvalds#187 from ojeda/print
Browse files Browse the repository at this point in the history
Remove non-prefixed printing macros
  • Loading branch information
alex authored Apr 13, 2021
2 parents 1fa10de + 03c913f commit 48069b3
Show file tree
Hide file tree
Showing 17 changed files with 98 additions and 409 deletions.
60 changes: 21 additions & 39 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -216,45 +216,27 @@ jobs:
grep '] rust_minimal: Rust minimal sample (exit)$' qemu-stdout.log
- run: |
grep '] rust_print: Rust printing macros sample (init)$' qemu-stdout.log
grep '] rust_print: Emergency message (level 0) with newline w/o args$' qemu-stdout.log
grep '] rust_print: Alert message (level 1) with newline w/o args$' qemu-stdout.log
grep '] rust_print: Critical message (level 2) with newline w/o args$' qemu-stdout.log
grep '] rust_print: Error message (level 3) with newline w/o args$' qemu-stdout.log
grep '] rust_print: Warning message (level 4) with newline w/o args$' qemu-stdout.log
grep '] rust_print: Notice message (level 5) with newline w/o args$' qemu-stdout.log
grep '] rust_print: Info message (level 6) with newline w/o args$' qemu-stdout.log
grep '] rust_print: A line that is continued with newline w/o args$' qemu-stdout.log
grep '] rust_print: Emergency message (level 0) w/o newline w/o args$' qemu-stdout.log
grep '] rust_print: Alert message (level 1) w/o newline w/o args$' qemu-stdout.log
grep '] rust_print: Critical message (level 2) w/o newline w/o args$' qemu-stdout.log
grep '] rust_print: Error message (level 3) w/o newline w/o args$' qemu-stdout.log
grep '] rust_print: Warning message (level 4) w/o newline w/o args$' qemu-stdout.log
grep '] rust_print: Notice message (level 5) w/o newline w/o args$' qemu-stdout.log
grep '] rust_print: Info message (level 6) w/o newline w/o args$' qemu-stdout.log
grep '] rust_print: A line that is continued w/o newline w/o args$' qemu-stdout.log
grep '] rust_print: Emergency message (level 0) with newline with args$' qemu-stdout.log
grep '] rust_print: Alert message (level 1) with newline with args$' qemu-stdout.log
grep '] rust_print: Critical message (level 2) with newline with args$' qemu-stdout.log
grep '] rust_print: Error message (level 3) with newline with args$' qemu-stdout.log
grep '] rust_print: Warning message (level 4) with newline with args$' qemu-stdout.log
grep '] rust_print: Notice message (level 5) with newline with args$' qemu-stdout.log
grep '] rust_print: Info message (level 6) with newline with args$' qemu-stdout.log
grep '] rust_print: A line that is continued with newline with args$' qemu-stdout.log
grep '] rust_print: Emergency message (level 0) w/o newline with args$' qemu-stdout.log
grep '] rust_print: Alert message (level 1) w/o newline with args$' qemu-stdout.log
grep '] rust_print: Critical message (level 2) w/o newline with args$' qemu-stdout.log
grep '] rust_print: Error message (level 3) w/o newline with args$' qemu-stdout.log
grep '] rust_print: Warning message (level 4) w/o newline with args$' qemu-stdout.log
grep '] rust_print: Notice message (level 5) w/o newline with args$' qemu-stdout.log
grep '] rust_print: Info message (level 6) w/o newline with args$' qemu-stdout.log
grep '] rust_print: A line that is continued w/o newline with args$' qemu-stdout.log
grep '] rust_print: Rust printing macros sample (exit)$' qemu-stdout.log
grep '] rust_print: Rust printing macros sample (init)$' qemu-stdout.log
grep '] rust_print: Emergency message (level 0) without args$' qemu-stdout.log
grep '] rust_print: Alert message (level 1) without args$' qemu-stdout.log
grep '] rust_print: Critical message (level 2) without args$' qemu-stdout.log
grep '] rust_print: Error message (level 3) without args$' qemu-stdout.log
grep '] rust_print: Warning message (level 4) without args$' qemu-stdout.log
grep '] rust_print: Notice message (level 5) without args$' qemu-stdout.log
grep '] rust_print: Info message (level 6) without args$' qemu-stdout.log
grep '] rust_print: A line that is continued without args$' qemu-stdout.log
grep '] rust_print: Emergency message (level 0) with args$' qemu-stdout.log
grep '] rust_print: Alert message (level 1) with args$' qemu-stdout.log
grep '] rust_print: Critical message (level 2) with args$' qemu-stdout.log
grep '] rust_print: Error message (level 3) with args$' qemu-stdout.log
grep '] rust_print: Warning message (level 4) with args$' qemu-stdout.log
grep '] rust_print: Notice message (level 5) with args$' qemu-stdout.log
grep '] rust_print: Info message (level 6) with args$' qemu-stdout.log
grep '] rust_print: A line that is continued with args$' qemu-stdout.log
grep '] rust_print: Rust printing macros sample (exit)$' qemu-stdout.log
- run: |
grep '] rust_module_parameters: Rust module parameters sample (init)$' qemu-stdout.log
Expand Down
2 changes: 1 addition & 1 deletion drivers/android/allocation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ impl Drop for Allocation<'_> {
let view = AllocationView::new(self, info.offsets.start);
for i in info.offsets.clone().step_by(size_of::<usize>()) {
if self.cleanup_object(i, &view).is_err() {
warn!("Error cleaning up object at offset {}", i)
pr_warn!("Error cleaning up object at offset {}\n", i)
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/android/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ impl Process {
.reservation_abort(ptr - mapping.address)
.is_err()
{
warn!("Offset {} failed to free", ptr - mapping.address);
pr_warn!("Offset {} failed to free\n", ptr - mapping.address);
}
}
}
Expand All @@ -566,7 +566,7 @@ impl Process {
let mut inner = self.inner.lock();
if let Some(ref mut mapping) = &mut inner.mapping {
if mapping.alloc.reservation_commit(offset, data).is_err() {
warn!("Offset {} failed to be marked freeable", offset);
pr_warn!("Offset {} failed to be marked freeable\n", offset);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/android/thread.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ impl Thread {
self.process.get_node_from_handle(handle, strong)
})?;
}
_ => warn!("Unsupported binder object type: {:x}", header.type_),
_ => pr_warn!("Unsupported binder object type: {:x}\n", header.type_),
}
Ok(())
}
Expand Down
4 changes: 2 additions & 2 deletions rust/kernel/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ impl<'a> Drop for KParamGuard<'a> {
///
/// fn test() {
/// // This prints `8`.
/// info!("{}", offset_of!(Test, b));
/// pr_info!("{}\n", offset_of!(Test, b));
/// }
/// ```
#[macro_export]
Expand Down Expand Up @@ -181,7 +181,7 @@ macro_rules! offset_of {
/// let b_ptr = &test.b;
/// let test_alias = unsafe { container_of!(b_ptr, Test, b) };
/// // This prints `true`.
/// info!("{}", core::ptr::eq(&test, test_alias));
/// pr_info!("{}\n", core::ptr::eq(&test, test_alias));
/// }
/// ```
#[macro_export]
Expand Down
1 change: 0 additions & 1 deletion rust/kernel/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ pub use alloc::{borrow::ToOwned, string::String};

pub use module::module;

pub use super::{alert, cont, crit, emerg, err, info, notice, warn};
pub use super::{pr_alert, pr_cont, pr_crit, pr_emerg, pr_err, pr_info, pr_notice, pr_warn};

pub use super::static_assert;
Expand Down
Loading

0 comments on commit 48069b3

Please sign in to comment.