arm: mm: Prefer unsigned int to bare use of unsigned
PATCH 1/1 arm: mm: Prefer unsigned int to bare use of unsigned
Fix checkpatch warnings:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
Signed-off-by Jinchao Wang <[email protected]>
--- arch/arm/mm/cache-l2x0.c | 42 +++++++++++++++++++-------------------- arch/arm/mm/dma-mapping.c | 2 +- arch/arm/mm/dump.c | 16 +++++++-------- 3 files changed, 30 insertions(+), 30 deletions(-)
arch/arm/mm/cache-l2x0.c +21 -21
@@ -23,14 +23,14 @@struct l2c_init_data {const char *type; -unsigned way_size_0; -unsigned num_lock; +unsigned int way_size_0; +unsigned int num_lock;void (*of_parse)(const struct device_node *,u32 *,u32 *); -void (*enable)(void __iomem *,unsigned ); +void (*enable)(void __iomem *,unsigned int );void (*fixup)(void __iomem *,u32 ,struct outer_cache_fns *);void (*save)(void __iomem *);void (*configure)(void __iomem *); -void (*unlock)(void __iomem *,unsigned ); +void (*unlock)(void __iomem *,unsigned int );struct outer_cache_fns outer_cache; };
@@ -62,7 +62,7 @@ static inline void l2c_wait_mask(void __iomem *reg, unsigned long mask)* By default, we write directly to secure registers. Platforms must * override this if they are running non-secure. */ -static void l2c_write_sec (unsigned long val,void __iomem *base,unsigned reg) +static void l2c_write_sec (unsigned long val,void __iomem *base,unsigned int reg) {if (val ==readl_relaxed (base + reg))return ;
@@ -88,9 +88,9 @@ static void __l2c_op_way(void __iomem *reg)l2c_wait_mask (reg, l2x0_way_mask); } -static inline void l2c_unlock (void __iomem *base,unsigned num) +static inline void l2c_unlock (void __iomem *base,unsigned int num) { -unsigned i; +unsigned int i;for (i =0 ; i < num; i++) { writel_relaxed(0, base + L2X0_LOCKDOWN_WAY_D_BASE +
@@ -109,7 +109,7 @@ static void l2c_configure(void __iomem *base)* Enable the L2 cache controller. This function must only be * called when the cache controller is known to be disabled. */ -static void l2c_enable (void __iomem *base,unsigned num_lock) +static void l2c_enable (void __iomem *base,unsigned int num_lock) {unsigned long flags;
@@ -271,7 +271,7 @@ static inline void __l2c220_cache_sync(void __iomem *base)l2c_wait_mask (base +L2X0_CACHE_SYNC ,1 ); } -static void l2c220_op_way (void __iomem *base,unsigned reg) +static void l2c220_op_way (void __iomem *base,unsigned int reg) {unsigned long flags;
@@ -383,7 +383,7 @@ static void l2c220_sync(void)raw_spin_unlock_irqrestore (&l2x0_lock, flags); } -static void l2c220_enable (void __iomem *base,unsigned num_lock) +static void l2c220_enable (void __iomem *base,unsigned int num_lock) {/* * Always enable non-secure access to the lockdown registers -
@@ -395,7 +395,7 @@ static void l2c220_enable(void __iomem *base, unsigned num_lock)l2c_enable (base, num_lock); } -static void l2c220_unlock (void __iomem *base,unsigned num_lock) +static void l2c220_unlock (void __iomem *base,unsigned int num_lock) {if (readl_relaxed (base +L2X0_AUX_CTRL ) &L220_AUX_CTRL_NS_LOCKDOWN )l2c_unlock (base, num_lock);
@@ -538,7 +538,7 @@ static void l2c310_flush_all_erratum(void)static void __init l2c310_save (void __iomem *base) { -unsigned revision; +unsigned int revision;l2c_save (base);
@@ -567,7 +567,7 @@ static void __init l2c310_save(void __iomem *base)static void l2c310_configure (void __iomem *base) { -unsigned revision; +unsigned int revision;l2c_configure (base);
@@ -604,9 +604,9 @@ static int l2c310_dying_cpu(unsigned int cpu)return 0 ; } -static void __init l2c310_enable (void __iomem *base,unsigned num_lock) +static void __init l2c310_enable (void __iomem *base,unsigned int num_lock) { -unsigned rev =readl_relaxed (base +L2X0_CACHE_ID ) &L2X0_CACHE_ID_RTL_MASK ; +unsigned int rev =readl_relaxed (base +L2X0_CACHE_ID ) &L2X0_CACHE_ID_RTL_MASK ;bool cortex_a9 =read_cpuid_part () ==ARM_CPU_PART_CORTEX_A9 ;u32 aux = l2x0_saved_regs.aux_ctrl;
@@ -681,9 +681,9 @@ static void __init l2c310_enable(void __iomem *base, unsigned num_lock)static void __init l2c310_fixup (void __iomem *base,u32 cache_id,struct outer_cache_fns *fns) { -unsigned revision = cache_id &L2X0_CACHE_ID_RTL_MASK ; +unsigned int revision = cache_id &L2X0_CACHE_ID_RTL_MASK ;const char *errata[8 ]; -unsigned n =0 ; +unsigned int n =0 ; if (IS_ENABLED(CONFIG_PL310_ERRATA_588369) && revision < L310_CACHE_ID_RTL_R2P0 &&
@@ -721,7 +721,7 @@ static void __init l2c310_fixup(void __iomem *base, u32 cache_id, errata[n++] ="769419" ;if (n) { -unsigned i; +unsigned int i;pr_info ("L2C-310 errat%s" , n >1 ?"a" :"um" );for (i =0 ; i < n; i++)
@@ -751,7 +751,7 @@ static void l2c310_resume(void)set_auxcr (get_auxcr () |BIT (3 ) |BIT (2 ) |BIT (1 )); } -static void l2c310_unlock (void __iomem *base,unsigned num_lock) +static void l2c310_unlock (void __iomem *base,unsigned int num_lock) {if (readl_relaxed (base +L2X0_AUX_CTRL ) &L310_AUX_CTRL_NS_LOCKDOWN )l2c_unlock (base, num_lock);
@@ -781,7 +781,7 @@ static int __init __l2c_init(const struct l2c_init_data *data, u32 aux_val, u32 aux_mask, u32 cache_id, bool nosync) { struct outer_cache_fns fns; -unsigned way_size_bits, ways; +unsigned int way_size_bits, ways;u32 aux, old_aux;/*
@@ -1465,7 +1465,7 @@ static void aurora_save(void __iomem *base)* broadcasting of cache commands to L2. */ static void __init aurora_enable_no_outer (void __iomem *base, -unsigned num_lock) +unsigned int num_lock) {u32 u;
arch/arm/mm/dma-mapping.c +1 -1
@@ -448,7 +448,7 @@ static int __dma_update_pte(pte_t *pte, unsigned long addr, void *data)static void __dma_remap (struct page *page,size_t size,pgprot_t prot) {unsigned long start = (unsigned long )page_address (page); -unsigned end = start + size; +unsigned int end = start + size;apply_to_page_range (&init_mm, start, size, __dma_update_pte, &prot);flush_tlb_kernel_range (start, end);
arch/arm/mm/dump.c +8 -8
@@ -49,7 +49,7 @@ struct pg_state {struct seq_file *seq;const struct addr_marker *marker;unsigned long start_address; -unsigned level; +unsigned int level;u64 current_prot;bool check_wx;unsigned long wx_pages;
@@ -223,7 +223,7 @@ static struct pg_level pg_level[] = {static void dump_prot (struct pg_state *st,const struct prot_bits *bits,size_t num) { -unsigned i; +unsigned int i;for (i =0 ; i < num; i++, bits++) {const char *s;
@@ -308,7 +308,7 @@ static void walk_pte(struct pg_state *st, pmd_t *pmd, unsigned long start, {pte_t *pte =pte_offset_kernel (pmd,0 );unsigned long addr; -unsigned i; +unsigned int i;for (i =0 ; i <PTRS_PER_PTE ; i++, pte++) { addr = start + i *PAGE_SIZE ;
@@ -339,7 +339,7 @@ static void walk_pmd(struct pg_state *st, pud_t *pud, unsigned long start) {pmd_t *pmd =pmd_offset (pud,0 );unsigned long addr; -unsigned i; +unsigned int i;const char *domain;for (i =0 ; i <PTRS_PER_PMD ; i++, pmd++) {
@@ -363,7 +363,7 @@ static void walk_pud(struct pg_state *st, p4d_t *p4d, unsigned long start) {pud_t *pud =pud_offset (p4d,0 );unsigned long addr; -unsigned i; +unsigned int i;for (i =0 ; i <PTRS_PER_PUD ; i++, pud++) { addr = start + i *PUD_SIZE ;
@@ -379,7 +379,7 @@ static void walk_p4d(struct pg_state *st, pgd_t *pgd, unsigned long start) {p4d_t *p4d =p4d_offset (pgd,0 );unsigned long addr; -unsigned i; +unsigned int i;for (i =0 ; i <PTRS_PER_P4D ; i++, p4d++) { addr = start + i *P4D_SIZE ;
@@ -395,7 +395,7 @@ static void walk_pgd(struct pg_state *st, struct mm_struct *mm, unsigned long start) {pgd_t *pgd =pgd_offset (mm,0UL ); -unsigned i; +unsigned int i;unsigned long addr;for (i =0 ; i <PTRS_PER_PGD ; i++, pgd++) {
@@ -422,7 +422,7 @@ void ptdump_walk_pgd(struct seq_file *m, struct ptdump_info *info)static void __init ptdump_initialize (void ) { -unsigned i, j; +unsigned int i, j;for (i =0 ; i <ARRAY_SIZE (pg_level); i++)if (pg_level[i].bits)
Signature · 9 lines
2.31.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Russell King (Oracle)
maintainerarch/arm/mm/cache-l2x0.c static inline void l2c_wait_mask(void __iomem *reg, unsigned long mask) · line 65
Quoted 5 lines · Jinchao Wang
* By default, we write directly to secure registers. Platforms must
* override this if they are running non-secure.
*/arch/arm/mm/cache-l2x0.c +1
-1-static void l2c_write_sec (unsigned long val,void __iomem *base,unsigned reg) +static void l2c_write_sec (unsigned long val,void __iomem *base,unsigned int reg)
... and then I'll get another patch because this now goes over 80 characters. No thanks.
There is nothing inherently wrong with "unsigned" - it's always been legal C, and I'd prefer to keep the code as-is under arch/arm in regard of this.
Thanks.
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!