Commit 7dd68b14 authored by Thomas Weißschuh's avatar Thomas Weißschuh Committed by Greg Kroah-Hartman
Browse files

staging: erofs: use explicit unsigned int type



Fix coding style issue "Prefer 'unsigned int' to bare use of 'unsigned'"
detected by checkpatch.pl.

Signed-off-by: default avatarThomas Weißschuh <linux@weissschuh.net>
Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
Reviewed-by: default avatarGao Xiang <gaoxiang25@huawei.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 645923e4
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -202,7 +202,7 @@ static inline struct bio *erofs_read_raw_page(
	struct address_space *mapping,
	struct page *page,
	erofs_off_t *last_block,
	unsigned nblocks,
	unsigned int nblocks,
	bool ra)
{
	struct inode *inode = mapping->host;
@@ -236,7 +236,7 @@ submit_bio_retry:
			.m_la = blknr_to_addr(current_block),
		};
		erofs_blk_t blknr;
		unsigned blkoff;
		unsigned int blkoff;

		err = erofs_map_blocks(inode, &map, EROFS_GET_BLOCKS_RAW);
		if (unlikely(err))
+8 −7
Original line number Diff line number Diff line
@@ -24,8 +24,8 @@ static const unsigned char erofs_filetype_table[EROFS_FT_MAX] = {
};

