pwm: fix Rust formatting
Subsystems (5)
Miguel Ojeda
maintainerPATCH 1/1 pwm: fix Rust formatting
We do our best to keep the repository rustfmt-clean [1], thus run the tool to fix the formatting issue.
A trailing empty comment [2] is added in order to preserve the wanted style for imports (otherwise the tool will compact the first two items).
---
If you usually rebase your tree, please feel free to do so instead. Thanks!
drivers/pwm/pwm_th1520.rs | 15 ++++++++++--- rust/kernel/lib.rs | 4 ++-- rust/kernel/pwm.rs | 46 +++++++++++++++++++++------------------ 3 files changed, 39 insertions(+), 26 deletions(-)
drivers/pwm/pwm_th1520.rs +12 -3
@@ -200,7 +200,10 @@ fn round_waveform_fromhw(let rate_hz = data.clk.rate ().as_hz ()as u64 ;if wfhw.period_cycles ==0 { -dev_dbg! (chip.device (),"HW state has zero period, reporting as disabled.\n" ); +dev_dbg! ( + chip.device (), +"HW state has zero period, reporting as disabled.\n" + ); *wf = pwm::Waveform ::default ();return Ok (()); }
@@ -277,7 +280,10 @@ fn write_waveform(if was_enabled { iomap.try_write32 (wfhw.ctrl_val,th1520_pwm_ctrl (hwpwm))?; iomap.try_write32 (0 ,th1520_pwm_fp (hwpwm))?; - iomap.try_write32 (wfhw.ctrl_val |TH1520_PWM_CFG_UPDATE ,th1520_pwm_ctrl (hwpwm))?; + iomap.try_write32 ( + wfhw.ctrl_val |TH1520_PWM_CFG_UPDATE , +th1520_pwm_ctrl (hwpwm), + )?; }return Ok (()); }
@@ -285,7 +291,10 @@ fn write_waveform( iomap.try_write32 (wfhw.ctrl_val,th1520_pwm_ctrl (hwpwm))?; iomap.try_write32 (wfhw.period_cycles,th1520_pwm_per (hwpwm))?; iomap.try_write32 (wfhw.duty_cycles,th1520_pwm_fp (hwpwm))?; - iomap.try_write32 (wfhw.ctrl_val |TH1520_PWM_CFG_UPDATE ,th1520_pwm_ctrl (hwpwm))?; + iomap.try_write32 ( + wfhw.ctrl_val |TH1520_PWM_CFG_UPDATE , +th1520_pwm_ctrl (hwpwm), + )?;// The `TH1520_PWM_START` bit must be written in a separate, final transaction, and // only when enabling the channel from a disabled state.
rust/kernel/lib.rs +2 -2
@@ -121,6 +121,8 @@pub mod print;pub mod processor;pub mod ptr; +#[cfg( CONFIG_RUST_PWM_ABSTRACTIONS )] +pub mod pwm;pub mod rbtree;pub mod regulator;pub mod revocable;
@@ -129,8 +131,6 @@pub mod seq_file;pub mod sizes;mod static_assert; -#[cfg( CONFIG_RUST_PWM_ABSTRACTIONS )] -pub mod pwm;#[doc(hidden)] pub mod std_vendor;pub mod str;
rust/kernel/pwm.rs +25 -21
109 lines not on this page · raw message
base-commit: 04a698c800c25149f9aa379250e78f737adeb3f1 --
2.51.2
Hello,
Quoted 6 lines · Miguel Ojeda
We do our best to keep the repository
rustfmt-clean [1], thus run the tool to fix the formatting issue.A trailing empty comment [2] is added in order to preserve the wanted style for imports (otherwise the tool will compact the first two items).
Quoted 6 lines
Fixes a3d5a2b8da94 ("rust: pwm: Add complete abstraction layer")Fixes 121931a7b4dc ("rust: pwm: Add Kconfig and basic data structures")Fixes fb3957af9ec6 ("pwm: Add Rust driver for T-HEAD TH1520 SoC")Signed-off-by Miguel Ojeda <[email protected]>
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/ukleinek/linux.git pwm/for-next .
Thanks!
Uwe