[PATCH] arm: mm: Prefer unsigned int to bare use of unsigned

Jinchao Wang wjc at cdjrlc.com
Fri Jun 25 23:58:33 PDT 2021


Fix checkpatch warnings:
    WARNING: Prefer 'unsigned int' to bare use of 'unsigned'

Signed-off-by: Jinchao Wang <wjc at cdjrlc.com>
---
 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(-)

diff --git a/arch/arm/mm/cache-l2x0.c b/arch/arm/mm/cache-l2x0.c
index 43d91bfd2360..c885d572ee76 100644
--- a/arch/arm/mm/cache-l2x0.c
+++ b/arch/arm/mm/cache-l2x0.c
@@ -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;
 
diff --git a/arch/arm/mm/dma-mapping.c b/arch/arm/mm/dma-mapping.c
index c4b8df2ad328..0d0e62c7fcd8 100644
--- a/arch/arm/mm/dma-mapping.c
+++ b/arch/arm/mm/dma-mapping.c
@@ -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);
diff --git a/arch/arm/mm/dump.c b/arch/arm/mm/dump.c
index fb688003d156..62b8f8dfc5e6 100644
--- a/arch/arm/mm/dump.c
+++ b/arch/arm/mm/dump.c
@@ -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)
-- 
2.31.1






More information about the linux-arm-kernel mailing list