static int erofs_fill_dentries(struct dir_context *ctx,
	void *dentry_blk, unsigned *ofs,
	unsigned nameoff, unsigned maxsize)
	void *dentry_blk, unsigned int *ofs,
	unsigned int nameoff, unsigned int maxsize)
{
	struct erofs_dirent *de = dentry_blk;
	const struct erofs_dirent *end = dentry_blk + nameoff;
@@ -36,7 +36,7 @@ static int erofs_fill_dentries(struct dir_context *ctx,
		int de_namelen;
		unsigned char d_type;
#ifdef CONFIG_EROFS_FS_DEBUG
		unsigned dbg_namelen;
		unsigned int dbg_namelen;
		unsigned char dbg_namebuf[EROFS_NAME_LEN];
#endif

@@ -81,15 +81,15 @@ static int erofs_readdir(struct file *f, struct dir_context *ctx)
	struct inode *dir = file_inode(f);
	struct address_space *mapping = dir->i_mapping;
	const size_t dirsize = i_size_read(dir);
	unsigned i = ctx->pos / EROFS_BLKSIZ;
	unsigned ofs = ctx->pos % EROFS_BLKSIZ;
	unsigned int i = ctx->pos / EROFS_BLKSIZ;
	unsigned int ofs = ctx->pos % EROFS_BLKSIZ;
	int err = 0;
	bool initial = true;

	while (ctx->pos < dirsize) {
		struct page *dentry_page;
		struct erofs_dirent *de;
		unsigned nameoff, maxsize;
		unsigned int nameoff, maxsize;

		dentry_page = read_mapping_page(mapping, i, NULL);
		if (IS_ERR(dentry_page))
@@ -109,7 +109,8 @@ static int erofs_readdir(struct file *f, struct dir_context *ctx)
			goto skip_this;
		}

		maxsize = min_t(unsigned, dirsize - ctx->pos + ofs, PAGE_SIZE);
		maxsize = min_t(unsigned int,
				dirsize - ctx->pos + ofs, PAGE_SIZE);

		/* search dirents at the arbitrary position */
		if (unlikely(initial)) {
+4 −3
Original line number Diff line number Diff line
@@ -19,7 +19,7 @@ static int read_inode(struct inode *inode, void *data)
{
	struct erofs_vnode *vi = EROFS_V(inode);
	struct erofs_inode_v1 *v1 = data;
	const unsigned advise = le16_to_cpu(v1->i_advise);
	const unsigned int advise = le16_to_cpu(v1->i_advise);

	vi->data_mapping_mode = __inode_data_mapping(advise);

@@ -112,7 +112,8 @@ static int read_inode(struct inode *inode, void *data)
 * try_lock since it takes no much overhead and
 * will success immediately.
 */
static int fill_inline_data(struct inode *inode, void *data, unsigned m_pofs)
static int fill_inline_data(struct inode *inode, void *data,
			    unsigned int m_pofs)
{
	struct erofs_vnode *vi = EROFS_V(inode);
	struct erofs_sb_info *sbi = EROFS_I_SB(inode);
@@ -152,7 +153,7 @@ static int fill_inode(struct inode *inode, int isdir)
	void *data;
	int err;
	erofs_blk_t blkaddr;
	unsigned ofs;
	unsigned int ofs;

	trace_erofs_fill_inode(inode, isdir);

+14 −14
Original line number Diff line number Diff line
@@ -17,9 +17,9 @@

/* based on the value of qn->len is accurate */
static inline int dirnamecmp(struct qstr *qn,
	struct qstr *qd, unsigned *matched)
	struct qstr *qd, unsigned int *matched)
{
	unsigned i = *matched, len = min(qn->len, qd->len);
	unsigned int i = *matched, len = min(qn->len, qd->len);
loop:
	if (unlikely(i >= len)) {
		*matched = i;
@@ -46,8 +46,8 @@ static struct erofs_dirent *find_target_dirent(
	struct qstr *name,
	u8 *data, int maxsize)
{
	unsigned ndirents, head, back;
	unsigned startprfx, endprfx;
	unsigned int ndirents, head, back;
	unsigned int startprfx, endprfx;
	struct erofs_dirent *const de = (struct erofs_dirent *)data;

	/* make sure that maxsize is valid */
@@ -63,9 +63,9 @@ static struct erofs_dirent *find_target_dirent(
	startprfx = endprfx = 0;

	while (head <= back) {
		unsigned mid = head + (back - head) / 2;
		unsigned nameoff = le16_to_cpu(de[mid].nameoff);
		unsigned matched = min(startprfx, endprfx);
		unsigned int mid = head + (back - head) / 2;
		unsigned int nameoff = le16_to_cpu(de[mid].nameoff);
		unsigned int matched = min(startprfx, endprfx);

		struct qstr dname = QSTR_INIT(data + nameoff,
			unlikely(mid >= ndirents - 1) ?
@@ -95,8 +95,8 @@ static struct page *find_target_block_classic(
	struct inode *dir,
	struct qstr *name, int *_diff)
{
	unsigned startprfx, endprfx;
	unsigned head, back;
	unsigned int startprfx, endprfx;
	unsigned int head, back;
	struct address_space *const mapping = dir->i_mapping;
	struct page *candidate = ERR_PTR(-ENOENT);

@@ -105,7 +105,7 @@ static struct page *find_target_block_classic(
	back = inode_datablocks(dir) - 1;

	while (head <= back) {
		unsigned mid = head + (back - head) / 2;
		unsigned int mid = head + (back - head) / 2;
		struct page *page = read_mapping_page(mapping, mid, NULL);

		if (IS_ERR(page)) {
@@ -115,10 +115,10 @@ exact_out:
			return page;
		} else {
			int diff;
			unsigned ndirents, matched;
			unsigned int ndirents, matched;
			struct qstr dname;
			struct erofs_dirent *de = kmap_atomic(page);
			unsigned nameoff = le16_to_cpu(de->nameoff);
			unsigned int nameoff = le16_to_cpu(de->nameoff);

			ndirents = nameoff / sizeof(*de);

@@ -164,7 +164,7 @@ exact_out:

int erofs_namei(struct inode *dir,
	struct qstr *name,
	erofs_nid_t *nid, unsigned *d_type)
	erofs_nid_t *nid, unsigned int *d_type)
{
	int diff;
	struct page *page;
@@ -204,7 +204,7 @@ static struct dentry *erofs_lookup(struct inode *dir,
{
	int err;
	erofs_nid_t nid;
	unsigned d_type;
	unsigned int d_type;
	struct inode *inode;

	DBG_BUGON(!d_really_is_negative(dentry));
+1 −1
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ static int superblock_read(struct super_block *sb)
	struct erofs_sb_info *sbi;
	struct buffer_head *bh;
	struct erofs_super_block *layout;
	unsigned blkszbits;
	unsigned int blkszbits;
	int ret;

	bh = sb_bread(sb, 0);
Loading