Skip to content

Commit 6bd55f0

Browse files
michalsimekMichal Simek
authored andcommitted
microblaze: Fix coding style issues
Fix coding style issues reported by checkpatch.pl. Signed-off-by: Michal Simek <monstr@monstr.eu>
1 parent 5b3084b commit 6bd55f0

32 files changed

Lines changed: 259 additions & 294 deletions

‎arch/microblaze/include/asm/io.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ static inline void writel(unsigned int v, volatile void __iomem *addr)
150150
#define page_to_bus(page) (page_to_phys(page))
151151
#define bus_to_virt(addr) (phys_to_virt(addr))
152152

153-
extern void iounmap(void *addr);
153+
extern void iounmap(void __iomem *addr);
154154
/*extern void *__ioremap(phys_addr_t address, unsigned long size,
155155
unsigned long flags);*/
156156
extern void __iomem *ioremap(phys_addr_t address, unsigned long size);

‎arch/microblaze/kernel/cpu/cache.c‎

Lines changed: 68 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -17,82 +17,70 @@
1717

1818
static inline void __enable_icache_msr(void)
1919
{
20-
__asm__ __volatile__ (" msrset r0, %0; \
21-
nop; " \
20+
__asm__ __volatile__ (" msrset r0, %0;" \
21+
"nop;" \
2222
: : "i" (MSR_ICE) : "memory");
2323
}
2424

2525
static inline void __disable_icache_msr(void)
2626
{
27-
__asm__ __volatile__ (" msrclr r0, %0; \
28-
nop; " \
27+
__asm__ __volatile__ (" msrclr r0, %0;" \
28+
"nop;" \
2929
: : "i" (MSR_ICE) : "memory");
3030
}
3131

3232
static inline void __enable_dcache_msr(void)
3333
{
34-
__asm__ __volatile__ (" msrset r0, %0; \
35-
nop; " \
36-
: \
37-
: "i" (MSR_DCE) \
38-
: "memory");
34+
__asm__ __volatile__ (" msrset r0, %0;" \
35+
"nop;" \
36+
: : "i" (MSR_DCE) : "memory");
3937
}
4038

4139
static inline void __disable_dcache_msr(void)
4240
{
43-
__asm__ __volatile__ (" msrclr r0, %0; \
44-
nop; " \
45-
: \
46-
: "i" (MSR_DCE) \
47-
: "memory");
41+
__asm__ __volatile__ (" msrclr r0, %0;" \
42+
"nop; " \
43+
: : "i" (MSR_DCE) : "memory");
4844
}
4945

5046
static inline void __enable_icache_nomsr(void)
5147
{
52-
__asm__ __volatile__ (" mfs r12, rmsr; \
53-
nop; \
54-
ori r12, r12, %0; \
55-
mts rmsr, r12; \
56-
nop; " \
57-
: \
58-
: "i" (MSR_ICE) \
59-
: "memory", "r12");
48+
__asm__ __volatile__ (" mfs r12, rmsr;" \
49+
"nop;" \
50+
"ori r12, r12, %0;" \
51+
"mts rmsr, r12;" \
52+
"nop;" \
53+
: : "i" (MSR_ICE) : "memory", "r12");
6054
}
6155

6256
static inline void __disable_icache_nomsr(void)
6357
{
64-
__asm__ __volatile__ (" mfs r12, rmsr; \
65-
nop; \
66-
andi r12, r12, ~%0; \
67-
mts rmsr, r12; \
68-
nop; " \
69-
: \
70-
: "i" (MSR_ICE) \
71-
: "memory", "r12");
58+
__asm__ __volatile__ (" mfs r12, rmsr;" \
59+
"nop;" \
60+
"andi r12, r12, ~%0;" \
61+
"mts rmsr, r12;" \
62+
"nop;" \
63+
: : "i" (MSR_ICE) : "memory", "r12");
7264
}
7365

7466
static inline void __enable_dcache_nomsr(void)
7567
{
76-
__asm__ __volatile__ (" mfs r12, rmsr; \
77-
nop; \
78-
ori r12, r12, %0; \
79-
mts rmsr, r12; \
80-
nop; " \
81-
: \
82-
: "i" (MSR_DCE) \
83-
: "memory", "r12");
68+
__asm__ __volatile__ (" mfs r12, rmsr;" \
69+
"nop;" \
70+
"ori r12, r12, %0;" \
71+
"mts rmsr, r12;" \
72+
"nop;" \
73+
: : "i" (MSR_DCE) : "memory", "r12");
8474
}
8575

8676
static inline void __disable_dcache_nomsr(void)
8777
{
88-
__asm__ __volatile__ (" mfs r12, rmsr; \
89-
nop; \
90-
andi r12, r12, ~%0; \
91-
mts rmsr, r12; \
92-
nop; " \
93-
: \
94-
: "i" (MSR_DCE) \
95-
: "memory", "r12");
78+
__asm__ __volatile__ (" mfs r12, rmsr;" \
79+
"nop;" \
80+
"andi r12, r12, ~%0;" \
81+
"mts rmsr, r12;" \
82+
"nop;" \
83+
: : "i" (MSR_DCE) : "memory", "r12");
9684
}
9785

9886

@@ -106,7 +94,7 @@ do { \
10694
int align = ~(cache_line_length - 1); \
10795
end = min(start + cache_size, end); \
10896
start &= align; \
109-
} while (0);
97+
} while (0)
11098

11199
/*
112100
* Helper macro to loop over the specified cache_size/line_length and
@@ -118,12 +106,12 @@ do { \
118106
int step = -line_length; \
119107
WARN_ON(step >= 0); \
120108
\
121-
__asm__ __volatile__ (" 1: " #op " %0, r0; \
122-
bgtid %0, 1b; \
123-
addk %0, %0, %1; \
124-
" : : "r" (len), "r" (step) \
109+
__asm__ __volatile__ (" 1: " #op " %0, r0;" \
110+
"bgtid %0, 1b;" \
111+
"addk %0, %0, %1;" \
112+
: : "r" (len), "r" (step) \
125113
: "memory"); \
126-
} while (0);
114+
} while (0)
127115

128116
/* Used for wdc.flush/clear which can use rB for offset which is not possible
129117
* to use for simple wdc or wic.
@@ -142,12 +130,12 @@ do { \
142130
count = end - start; \
143131
WARN_ON(count < 0); \
144132
\
145-
__asm__ __volatile__ (" 1: " #op " %0, %1; \
146-
bgtid %1, 1b; \
147-
addk %1, %1, %2; \
148-
" : : "r" (start), "r" (count), \
133+
__asm__ __volatile__ (" 1: " #op " %0, %1;" \
134+
"bgtid %1, 1b;" \
135+
"addk %1, %1, %2;" \
136+
: : "r" (start), "r" (count), \
149137
"r" (step) : "memory"); \
150-
} while (0);
138+
} while (0)
151139

152140
/* It is used only first parameter for OP - for wic, wdc */
153141
#define CACHE_RANGE_LOOP_1(start, end, line_length, op) \
@@ -157,13 +145,13 @@ do { \
157145
end = ((end & align) == end) ? end - line_length : end & align; \
158146
WARN_ON(end - start < 0); \
159147
\
160-
__asm__ __volatile__ (" 1: " #op " %1, r0; \
161-
cmpu %0, %1, %2; \
162-
bgtid %0, 1b; \
163-
addk %1, %1, %3; \
164-
" : : "r" (temp), "r" (start), "r" (end),\
148+
__asm__ __volatile__ (" 1: " #op " %1, r0;" \
149+
"cmpu %0, %1, %2;" \
150+
"bgtid %0, 1b;" \
151+
"addk %1, %1, %3;" \
152+
: : "r" (temp), "r" (start), "r" (end), \
165153
"r" (line_length) : "memory"); \
166-
} while (0);
154+
} while (0)
167155

168156
#define ASM_LOOP
169157

@@ -352,7 +340,7 @@ static void __invalidate_dcache_all_noirq_wt(void)
352340
#endif
353341
pr_debug("%s\n", __func__);
354342
#ifdef ASM_LOOP
355-
CACHE_ALL_LOOP(cpuinfo.dcache_size, cpuinfo.dcache_line_length, wdc)
343+
CACHE_ALL_LOOP(cpuinfo.dcache_size, cpuinfo.dcache_line_length, wdc);
356344
#else
357345
for (i = 0; i < cpuinfo.dcache_size;
358346
i += cpuinfo.dcache_line_length)
@@ -361,7 +349,8 @@ static void __invalidate_dcache_all_noirq_wt(void)
361349
#endif
362350
}
363351

