public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/4] imx: mmdc_size: Fix checkpatch warnings
Date: Thu, 18 Jul 2019 15:04:23 -0300	[thread overview]
Message-ID: <20190718180425.29472-2-festevam@gmail.com> (raw)
In-Reply-To: <20190718180425.29472-1-festevam@gmail.com>

The original imx_ddr_size() implementation had some
issues reported by checkpatch like this:

CHECK: Prefer kernel type 'u32' over 'uint32_t'
#127: FILE: arch/arm/mach-imx/mmdc_size.c:16:
+	uint32_t	ctl;

WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
#151: FILE: arch/arm/mach-imx/mmdc_size.c:40:
+	unsigned ctl = readl(&mem->ctl);

Fix all of them.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
 arch/arm/mach-imx/mmdc_size.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/arch/arm/mach-imx/mmdc_size.c b/arch/arm/mach-imx/mmdc_size.c
index 8a3c6bdea6..13f587c38a 100644
--- a/arch/arm/mach-imx/mmdc_size.c
+++ b/arch/arm/mach-imx/mmdc_size.c
@@ -13,13 +13,13 @@ static const unsigned char bank_lookup[] = {3, 2};
 
 /* these MMDC registers are common to the IMX53 and IMX6 */
 struct esd_mmdc_regs {
-	uint32_t	ctl;
-	uint32_t	pdc;
-	uint32_t	otc;
-	uint32_t	cfg0;
-	uint32_t	cfg1;
-	uint32_t	cfg2;
-	uint32_t	misc;
+	u32 ctl;
+	u32 pdc;
+	u32 otc;
+	u32 cfg0;
+	u32 cfg1;
+	u32 cfg2;
+	u32 misc;
 };
 
 #define ESD_MMDC_CTL_GET_ROW(mdctl)	((ctl >> 24) & 7)
@@ -34,11 +34,11 @@ struct esd_mmdc_regs {
  * width and the MMDC MDMISC register holds the number of banks. Combine
  * all these bits to determine the meme size the MMDC has been configured for
  */
-unsigned imx_ddr_size(void)
+unsigned int imx_ddr_size(void)
 {
 	struct esd_mmdc_regs *mem = (struct esd_mmdc_regs *)MEMCTL_BASE;
-	unsigned ctl = readl(&mem->ctl);
-	unsigned misc = readl(&mem->misc);
+	unsigned int ctl = readl(&mem->ctl);
+	unsigned int misc = readl(&mem->misc);
 	int bits = 11 + 0 + 0 + 1;      /* row + col + bank + width */
 
 	bits += ESD_MMDC_CTL_GET_ROW(ctl);
-- 
2.17.1

  reply	other threads:[~2019-07-18 18:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-18 18:04 [U-Boot] [PATCH 1/4] imx: Place imx_ddr_size() into a separate file Fabio Estevam
2019-07-18 18:04 ` Fabio Estevam [this message]
2019-10-14 12:40   ` [U-Boot] [PATCH 2/4] imx: mmdc_size: Fix checkpatch warnings sbabic at denx.de
2019-07-18 18:04 ` [U-Boot] [PATCH 3/4] imx: mmdc_size: Allow building it for i.MX7ULP Fabio Estevam
2019-10-14 12:40   ` sbabic at denx.de
2019-07-18 18:04 ` [U-Boot] [PATCH 4/4] mx7ulp_evk: Use imx_ddr_size() Fabio Estevam
2019-10-14 12:40   ` sbabic at denx.de
2019-10-13 20:44 ` [U-Boot] [PATCH 1/4] imx: Place imx_ddr_size() into a separate file Stefano Babic
2019-10-13 22:34   ` Fabio Estevam
2019-10-14 12:40 ` sbabic at denx.de

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190718180425.29472-2-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox