Skip to content

Commit 4cf444a

Browse files
committed
rust: helpers: cleanup checkpatch.pl issues
Make the file a bit more `checkpatch.pl`-clean by fixing a couple style issues and replace bad indentation (spaces). Furthermore, re-sort the `#include`s too and prefer `linux/` to `asm/`. Signed-off-by: Miguel Ojeda <[email protected]>
1 parent 96dd938 commit 4cf444a

File tree

1 file changed

+23
-18
lines changed

1 file changed

+23
-18
lines changed

rust/helpers.c

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,26 +18,26 @@
1818
* accidentally exposed.
1919
*/
2020

21+
#include <linux/amba/bus.h>
2122
#include <linux/bug.h>
2223
#include <linux/build_bug.h>
2324
#include <linux/clk.h>
24-
#include <linux/uaccess.h>
25-
#include <linux/sched/signal.h>
25+
#include <linux/errname.h>
2626
#include <linux/gfp.h>
2727
#include <linux/highmem.h>
28-
#include <linux/uio.h>
29-
#include <linux/errname.h>
30-
#include <linux/mutex.h>
31-
#include <linux/platform_device.h>
32-
#include <linux/security.h>
33-
#include <asm/io.h>
34-
#include <linux/irq.h>
28+
#include <linux/io.h>
3529
#include <linux/irqchip/chained_irq.h>
3630
#include <linux/irqdomain.h>
37-
#include <linux/amba/bus.h>
31+
#include <linux/irq.h>
32+
#include <linux/mutex.h>
33+
#include <linux/netdevice.h>
3834
#include <linux/of_device.h>
35+
#include <linux/platform_device.h>
36+
#include <linux/sched/signal.h>
37+
#include <linux/security.h>
3938
#include <linux/skbuff.h>
40-
#include <linux/netdevice.h>
39+
#include <linux/uaccess.h>
40+
#include <linux/uio.h>
4141

4242
__noreturn void rust_helper_BUG(void)
4343
{
@@ -161,26 +161,26 @@ EXPORT_SYMBOL_GPL(rust_helper_readq_relaxed);
161161

162162
void rust_helper_writeb_relaxed(u8 value, volatile void __iomem *addr)
163163
{
164-
writeb_relaxed(value, addr);
164+
writeb_relaxed(value, addr);
165165
}
166166
EXPORT_SYMBOL_GPL(rust_helper_writeb_relaxed);
167167

168168
void rust_helper_writew_relaxed(u16 value, volatile void __iomem *addr)
169169
{
170-
writew_relaxed(value, addr);
170+
writew_relaxed(value, addr);
171171
}
172172
EXPORT_SYMBOL_GPL(rust_helper_writew_relaxed);
173173

174174
void rust_helper_writel_relaxed(u32 value, volatile void __iomem *addr)
175175
{
176-
writel_relaxed(value, addr);
176+
writel_relaxed(value, addr);
177177
}
178178
EXPORT_SYMBOL_GPL(rust_helper_writel_relaxed);
179179

180180
#ifdef CONFIG_64BIT
181181
void rust_helper_writeq_relaxed(u64 value, volatile void __iomem *addr)
182182
{
183-
writeq_relaxed(value, addr);
183+
writeq_relaxed(value, addr);
184184
}
185185
EXPORT_SYMBOL_GPL(rust_helper_writeq_relaxed);
186186
#endif
@@ -217,7 +217,9 @@ EXPORT_SYMBOL_GPL(rust_helper_spin_unlock);
217217
unsigned long rust_helper_spin_lock_irqsave(spinlock_t *lock)
218218
{
219219
unsigned long flags;
220+
220221
spin_lock_irqsave(lock, flags);
222+
221223
return flags;
222224
}
223225
EXPORT_SYMBOL_GPL(rust_helper_spin_lock_irqsave);
@@ -254,7 +256,9 @@ EXPORT_SYMBOL_GPL(rust_helper_raw_spin_unlock);
254256
unsigned long rust_helper_raw_spin_lock_irqsave(raw_spinlock_t *lock)
255257
{
256258
unsigned long flags;
259+
257260
raw_spin_lock_irqsave(lock, flags);
261+
258262
return flags;
259263
}
260264
EXPORT_SYMBOL_GPL(rust_helper_raw_spin_lock_irqsave);
@@ -403,13 +407,13 @@ struct task_struct *rust_helper_get_current(void)
403407
}
404408
EXPORT_SYMBOL_GPL(rust_helper_get_current);
405409

406-
void rust_helper_get_task_struct(struct task_struct * t)
410+
void rust_helper_get_task_struct(struct task_struct *t)
407411
{
408412
get_task_struct(t);
409413
}
410414
EXPORT_SYMBOL_GPL(rust_helper_get_task_struct);
411415

412-
void rust_helper_put_task_struct(struct task_struct * t)
416+
void rust_helper_put_task_struct(struct task_struct *t)
413417
{
414418
put_task_struct(t);
415419
}
@@ -555,7 +559,8 @@ const struct cred *rust_helper_get_cred(const struct cred *cred)
555559
}
556560
EXPORT_SYMBOL_GPL(rust_helper_get_cred);
557561

558-
void rust_helper_put_cred(const struct cred *cred) {
562+
void rust_helper_put_cred(const struct cred *cred)
563+
{
559564
put_cred(cred);
560565
}
561566
EXPORT_SYMBOL_GPL(rust_helper_put_cred);

0 commit comments

Comments
 (0)