364-
/* FIXME It is blindly invalidation as is expected
352+
/*
353+
* FIXME It is blindly invalidation as is expected
365354
* but can't be called on noMMU in microblaze_cache_init below
366355
*
367356
* MS: noMMU kernel won't boot if simple wdc is used
@@ -375,7 +364,7 @@ static void __invalidate_dcache_all_wb(void)
375364
pr_debug("%s\n", __func__);
376365
#ifdef ASM_LOOP
377366
CACHE_ALL_LOOP(cpuinfo.dcache_size, cpuinfo.dcache_line_length,
378-
wdc)
367+
wdc);
379368
#else
380369
for (i = 0; i < cpuinfo.dcache_size;
381370
i += cpuinfo.dcache_line_length)
@@ -616,49 +605,48 @@ static const struct scache wt_nomsr_noirq = {
616605
#define CPUVER_7_20_A 0x0c
617606
#define CPUVER_7_20_D 0x0f
618607

619-
#define INFO(s) printk(KERN_INFO "cache: " s "\n");
620-
621608
void microblaze_cache_init(void)
622609
{
623610
if (cpuinfo.use_instr & PVR2_USE_MSR_INSTR) {
624611
if (cpuinfo.dcache_wb) {
625-
INFO("wb_msr");
612+
pr_info("wb_msr\n");
626613
mbc = (struct scache *)&wb_msr;
627614
if (cpuinfo.ver_code <= CPUVER_7_20_D) {
628615
/* MS: problem with signal handling - hw bug */
629-
INFO("WB won't work properly");
616+
pr_info("WB won't work properly\n");
630617
}
631618
} else {
632619
if (cpuinfo.ver_code >= CPUVER_7_20_A) {
633-
INFO("wt_msr_noirq");
620+
pr_info("wt_msr_noirq\n");
634621
mbc = (struct scache *)&wt_msr_noirq;
635622
} else {
636-
INFO("wt_msr");
623+
pr_info("wt_msr\n");
637624
mbc = (struct scache *)&wt_msr;
638625
}
639626
}
640627
} else {
641628
if (cpuinfo.dcache_wb) {
642-
INFO("wb_nomsr");
629+
pr_info("wb_nomsr\n");
643630
mbc = (struct scache *)&wb_nomsr;
644631
if (cpuinfo.ver_code <= CPUVER_7_20_D) {
645632
/* MS: problem with signal handling - hw bug */
646-
INFO("WB won't work properly");
633+
pr_info("WB won't work properly\n");
647634
}
648635
} else {
649636
if (cpuinfo.ver_code >= CPUVER_7_20_A) {
650-
INFO("wt_nomsr_noirq");
637+
pr_info("wt_nomsr_noirq\n");
651638
mbc = (struct scache *)&wt_nomsr_noirq;
652639
} else {
653-
INFO("wt_nomsr");
640+
pr_info("wt_nomsr\n");
654641
mbc = (struct scache *)&wt_nomsr;
655642
}
656643
}
657644
}
658-
/* FIXME Invalidation is done in U-BOOT
659-
* WT cache: Data is already written to main memory
660-
* WB cache: Discard data on noMMU which caused that kernel doesn't boot
661-
*/
645+
/*
646+
* FIXME Invalidation is done in U-BOOT
647+
* WT cache: Data is already written to main memory
648+
* WB cache: Discard data on noMMU which caused that kernel doesn't boot
649+
*/
662650
/* invalidate_dcache(); */
663651
enable_dcache();
664652

