[PATCH 1/3] firmware: tegra: bpmp: Prefer u32 over uint32_t

Thierry Reding thierry.reding at gmail.com
Thu Sep 22 06:41:23 PDT 2022


From: Thierry Reding <treding at nvidia.com>

The canonical type for 32-bit unsigned integers in the kernel is u32, so
use that instead of uint32_t.

Signed-off-by: Thierry Reding <treding at nvidia.com>
---
 drivers/firmware/tegra/bpmp-debugfs.c | 40 +++++++++++++--------------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/drivers/firmware/tegra/bpmp-debugfs.c b/drivers/firmware/tegra/bpmp-debugfs.c
index 0c440afd5224..1a3b88d63f0c 100644
--- a/drivers/firmware/tegra/bpmp-debugfs.c
+++ b/drivers/firmware/tegra/bpmp-debugfs.c
@@ -48,7 +48,7 @@ static int seqbuf_read(struct seqbuf *seqbuf, void *buf, size_t nbyte)
 	return seqbuf_status(seqbuf);
 }
 
-static int seqbuf_read_u32(struct seqbuf *seqbuf, uint32_t *v)
+static int seqbuf_read_u32(struct seqbuf *seqbuf, u32 *v)
 {
 	int err;
 
@@ -109,7 +109,7 @@ static const char *get_filename(struct tegra_bpmp *bpmp,
 }
 
 static int mrq_debug_open(struct tegra_bpmp *bpmp, const char *name,
-			  uint32_t *fd, uint32_t *len, bool write)
+			  u32 *fd, u32 *len, bool write)
 {
 	struct mrq_debug_request req = {
 		.cmd = cpu_to_le32(write ? CMD_DEBUG_OPEN_WO : CMD_DEBUG_OPEN_RO),
@@ -147,7 +147,7 @@ static int mrq_debug_open(struct tegra_bpmp *bpmp, const char *name,
 	return 0;
 }
 
-static int mrq_debug_close(struct tegra_bpmp *bpmp, uint32_t fd)
+static int mrq_debug_close(struct tegra_bpmp *bpmp, u32 fd)
 {
 	struct mrq_debug_request req = {
 		.cmd = cpu_to_le32(CMD_DEBUG_CLOSE),
@@ -179,7 +179,7 @@ static int mrq_debug_close(struct tegra_bpmp *bpmp, uint32_t fd)
 }
 
 static int mrq_debug_read(struct tegra_bpmp *bpmp, const char *name,
-			  char *data, size_t sz_data, uint32_t *nbytes)
+			  char *data, size_t sz_data, u32 *nbytes)
 {
 	struct mrq_debug_request req = {
 		.cmd = cpu_to_le32(CMD_DEBUG_READ),
@@ -196,7 +196,7 @@ static int mrq_debug_read(struct tegra_bpmp *bpmp, const char *name,
 			.size = sizeof(resp),
 		},
 	};
-	uint32_t fd = 0, len = 0;
+	u32 fd = 0, len = 0;
 	int remaining, err;
 
 	mutex_lock(&bpmp_debug_lock);
@@ -259,7 +259,7 @@ static int mrq_debug_write(struct tegra_bpmp *bpmp, const char *name,
 			.size = sizeof(resp),
 		},
 	};
-	uint32_t fd = 0, len = 0;
+	u32 fd = 0, len = 0;
 	size_t remaining;
 	int err;
 
@@ -322,7 +322,7 @@ static int bpmp_debug_show(struct seq_file *m, void *p)
 			.size = sizeof(resp),
 		},
 	};
-	uint32_t fd = 0, len = 0;
+	u32 fd = 0, len = 0;
 	int remaining, err;
 
 	filename = get_filename(bpmp, file, fnamebuf, sizeof(fnamebuf));
@@ -413,8 +413,8 @@ static int bpmp_populate_debugfs_inband(struct tegra_bpmp *bpmp,
 {
 	const size_t pathlen = SZ_256;
 	const size_t bufsize = SZ_16K;
-	uint32_t dsize, attrs = 0;
 	struct dentry *dentry;
+	u32 dsize, attrs = 0;
 	struct seqbuf seqbuf;
 	char *buf, *pathbuf;
 	const char *name;
@@ -496,10 +496,10 @@ static int mrq_debugfs_read(struct tegra_bpmp *bpmp,
 	struct mrq_debugfs_request req = {
 		.cmd = cpu_to_le32(CMD_DEBUGFS_READ),
 		.fop = {
-			.fnameaddr = cpu_to_le32((uint32_t)name),
-			.fnamelen = cpu_to_le32((uint32_t)sz_name),
-			.dataaddr = cpu_to_le32((uint32_t)data),
-			.datalen = cpu_to_le32((uint32_t)sz_data),
+			.fnameaddr = cpu_to_le32((u32)name),
+			.fnamelen = cpu_to_le32((u32)sz_name),
+			.dataaddr = cpu_to_le32((u32)data),
+			.datalen = cpu_to_le32((u32)sz_data),
 		},
 	};
 	struct mrq_debugfs_response resp;
@@ -534,10 +534,10 @@ static int mrq_debugfs_write(struct tegra_bpmp *bpmp,
 	const struct mrq_debugfs_request req = {
 		.cmd = cpu_to_le32(CMD_DEBUGFS_WRITE),
 		.fop = {
-			.fnameaddr = cpu_to_le32((uint32_t)name),
-			.fnamelen = cpu_to_le32((uint32_t)sz_name),
-			.dataaddr = cpu_to_le32((uint32_t)data),
-			.datalen = cpu_to_le32((uint32_t)sz_data),
+			.fnameaddr = cpu_to_le32((u32)name),
+			.fnamelen = cpu_to_le32((u32)sz_name),
+			.dataaddr = cpu_to_le32((u32)data),
+			.datalen = cpu_to_le32((u32)sz_data),
 		},
 	};
 	struct tegra_bpmp_message msg = {
@@ -557,8 +557,8 @@ static int mrq_debugfs_dumpdir(struct tegra_bpmp *bpmp, dma_addr_t addr,
 	const struct mrq_debugfs_request req = {
 		.cmd = cpu_to_le32(CMD_DEBUGFS_DUMPDIR),
 		.dumpdir = {
-			.dataaddr = cpu_to_le32((uint32_t)addr),
-			.datalen = cpu_to_le32((uint32_t)size),
+			.dataaddr = cpu_to_le32((u32)addr),
+			.datalen = cpu_to_le32((u32)size),
 		},
 	};
 	struct mrq_debugfs_response resp;
@@ -695,10 +695,10 @@ static const struct file_operations debugfs_fops = {
 };
 
 static int bpmp_populate_dir(struct tegra_bpmp *bpmp, struct seqbuf *seqbuf,
-			     struct dentry *parent, uint32_t depth)
+			     struct dentry *parent, u32 depth)
 {
 	int err;
-	uint32_t d, t;
+	u32 d, t;
 	const char *name;
 	struct dentry *dentry;
 
-- 
2.37.3




More information about the linux-arm-kernel mailing list