‎arch/microblaze/kernel/cpu/cpuinfo-pvr-full.c‎

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
early_printk("ERROR: Microblaze " x "-different for PVR and DTS\n");
2828
#else
2929
#define err_printk(x) \
30-
printk(KERN_INFO "ERROR: Microblaze " x "-different for PVR and DTS\n");
30+
pr_info("ERROR: Microblaze " x "-different for PVR and DTS\n");
3131
#endif
3232

3333
void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu)
@@ -38,12 +38,11 @@ void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu)
3838

3939
CI(ver_code, VERSION);
4040
if (!ci->ver_code) {
41-
printk(KERN_ERR "ERROR: MB has broken PVR regs "
42-
"-> use DTS setting\n");
41+
pr_err("ERROR: MB has broken PVR regs -> use DTS setting\n");
4342
return;
4443
}
4544

46-
temp = PVR_USE_BARREL(pvr) | PVR_USE_MSR_INSTR(pvr) |\
45+
temp = PVR_USE_BARREL(pvr) | PVR_USE_MSR_INSTR(pvr) |
4746
PVR_USE_PCMP_INSTR(pvr) | PVR_USE_DIV(pvr);
4847
if (ci->use_instr != temp)
4948
err_printk("BARREL, MSR, PCMP or DIV");
@@ -59,13 +58,13 @@ void set_cpuinfo_pvr_full(struct cpuinfo *ci, struct device_node *cpu)
5958
err_printk("HW_FPU");
6059
ci->use_fpu = temp;
6160

62-
ci->use_exc = PVR_OPCODE_0x0_ILLEGAL(pvr) |\
63-
PVR_UNALIGNED_EXCEPTION(pvr) |\
64-
PVR_ILL_OPCODE_EXCEPTION(pvr) |\
65-
PVR_IOPB_BUS_EXCEPTION(pvr) |\
66-
PVR_DOPB_BUS_EXCEPTION(pvr) |\
67-
PVR_DIV_ZERO_EXCEPTION(pvr) |\
68-
PVR_FPU_EXCEPTION(pvr) |\
61+
ci->use_exc = PVR_OPCODE_0x0_ILLEGAL(pvr) |
62+
PVR_UNALIGNED_EXCEPTION(pvr) |
63+
PVR_ILL_OPCODE_EXCEPTION(pvr) |
64+
PVR_IOPB_BUS_EXCEPTION(pvr) |
65+
PVR_DOPB_BUS_EXCEPTION(pvr) |
66+
PVR_DIV_ZERO_EXCEPTION(pvr) |
67+
PVR_FPU_EXCEPTION(pvr) |
6968
PVR_FSL_EXCEPTION(pvr);
7069

7170
CI(pvr_user1, USER1);

‎arch/microblaze/kernel/cpu/cpuinfo.c‎

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,31 +68,30 @@ void __init setup_cpuinfo(void)
6868

6969
cpu = (struct device_node *) of_find_node_by_type(NULL, "cpu");
7070
if (!cpu)
71-
printk(KERN_ERR "You don't have cpu!!!\n");
71+
pr_err("You don't have cpu!!!\n");
7272

73-
printk(KERN_INFO "%s: initialising\n", __func__);
73+
pr_info("%s: initialising\n", __func__);
7474

7575
switch (cpu_has_pvr()) {
7676
case 0:
77-
printk(KERN_WARNING
78-
"%s: No PVR support. Using static CPU info from FDT\n",
77+
pr_warn("%s: No PVR support. Using static CPU info from FDT\n",
7978
__func__);
8079
set_cpuinfo_static(&cpuinfo, cpu);
8180
break;
8281
/* FIXME I found weird behavior with MB 7.00.a/b 7.10.a
8382
* please do not use FULL PVR with MMU */
8483
case 1:
85-
printk(KERN_INFO "%s: Using full CPU PVR support\n",
84+
pr_info("%s: Using full CPU PVR support\n",
8685
__func__);
8786
set_cpuinfo_static(&cpuinfo, cpu);
8887
set_cpuinfo_pvr_full(&cpuinfo, cpu);
8988
break;
9089
default:
91-
printk(KERN_WARNING "%s: Unsupported PVR setting\n", __func__);
90+
pr_warn("%s: Unsupported PVR setting\n", __func__);
9291
set_cpuinfo_static(&cpuinfo, cpu);
9392
}
9493

9594
if (cpuinfo.mmu_privins)
96-
printk(KERN_WARNING "%s: Stream instructions enabled"
95+
pr_warn("%s: Stream instructions enabled"
9796
" - USERSPACE CAN LOCK THIS KERNEL!\n", __func__);
9897
}

‎arch/microblaze/kernel/cpu/pvr.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
tmp = 0x0; /* Prevent warning about unused */ \
2828
__asm__ __volatile__ ( \
2929
"mfs %0, rpvr" #pvrid ";" \
30-
: "=r" (tmp) : : "memory"); \
30+
: "=r" (tmp) : : "memory"); \
3131
val = tmp; \
3232
}
3333

‎arch/microblaze/kernel/dma.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#include <linux/gfp.h>
1212
#include <linux/dma-debug.h>
1313
#include <linux/export.h>
14-
#include <asm/bug.h>
14+
#include <linux/bug.h>
1515

1616
/*
1717
* Generic direct DMA implementation
@@ -197,8 +197,8 @@ EXPORT_SYMBOL(dma_direct_ops);
197197

198198
static int __init dma_init(void)
199199
{
200-
dma_debug_init(PREALLOC_DMA_DEBUG_ENTRIES);
200+
dma_debug_init(PREALLOC_DMA_DEBUG_ENTRIES);
201201

202-
return 0;
202+
return 0;
203203
}
204204
fs_initcall(dma_init);

0 commit comments

Comments
 (0)