2018-09-07 16:50:03

by Thomas Weißschuh

[permalink] [raw]
Subject: [PATCH v2] staging: erofs: use explicit unsigned int type

Changes since v1:

* Removed changes that conflicted with
[PATCH 1/6] staging: erofs: formatting fix in unzip_vle_lz4.c
* Added patch description

-- >8 --

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

Signed-off-by: Thomas Weißschuh <[email protected]>

---
drivers/staging/erofs/data.c | 4 +--
drivers/staging/erofs/dir.c | 14 ++++-----
drivers/staging/erofs/inode.c | 6 ++--
drivers/staging/erofs/namei.c | 28 +++++++++---------
drivers/staging/erofs/super.c | 2 +-
drivers/staging/erofs/unzip_vle.c | 48 +++++++++++++++----------------
drivers/staging/erofs/utils.c | 2 +-
drivers/staging/erofs/xattr.c | 40 +++++++++++++-------------
8 files changed, 72 insertions(+), 72 deletions(-)

diff --git a/drivers/staging/erofs/data.c b/drivers/staging/erofs/data.c
index 3c0d9159514e..e1916101ad75 100644
--- a/drivers/staging/erofs/data.c
+++ b/drivers/staging/erofs/data.c
@@ -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 @@ static inline struct bio *erofs_read_raw_page(
.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))
diff --git a/drivers/staging/erofs/dir.c b/drivers/staging/erofs/dir.c
index be6ae3b1bdbe..87f12b0f983f 100644
--- a/drivers/staging/erofs/dir.c
+++ b/drivers/staging/erofs/dir.c
@@ -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,7 @@ 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)) {
diff --git a/drivers/staging/erofs/inode.c b/drivers/staging/erofs/inode.c
index fbf6ff25cd1b..70d34b0a97fe 100644
--- a/drivers/staging/erofs/inode.c
+++ b/drivers/staging/erofs/inode.c
@@ -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,7 @@ 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 +152,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);

diff --git a/drivers/staging/erofs/namei.c b/drivers/staging/erofs/namei.c
index 546a47156101..0039b767afb3 100644
--- a/drivers/staging/erofs/namei.c
+++ b/drivers/staging/erofs/namei.c
@@ -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 @@ static struct page *find_target_block_classic(
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 @@ static struct page *find_target_block_classic(

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));
diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c
index 1aec509c805f..5654cc7a5015 100644
--- a/drivers/staging/erofs/super.c
+++ b/drivers/staging/erofs/super.c
@@ -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);
diff --git a/drivers/staging/erofs/unzip_vle.c b/drivers/staging/erofs/unzip_vle.c
index 22f9a02a75f9..21874b79c434 100644
--- a/drivers/staging/erofs/unzip_vle.c
+++ b/drivers/staging/erofs/unzip_vle.c
@@ -27,7 +27,7 @@ void z_erofs_exit_zip_subsystem(void)

static inline int init_unzip_workqueue(void)
{
- const unsigned onlinecpus = num_possible_cpus();
+ const unsigned int onlinecpus = num_possible_cpus();

/*
* we don't need too many threads, limiting threads
@@ -89,7 +89,7 @@ struct z_erofs_vle_work_builder {

/* pages used for reading the compressed data */
struct page **compressed_pages;
- unsigned compressed_deficit;
+ unsigned int compressed_deficit;
};

#define VLE_WORK_BUILDER_INIT() \
@@ -232,7 +232,7 @@ static int z_erofs_vle_work_add_page(

ret = z_erofs_pagevec_ctor_enqueue(&builder->vector,
page, type, &occupied);
- builder->work->vcnt += (unsigned)ret;
+ builder->work->vcnt += (unsigned int)ret;

return ret ? 0 : -EAGAIN;
}
@@ -274,7 +274,7 @@ static inline bool try_to_claim_workgroup(
struct z_erofs_vle_work_finder {
struct super_block *sb;
pgoff_t idx;
- unsigned pageofs;
+ unsigned int pageofs;

struct z_erofs_vle_workgroup **grp_ret;
enum z_erofs_vle_work_role *role;
@@ -440,7 +440,7 @@ static int z_erofs_vle_work_iter_begin(struct z_erofs_vle_work_builder *builder,
struct erofs_map_blocks *map,
z_erofs_vle_owned_workgrp_t *owned_head)
{
- const unsigned clusterpages = erofs_clusterpages(EROFS_SB(sb));
+ const unsigned int clusterpages = erofs_clusterpages(EROFS_SB(sb));
struct z_erofs_vle_workgroup *grp;
const struct z_erofs_vle_work_finder finder = {
.sb = sb,
@@ -610,7 +610,7 @@ static int z_erofs_do_read_page(struct z_erofs_vle_frontend *fe,
#endif

enum z_erofs_page_type page_type;
- unsigned cur, end, spiltted, index;
+ unsigned int cur, end, spiltted, index;
int err;

/* register locked file pages as online pages in pack */
@@ -667,7 +667,7 @@ static int z_erofs_do_read_page(struct z_erofs_vle_frontend *fe,
tight &= builder_is_followed(builder);
work = builder->work;
hitted:
- cur = end - min_t(unsigned, offset + end - map->m_la, end);
+ cur = end - min_t(unsigned int, offset + end - map->m_la, end);
if (unlikely(!(map->m_flags & EROFS_MAP_MAPPED))) {
zero_user_segment(page, cur, end);
goto next_part;
@@ -741,7 +741,7 @@ static void z_erofs_vle_unzip_kickoff(void *ptr, int bios)
static inline void z_erofs_vle_read_endio(struct bio *bio)
{
const blk_status_t err = bio->bi_status;
- unsigned i;
+ unsigned int i;
struct bio_vec *bvec;
#ifdef EROFS_FS_HAS_MANAGED_CACHE
struct address_space *mngda = NULL;
@@ -793,16 +793,16 @@ static int z_erofs_vle_unzip(struct super_block *sb,
#ifdef EROFS_FS_HAS_MANAGED_CACHE
struct address_space *const mngda = sbi->managed_cache->i_mapping;
#endif
- const unsigned clusterpages = erofs_clusterpages(sbi);
+ const unsigned int clusterpages = erofs_clusterpages(sbi);

struct z_erofs_pagevec_ctor ctor;
- unsigned nr_pages;
+ unsigned int nr_pages;
#ifndef CONFIG_EROFS_FS_ZIP_MULTIREF
- unsigned sparsemem_pages = 0;
+ unsigned int sparsemem_pages = 0;
#endif
struct page *pages_onstack[Z_EROFS_VLE_VMAP_ONSTACK_PAGES];
struct page **pages, **compressed_pages, *page;
- unsigned i, llen;
+ unsigned int i, llen;

enum z_erofs_page_type page_type;
bool overlapped;
@@ -849,7 +849,7 @@ static int z_erofs_vle_unzip(struct super_block *sb,
Z_EROFS_VLE_INLINE_PAGEVECS, work->pagevec, 0);

for (i = 0; i < work->vcnt; ++i) {
- unsigned pagenr;
+ unsigned int pagenr;

page = z_erofs_pagevec_ctor_dequeue(&ctor, &page_type);

@@ -880,7 +880,7 @@ static int z_erofs_vle_unzip(struct super_block *sb,
compressed_pages = grp->compressed_pages;

for (i = 0; i < clusterpages; ++i) {
- unsigned pagenr;
+ unsigned int pagenr;

page = compressed_pages[i];

@@ -1105,7 +1105,7 @@ static bool z_erofs_vle_submit_all(struct super_block *sb,
bool force_fg)
{
struct erofs_sb_info *const sbi = EROFS_SB(sb);
- const unsigned clusterpages = erofs_clusterpages(sbi);
+ const unsigned int clusterpages = erofs_clusterpages(sbi);
const gfp_t gfp = GFP_NOFS;
#ifdef EROFS_FS_HAS_MANAGED_CACHE
struct address_space *const mngda = sbi->managed_cache->i_mapping;
@@ -1117,7 +1117,7 @@ static bool z_erofs_vle_submit_all(struct super_block *sb,
/* since bio will be NULL, no need to initialize last_index */
pgoff_t uninitialized_var(last_index);
bool force_submit = false;
- unsigned nr_bios;
+ unsigned int nr_bios;

if (unlikely(owned_head == Z_EROFS_VLE_WORKGRP_TAIL))
return false;
@@ -1149,7 +1149,7 @@ static bool z_erofs_vle_submit_all(struct super_block *sb,
struct z_erofs_vle_workgroup *grp;
struct page **compressed_pages, *oldpage, *page;
pgoff_t first_index;
- unsigned i = 0;
+ unsigned int i = 0;
#ifdef EROFS_FS_HAS_MANAGED_CACHE
unsigned int noio = 0;
bool cachemngd;
@@ -1337,7 +1337,7 @@ static int z_erofs_vle_normalaccess_readpage(struct file *file,
static inline int __z_erofs_vle_normalaccess_readpages(
struct file *filp,
struct address_space *mapping,
- struct list_head *pages, unsigned nr_pages, bool sync)
+ struct list_head *pages, unsigned int nr_pages, bool sync)
{
struct inode *const inode = mapping->host;

@@ -1398,7 +1398,7 @@ static inline int __z_erofs_vle_normalaccess_readpages(
static int z_erofs_vle_normalaccess_readpages(
struct file *filp,
struct address_space *mapping,
- struct list_head *pages, unsigned nr_pages)
+ struct list_head *pages, unsigned int nr_pages)
{
return __z_erofs_vle_normalaccess_readpages(filp,
mapping, pages, nr_pages,
@@ -1445,7 +1445,7 @@ vle_extent_blkaddr(struct inode *inode, pgoff_t index)
struct erofs_sb_info *sbi = EROFS_I_SB(inode);
struct erofs_vnode *vi = EROFS_V(inode);

- unsigned ofs = Z_EROFS_VLE_EXTENT_ALIGN(vi->inode_isize +
+ unsigned int ofs = Z_EROFS_VLE_EXTENT_ALIGN(vi->inode_isize +
vi->xattr_isize) + sizeof(struct erofs_extent_header) +
index * sizeof(struct z_erofs_vle_decompressed_index);

@@ -1458,7 +1458,7 @@ vle_extent_blkoff(struct inode *inode, pgoff_t index)
struct erofs_sb_info *sbi = EROFS_I_SB(inode);
struct erofs_vnode *vi = EROFS_V(inode);

- unsigned ofs = Z_EROFS_VLE_EXTENT_ALIGN(vi->inode_isize +
+ unsigned int ofs = Z_EROFS_VLE_EXTENT_ALIGN(vi->inode_isize +
vi->xattr_isize) + sizeof(struct erofs_extent_header) +
index * sizeof(struct z_erofs_vle_decompressed_index);

@@ -1476,9 +1476,9 @@ static erofs_off_t vle_get_logical_extent_head(
struct inode *inode,
struct page **page_iter,
void **kaddr_iter,
- unsigned lcn, /* logical cluster number */
+ unsigned int lcn, /* logical cluster number */
erofs_blk_t *pcn,
- unsigned *flags)
+ unsigned int *flags)
{
/* for extent meta */
struct page *page = *page_iter;
@@ -1531,7 +1531,7 @@ int z_erofs_map_blocks_iter(struct inode *inode,
unsigned long long ofs, end;
struct z_erofs_vle_decompressed_index *di;
erofs_blk_t e_blkaddr, pcn;
- unsigned lcn, logical_cluster_ofs, cluster_type;
+ unsigned int lcn, logical_cluster_ofs, cluster_type;
u32 ofs_rem;
struct page *mpage = *mpage_ret;
void *kaddr;
diff --git a/drivers/staging/erofs/utils.c b/drivers/staging/erofs/utils.c
index 595cf90af9bb..ddd220ac33fd 100644
--- a/drivers/staging/erofs/utils.c
+++ b/drivers/staging/erofs/utils.c
@@ -120,7 +120,7 @@ unsigned long erofs_shrink_workstation(struct erofs_sb_info *sbi,
{
pgoff_t first_index = 0;
void *batch[PAGEVEC_SIZE];
- unsigned freed = 0;
+ unsigned int freed = 0;

int i, found;
repeat:
diff --git a/drivers/staging/erofs/xattr.c b/drivers/staging/erofs/xattr.c
index 79d7fc8b7cc5..f38300a8bc8e 100644
--- a/drivers/staging/erofs/xattr.c
+++ b/drivers/staging/erofs/xattr.c
@@ -19,7 +19,7 @@ struct xattr_iter {
void *kaddr;

erofs_blk_t blkaddr;
- unsigned ofs;
+ unsigned int ofs;
};

static inline void xattr_iter_end(struct xattr_iter *it, bool atomic)
@@ -45,7 +45,7 @@ static inline void xattr_iter_end_final(struct xattr_iter *it)
static int init_inode_xattrs(struct inode *inode)
{
struct xattr_iter it;
- unsigned i;
+ unsigned int i;
struct erofs_xattr_ibody_header *ih;
struct super_block *sb;
struct erofs_sb_info *sbi;
@@ -111,9 +111,9 @@ static int init_inode_xattrs(struct inode *inode)

struct xattr_iter_handlers {
int (*entry)(struct xattr_iter *, struct erofs_xattr_entry *);
- int (*name)(struct xattr_iter *, unsigned, char *, unsigned);
- int (*alloc_buffer)(struct xattr_iter *, unsigned);
- void (*value)(struct xattr_iter *, unsigned, char *, unsigned);
+ int (*name)(struct xattr_iter *, unsigned int, char *, unsigned int);
+ int (*alloc_buffer)(struct xattr_iter *, unsigned int);
+ void (*value)(struct xattr_iter *, unsigned int, char *, unsigned int);
};

static inline int xattr_iter_fixup(struct xattr_iter *it)
@@ -143,7 +143,7 @@ static int inline_xattr_iter_begin(struct xattr_iter *it,
{
struct erofs_vnode *const vi = EROFS_V(inode);
struct erofs_sb_info *const sbi = EROFS_SB(inode->i_sb);
- unsigned xattr_header_sz, inline_xattr_ofs;
+ unsigned int xattr_header_sz, inline_xattr_ofs;

xattr_header_sz = inlinexattr_header_size(inode);
if (unlikely(xattr_header_sz >= vi->xattr_isize)) {
@@ -168,7 +168,7 @@ static int xattr_foreach(struct xattr_iter *it,
const struct xattr_iter_handlers *op, unsigned int *tlimit)
{
struct erofs_xattr_entry entry;
- unsigned value_sz, processed, slice;
+ unsigned int value_sz, processed, slice;
int err;

/* 0. fixup blkaddr, ofs, ipage */
@@ -183,7 +183,7 @@ static int xattr_foreach(struct xattr_iter *it,
*/
entry = *(struct erofs_xattr_entry *)(it->kaddr + it->ofs);
if (tlimit != NULL) {
- unsigned entry_sz = EROFS_XATTR_ENTRY_SIZE(&entry);
+ unsigned int entry_sz = EROFS_XATTR_ENTRY_SIZE(&entry);

BUG_ON(*tlimit < entry_sz);
*tlimit -= entry_sz;
@@ -212,7 +212,7 @@ static int xattr_foreach(struct xattr_iter *it,
it->ofs = 0;
}

- slice = min_t(unsigned, PAGE_SIZE - it->ofs,
+ slice = min_t(unsigned int, PAGE_SIZE - it->ofs,
entry.e_name_len - processed);

/* handle name */
@@ -247,7 +247,7 @@ static int xattr_foreach(struct xattr_iter *it,
it->ofs = 0;
}

- slice = min_t(unsigned, PAGE_SIZE - it->ofs,
+ slice = min_t(unsigned int, PAGE_SIZE - it->ofs,
value_sz - processed);
op->value(it, processed, it->kaddr + it->ofs, slice);
it->ofs += slice;
@@ -278,7 +278,7 @@ static int xattr_entrymatch(struct xattr_iter *_it,
}

static int xattr_namematch(struct xattr_iter *_it,
- unsigned processed, char *buf, unsigned len)
+ unsigned int processed, char *buf, unsigned int len)
{
struct getxattr_iter *it = container_of(_it, struct getxattr_iter, it);

@@ -286,7 +286,7 @@ static int xattr_namematch(struct xattr_iter *_it,
}

static int xattr_checkbuffer(struct xattr_iter *_it,
- unsigned value_sz)
+ unsigned int value_sz)
{
struct getxattr_iter *it = container_of(_it, struct getxattr_iter, it);
int err = it->buffer_size < value_sz ? -ERANGE : 0;
@@ -296,7 +296,7 @@ static int xattr_checkbuffer(struct xattr_iter *_it,
}

static void xattr_copyvalue(struct xattr_iter *_it,
- unsigned processed, char *buf, unsigned len)
+ unsigned int processed, char *buf, unsigned int len)
{
struct getxattr_iter *it = container_of(_it, struct getxattr_iter, it);

@@ -313,7 +313,7 @@ static const struct xattr_iter_handlers find_xattr_handlers = {
static int inline_getxattr(struct inode *inode, struct getxattr_iter *it)
{
int ret;
- unsigned remaining;
+ unsigned int remaining;

ret = inline_xattr_iter_begin(&it->it, inode);
if (ret < 0)
@@ -338,7 +338,7 @@ static int shared_getxattr(struct inode *inode, struct getxattr_iter *it)
struct erofs_vnode *const vi = EROFS_V(inode);
struct super_block *const sb = inode->i_sb;
struct erofs_sb_info *const sbi = EROFS_SB(sb);
- unsigned i;
+ unsigned int i;
int ret = -ENOATTR;

for (i = 0; i < vi->xattr_shared_count; ++i) {
@@ -489,7 +489,7 @@ static int xattr_entrylist(struct xattr_iter *_it,
{
struct listxattr_iter *it =
container_of(_it, struct listxattr_iter, it);
- unsigned prefix_len;
+ unsigned int prefix_len;
const char *prefix;

const struct xattr_handler *h =
@@ -517,7 +517,7 @@ static int xattr_entrylist(struct xattr_iter *_it,
}

static int xattr_namelist(struct xattr_iter *_it,
- unsigned processed, char *buf, unsigned len)
+ unsigned int processed, char *buf, unsigned int len)
{
struct listxattr_iter *it =
container_of(_it, struct listxattr_iter, it);
@@ -528,7 +528,7 @@ static int xattr_namelist(struct xattr_iter *_it,
}

static int xattr_skipvalue(struct xattr_iter *_it,
- unsigned value_sz)
+ unsigned int value_sz)
{
struct listxattr_iter *it =
container_of(_it, struct listxattr_iter, it);
@@ -547,7 +547,7 @@ static const struct xattr_iter_handlers list_xattr_handlers = {
static int inline_listxattr(struct listxattr_iter *it)
{
int ret;
- unsigned remaining;
+ unsigned int remaining;

ret = inline_xattr_iter_begin(&it->it, d_inode(it->dentry));
if (ret < 0)
@@ -569,7 +569,7 @@ static int shared_listxattr(struct listxattr_iter *it)
struct erofs_vnode *const vi = EROFS_V(inode);
struct super_block *const sb = inode->i_sb;
struct erofs_sb_info *const sbi = EROFS_SB(sb);
- unsigned i;
+ unsigned int i;
int ret = 0;

for (i = 0; i < vi->xattr_shared_count; ++i) {
--
2.18.0



2018-09-08 03:32:19

by Gao Xiang

[permalink] [raw]
Subject: Re: [PATCH v2] staging: erofs: use explicit unsigned int type

Hi Thomas,

Thanks for your new patch.

It seems that this patch also introduces 2 new 'WARNING: line over 80 characters',
could you please fix it in the patch?

On 2018/9/8 0:39, Thomas Weißschuh wrote:
> Changes since v1:
>
> * Removed changes that conflicted with
> [PATCH 1/6] staging: erofs: formatting fix in unzip_vle_lz4.c
> * Added patch description
>
> -- >8 --
>
> Fix coding style issue "Prefer 'unsigned int' to bare use of 'unsigned'"
> detected by checkpatch.pl
>
> Signed-off-by: Thomas Weißschuh <[email protected]>
>
> ---
> drivers/staging/erofs/data.c | 4 +--
> drivers/staging/erofs/dir.c | 14 ++++-----
> drivers/staging/erofs/inode.c | 6 ++--
> drivers/staging/erofs/namei.c | 28 +++++++++---------
> drivers/staging/erofs/super.c | 2 +-
> drivers/staging/erofs/unzip_vle.c | 48 +++++++++++++++----------------
> drivers/staging/erofs/utils.c | 2 +-
> drivers/staging/erofs/xattr.c | 40 +++++++++++++-------------
> 8 files changed, 72 insertions(+), 72 deletions(-)
>
> diff --git a/drivers/staging/erofs/data.c b/drivers/staging/erofs/data.c
> index 3c0d9159514e..e1916101ad75 100644
> --- a/drivers/staging/erofs/data.c
> +++ b/drivers/staging/erofs/data.c
> @@ -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 @@ static inline struct bio *erofs_read_raw_page(
> .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))
> diff --git a/drivers/staging/erofs/dir.c b/drivers/staging/erofs/dir.c
> index be6ae3b1bdbe..87f12b0f983f 100644
> --- a/drivers/staging/erofs/dir.c
> +++ b/drivers/staging/erofs/dir.c
> @@ -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,7 @@ 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);

WARNING: line over 80 characters
#102: FILE: drivers/staging/erofs/dir.c:112:
+ maxsize = min_t(unsigned int, dirsize - ctx->pos + ofs, PAGE_SIZE);


>
> /* search dirents at the arbitrary position */
> if (unlikely(initial)) {
> diff --git a/drivers/staging/erofs/inode.c b/drivers/staging/erofs/inode.c
> index fbf6ff25cd1b..70d34b0a97fe 100644
> --- a/drivers/staging/erofs/inode.c
> +++ b/drivers/staging/erofs/inode.c
> @@ -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,7 @@ 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)

WARNING: line over 80 characters
#124: FILE: drivers/staging/erofs/inode.c:115:
+static int fill_inline_data(struct inode *inode, void *data, unsigned int m_pofs)

Thanks,
Gao Xiang

2018-09-09 15:18:10

by Chao Yu

[permalink] [raw]
Subject: Re: [PATCH v2] staging: erofs: use explicit unsigned int type

Hi Thomas,

On 2018/9/8 11:28, Gao Xiang wrote:
> Hi Thomas,
>
> Thanks for your new patch.
>
> It seems that this patch also introduces 2 new 'WARNING: line over 80 characters',
> could you please fix it in the patch?

It will be better to fix that.

Some reviewed cleanup patches are merged before this patch, then I failed to add
this one, so could you rebase on top of erofs dev branch in below link:

https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git/log/?h=erofs

Thanks,

>
> On 2018/9/8 0:39, Thomas Weißschuh wrote:
>> Changes since v1:
>>
>> * Removed changes that conflicted with
>> [PATCH 1/6] staging: erofs: formatting fix in unzip_vle_lz4.c
>> * Added patch description
>>
>> -- >8 --
>>
>> Fix coding style issue "Prefer 'unsigned int' to bare use of 'unsigned'"
>> detected by checkpatch.pl
>>
>> Signed-off-by: Thomas Weißschuh <[email protected]>
>>
>> ---
>> drivers/staging/erofs/data.c | 4 +--
>> drivers/staging/erofs/dir.c | 14 ++++-----
>> drivers/staging/erofs/inode.c | 6 ++--
>> drivers/staging/erofs/namei.c | 28 +++++++++---------
>> drivers/staging/erofs/super.c | 2 +-
>> drivers/staging/erofs/unzip_vle.c | 48 +++++++++++++++----------------
>> drivers/staging/erofs/utils.c | 2 +-
>> drivers/staging/erofs/xattr.c | 40 +++++++++++++-------------
>> 8 files changed, 72 insertions(+), 72 deletions(-)
>>
>> diff --git a/drivers/staging/erofs/data.c b/drivers/staging/erofs/data.c
>> index 3c0d9159514e..e1916101ad75 100644
>> --- a/drivers/staging/erofs/data.c
>> +++ b/drivers/staging/erofs/data.c
>> @@ -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 @@ static inline struct bio *erofs_read_raw_page(
>> .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))
>> diff --git a/drivers/staging/erofs/dir.c b/drivers/staging/erofs/dir.c
>> index be6ae3b1bdbe..87f12b0f983f 100644
>> --- a/drivers/staging/erofs/dir.c
>> +++ b/drivers/staging/erofs/dir.c
>> @@ -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,7 @@ 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);
>
> WARNING: line over 80 characters
> #102: FILE: drivers/staging/erofs/dir.c:112:
> + maxsize = min_t(unsigned int, dirsize - ctx->pos + ofs, PAGE_SIZE);
>
>
>>
>> /* search dirents at the arbitrary position */
>> if (unlikely(initial)) {
>> diff --git a/drivers/staging/erofs/inode.c b/drivers/staging/erofs/inode.c
>> index fbf6ff25cd1b..70d34b0a97fe 100644
>> --- a/drivers/staging/erofs/inode.c
>> +++ b/drivers/staging/erofs/inode.c
>> @@ -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,7 @@ 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)
>
> WARNING: line over 80 characters
> #124: FILE: drivers/staging/erofs/inode.c:115:
> +static int fill_inline_data(struct inode *inode, void *data, unsigned int m_pofs)
>
> Thanks,
> Gao Xiang
>

2018-09-09 18:36:40

by Thomas Weißschuh

[permalink] [raw]
Subject: [PATCH] MAINTAINERS: add tree location for staging/erofs

Hi Chao, hi Gao,

On Sun, 2018-09-09T23:16+0800, Chao Yu wrote:
> Hi Thomas,
>
> On 2018/9/8 11:28, Gao Xiang wrote:
>> Hi Thomas,
>>
>> Thanks for your new patch.
>>
>> It seems that this patch also introduces 2 new 'WARNING: line over 80 characters',
>> could you please fix it in the patch?

@Chao,Gao: For some reason there seems to be a problem when receiving mails
from you. The one I received now was the first one from you that reached me
directly. Before I only got your messages in the quotes from Dan and now in the
quotes from the mail I am responding to.
(I will try to investigate the reason for this)

Sorry for my slow responses before.

> It will be better to fix that.

A new patch will shortly follow.

> Some reviewed cleanup patches are merged before this patch, then I failed to add
> this one, so could you rebase on top of erofs dev branch in below link:
>
> https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git/log/?h=erofs

I was not aware of this tree and worked off of staging / next.
A patch is attached to this message that adds the tree to the MAINTAINERS file.

-- >8 --

Currently this location is not documented.

Signed-off-by: Thomas Weißschuh <[email protected]>
---
MAINTAINERS | 1 +
1 file changed, 1 insertion(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index a5b256b25905..9087e0b74821 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -13747,6 +13747,7 @@ F: drivers/staging/comedi/
STAGING - EROFS FILE SYSTEM
M: Gao Xiang <[email protected]>
M: Chao Yu <[email protected]>
+T: git git://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git erofs
L: [email protected]
S: Maintained
F: drivers/staging/erofs/
--
2.18.0


2018-09-09 18:40:15

by Thomas Weißschuh

[permalink] [raw]
Subject: [PATCH v3] staging: erofs: use explicit unsigned int type

Changes since v1:

* Removed changes that conflicted with
[PATCH 1/6] staging: erofs: formatting fix in unzip_vle_lz4.c
* Added patch description

Changes since v2:

* Fixed conflicts with other patchsets
* Don't introduce new style issues

-- >8 --

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

Signed-off-by: Thomas Weißschuh <[email protected]>
---
drivers/staging/erofs/data.c | 4 +--
drivers/staging/erofs/dir.c | 15 ++++++-----
drivers/staging/erofs/inode.c | 7 ++---
drivers/staging/erofs/namei.c | 28 ++++++++++----------
drivers/staging/erofs/super.c | 2 +-
drivers/staging/erofs/unzip_vle.c | 42 ++++++++++++++---------------
drivers/staging/erofs/utils.c | 2 +-
drivers/staging/erofs/xattr.c | 44 +++++++++++++++----------------
8 files changed, 73 insertions(+), 71 deletions(-)

diff --git a/drivers/staging/erofs/data.c b/drivers/staging/erofs/data.c
index e7b91d0a500f..f64306d1a0d8 100644
--- a/drivers/staging/erofs/data.c
+++ b/drivers/staging/erofs/data.c
@@ -211,7 +211,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;
@@ -245,7 +245,7 @@ static inline struct bio *erofs_read_raw_page(
.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))
diff --git a/drivers/staging/erofs/dir.c b/drivers/staging/erofs/dir.c
index be6ae3b1bdbe..d1cb0d78ab84 100644
--- a/drivers/staging/erofs/dir.c
+++ b/drivers/staging/erofs/dir.c
@@ -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)) {
diff --git a/drivers/staging/erofs/inode.c b/drivers/staging/erofs/inode.c
index fbf6ff25cd1b..c46a8d4c3b2c 100644
--- a/drivers/staging/erofs/inode.c
+++ b/drivers/staging/erofs/inode.c
@@ -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);

diff --git a/drivers/staging/erofs/namei.c b/drivers/staging/erofs/namei.c
index 546a47156101..0039b767afb3 100644
--- a/drivers/staging/erofs/namei.c
+++ b/drivers/staging/erofs/namei.c
@@ -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 @@ static struct page *find_target_block_classic(
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 @@ static struct page *find_target_block_classic(

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));
diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c
index 93548b9ad8fc..905e4d7dbc0f 100644
--- a/drivers/staging/erofs/super.c
+++ b/drivers/staging/erofs/super.c
@@ -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);
diff --git a/drivers/staging/erofs/unzip_vle.c b/drivers/staging/erofs/unzip_vle.c
index 16da4fb25e70..60a825fabb90 100644
--- a/drivers/staging/erofs/unzip_vle.c
+++ b/drivers/staging/erofs/unzip_vle.c
@@ -29,7 +29,7 @@ void z_erofs_exit_zip_subsystem(void)

static inline int init_unzip_workqueue(void)
{
- const unsigned onlinecpus = num_possible_cpus();
+ const unsigned int onlinecpus = num_possible_cpus();

/*
* we don't need too many threads, limiting threads
@@ -91,7 +91,7 @@ struct z_erofs_vle_work_builder {

/* pages used for reading the compressed data */
struct page **compressed_pages;
- unsigned compressed_deficit;
+ unsigned int compressed_deficit;
};

#define VLE_WORK_BUILDER_INIT() \
@@ -234,7 +234,7 @@ static int z_erofs_vle_work_add_page(

ret = z_erofs_pagevec_ctor_enqueue(&builder->vector,
page, type, &occupied);
- builder->work->vcnt += (unsigned)ret;
+ builder->work->vcnt += (unsigned int)ret;

return ret ? 0 : -EAGAIN;
}
@@ -276,7 +276,7 @@ static inline bool try_to_claim_workgroup(
struct z_erofs_vle_work_finder {
struct super_block *sb;
pgoff_t idx;
- unsigned pageofs;
+ unsigned int pageofs;

struct z_erofs_vle_workgroup **grp_ret;
enum z_erofs_vle_work_role *role;
@@ -442,7 +442,7 @@ static int z_erofs_vle_work_iter_begin(struct z_erofs_vle_work_builder *builder,
struct erofs_map_blocks *map,
z_erofs_vle_owned_workgrp_t *owned_head)
{
- const unsigned clusterpages = erofs_clusterpages(EROFS_SB(sb));
+ const unsigned int clusterpages = erofs_clusterpages(EROFS_SB(sb));
struct z_erofs_vle_workgroup *grp;
const struct z_erofs_vle_work_finder finder = {
.sb = sb,
@@ -612,7 +612,7 @@ static int z_erofs_do_read_page(struct z_erofs_vle_frontend *fe,
#endif

enum z_erofs_page_type page_type;
- unsigned cur, end, spiltted, index;
+ unsigned int cur, end, spiltted, index;
int err = 0;

trace_erofs_readpage(page, false);
@@ -670,7 +670,7 @@ static int z_erofs_do_read_page(struct z_erofs_vle_frontend *fe,
tight &= builder_is_followed(builder);
work = builder->work;
hitted:
- cur = end - min_t(unsigned, offset + end - map->m_la, end);
+ cur = end - min_t(unsigned int, offset + end - map->m_la, end);
if (unlikely(!(map->m_flags & EROFS_MAP_MAPPED))) {
zero_user_segment(page, cur, end);
goto next_part;
@@ -747,7 +747,7 @@ static void z_erofs_vle_unzip_kickoff(void *ptr, int bios)
static inline void z_erofs_vle_read_endio(struct bio *bio)
{
const blk_status_t err = bio->bi_status;
- unsigned i;
+ unsigned int i;
struct bio_vec *bvec;
#ifdef EROFS_FS_HAS_MANAGED_CACHE
struct address_space *mngda = NULL;
@@ -799,16 +799,16 @@ static int z_erofs_vle_unzip(struct super_block *sb,
#ifdef EROFS_FS_HAS_MANAGED_CACHE
struct address_space *const mngda = sbi->managed_cache->i_mapping;
#endif
- const unsigned clusterpages = erofs_clusterpages(sbi);
+ const unsigned int clusterpages = erofs_clusterpages(sbi);

struct z_erofs_pagevec_ctor ctor;
- unsigned nr_pages;
+ unsigned int nr_pages;
#ifndef CONFIG_EROFS_FS_ZIP_MULTIREF
- unsigned sparsemem_pages = 0;
+ unsigned int sparsemem_pages = 0;
#endif
struct page *pages_onstack[Z_EROFS_VLE_VMAP_ONSTACK_PAGES];
struct page **pages, **compressed_pages, *page;
- unsigned i, llen;
+ unsigned int i, llen;

enum z_erofs_page_type page_type;
bool overlapped;
@@ -855,7 +855,7 @@ static int z_erofs_vle_unzip(struct super_block *sb,
Z_EROFS_VLE_INLINE_PAGEVECS, work->pagevec, 0);

for (i = 0; i < work->vcnt; ++i) {
- unsigned pagenr;
+ unsigned int pagenr;

page = z_erofs_pagevec_ctor_dequeue(&ctor, &page_type);

@@ -886,7 +886,7 @@ static int z_erofs_vle_unzip(struct super_block *sb,
compressed_pages = grp->compressed_pages;

for (i = 0; i < clusterpages; ++i) {
- unsigned pagenr;
+ unsigned int pagenr;

page = compressed_pages[i];

@@ -1111,7 +1111,7 @@ static bool z_erofs_vle_submit_all(struct super_block *sb,
bool force_fg)
{
struct erofs_sb_info *const sbi = EROFS_SB(sb);
- const unsigned clusterpages = erofs_clusterpages(sbi);
+ const unsigned int clusterpages = erofs_clusterpages(sbi);
const gfp_t gfp = GFP_NOFS;
#ifdef EROFS_FS_HAS_MANAGED_CACHE
struct address_space *const mngda = sbi->managed_cache->i_mapping;
@@ -1123,7 +1123,7 @@ static bool z_erofs_vle_submit_all(struct super_block *sb,
/* since bio will be NULL, no need to initialize last_index */
pgoff_t uninitialized_var(last_index);
bool force_submit = false;
- unsigned nr_bios;
+ unsigned int nr_bios;

if (unlikely(owned_head == Z_EROFS_VLE_WORKGRP_TAIL))
return false;
@@ -1155,7 +1155,7 @@ static bool z_erofs_vle_submit_all(struct super_block *sb,
struct z_erofs_vle_workgroup *grp;
struct page **compressed_pages, *oldpage, *page;
pgoff_t first_index;
- unsigned i = 0;
+ unsigned int i = 0;
#ifdef EROFS_FS_HAS_MANAGED_CACHE
unsigned int noio = 0;
bool cachemngd;
@@ -1343,7 +1343,7 @@ static int z_erofs_vle_normalaccess_readpage(struct file *file,
static inline int __z_erofs_vle_normalaccess_readpages(
struct file *filp,
struct address_space *mapping,
- struct list_head *pages, unsigned nr_pages, bool sync)
+ struct list_head *pages, unsigned int nr_pages, bool sync)
{
struct inode *const inode = mapping->host;

@@ -1406,7 +1406,7 @@ static inline int __z_erofs_vle_normalaccess_readpages(
static int z_erofs_vle_normalaccess_readpages(
struct file *filp,
struct address_space *mapping,
- struct list_head *pages, unsigned nr_pages)
+ struct list_head *pages, unsigned int nr_pages)
{
return __z_erofs_vle_normalaccess_readpages(filp,
mapping, pages, nr_pages,
@@ -1460,7 +1460,7 @@ vle_extent_blkaddr(struct inode *inode, pgoff_t index)
struct erofs_sb_info *sbi = EROFS_I_SB(inode);
struct erofs_vnode *vi = EROFS_V(inode);

- unsigned ofs = Z_EROFS_VLE_EXTENT_ALIGN(vi->inode_isize +
+ unsigned int ofs = Z_EROFS_VLE_EXTENT_ALIGN(vi->inode_isize +
vi->xattr_isize) + sizeof(struct erofs_extent_header) +
index * sizeof(struct z_erofs_vle_decompressed_index);

@@ -1473,7 +1473,7 @@ vle_extent_blkoff(struct inode *inode, pgoff_t index)
struct erofs_sb_info *sbi = EROFS_I_SB(inode);
struct erofs_vnode *vi = EROFS_V(inode);

- unsigned ofs = Z_EROFS_VLE_EXTENT_ALIGN(vi->inode_isize +
+ unsigned int ofs = Z_EROFS_VLE_EXTENT_ALIGN(vi->inode_isize +
vi->xattr_isize) + sizeof(struct erofs_extent_header) +
index * sizeof(struct z_erofs_vle_decompressed_index);

diff --git a/drivers/staging/erofs/utils.c b/drivers/staging/erofs/utils.c
index 595cf90af9bb..ddd220ac33fd 100644
--- a/drivers/staging/erofs/utils.c
+++ b/drivers/staging/erofs/utils.c
@@ -120,7 +120,7 @@ unsigned long erofs_shrink_workstation(struct erofs_sb_info *sbi,
{
pgoff_t first_index = 0;
void *batch[PAGEVEC_SIZE];
- unsigned freed = 0;
+ unsigned int freed = 0;

int i, found;
repeat:
diff --git a/drivers/staging/erofs/xattr.c b/drivers/staging/erofs/xattr.c
index 79d7fc8b7cc5..4942ca167957 100644
--- a/drivers/staging/erofs/xattr.c
+++ b/drivers/staging/erofs/xattr.c
@@ -19,7 +19,7 @@ struct xattr_iter {
void *kaddr;

erofs_blk_t blkaddr;
- unsigned ofs;
+ unsigned int ofs;
};

static inline void xattr_iter_end(struct xattr_iter *it, bool atomic)
@@ -45,7 +45,7 @@ static inline void xattr_iter_end_final(struct xattr_iter *it)
static int init_inode_xattrs(struct inode *inode)
{
struct xattr_iter it;
- unsigned i;
+ unsigned int i;
struct erofs_xattr_ibody_header *ih;
struct super_block *sb;
struct erofs_sb_info *sbi;
@@ -111,9 +111,9 @@ static int init_inode_xattrs(struct inode *inode)

struct xattr_iter_handlers {
int (*entry)(struct xattr_iter *, struct erofs_xattr_entry *);
- int (*name)(struct xattr_iter *, unsigned, char *, unsigned);
- int (*alloc_buffer)(struct xattr_iter *, unsigned);
- void (*value)(struct xattr_iter *, unsigned, char *, unsigned);
+ int (*name)(struct xattr_iter *, unsigned int, char *, unsigned int);
+ int (*alloc_buffer)(struct xattr_iter *, unsigned int);
+ void (*value)(struct xattr_iter *, unsigned int, char *, unsigned int);
};

static inline int xattr_iter_fixup(struct xattr_iter *it)
@@ -143,7 +143,7 @@ static int inline_xattr_iter_begin(struct xattr_iter *it,
{
struct erofs_vnode *const vi = EROFS_V(inode);
struct erofs_sb_info *const sbi = EROFS_SB(inode->i_sb);
- unsigned xattr_header_sz, inline_xattr_ofs;
+ unsigned int xattr_header_sz, inline_xattr_ofs;

xattr_header_sz = inlinexattr_header_size(inode);
if (unlikely(xattr_header_sz >= vi->xattr_isize)) {
@@ -168,7 +168,7 @@ static int xattr_foreach(struct xattr_iter *it,
const struct xattr_iter_handlers *op, unsigned int *tlimit)
{
struct erofs_xattr_entry entry;
- unsigned value_sz, processed, slice;
+ unsigned int value_sz, processed, slice;
int err;

/* 0. fixup blkaddr, ofs, ipage */
@@ -183,7 +183,7 @@ static int xattr_foreach(struct xattr_iter *it,
*/
entry = *(struct erofs_xattr_entry *)(it->kaddr + it->ofs);
if (tlimit != NULL) {
- unsigned entry_sz = EROFS_XATTR_ENTRY_SIZE(&entry);
+ unsigned int entry_sz = EROFS_XATTR_ENTRY_SIZE(&entry);

BUG_ON(*tlimit < entry_sz);
*tlimit -= entry_sz;
@@ -212,8 +212,8 @@ static int xattr_foreach(struct xattr_iter *it,
it->ofs = 0;
}

- slice = min_t(unsigned, PAGE_SIZE - it->ofs,
- entry.e_name_len - processed);
+ slice = min_t(unsigned int, PAGE_SIZE - it->ofs,
+ entry.e_name_len - processed);

/* handle name */
err = op->name(it, processed, it->kaddr + it->ofs, slice);
@@ -247,8 +247,8 @@ static int xattr_foreach(struct xattr_iter *it,
it->ofs = 0;
}

- slice = min_t(unsigned, PAGE_SIZE - it->ofs,
- value_sz - processed);
+ slice = min_t(unsigned int, PAGE_SIZE - it->ofs,
+ value_sz - processed);
op->value(it, processed, it->kaddr + it->ofs, slice);
it->ofs += slice;
processed += slice;
@@ -278,7 +278,7 @@ static int xattr_entrymatch(struct xattr_iter *_it,
}

static int xattr_namematch(struct xattr_iter *_it,
- unsigned processed, char *buf, unsigned len)
+ unsigned int processed, char *buf, unsigned int len)
{
struct getxattr_iter *it = container_of(_it, struct getxattr_iter, it);

@@ -286,7 +286,7 @@ static int xattr_namematch(struct xattr_iter *_it,
}

static int xattr_checkbuffer(struct xattr_iter *_it,
- unsigned value_sz)
+ unsigned int value_sz)
{
struct getxattr_iter *it = container_of(_it, struct getxattr_iter, it);
int err = it->buffer_size < value_sz ? -ERANGE : 0;
@@ -296,7 +296,7 @@ static int xattr_checkbuffer(struct xattr_iter *_it,
}

static void xattr_copyvalue(struct xattr_iter *_it,
- unsigned processed, char *buf, unsigned len)
+ unsigned int processed, char *buf, unsigned int len)
{
struct getxattr_iter *it = container_of(_it, struct getxattr_iter, it);

@@ -313,7 +313,7 @@ static const struct xattr_iter_handlers find_xattr_handlers = {
static int inline_getxattr(struct inode *inode, struct getxattr_iter *it)
{
int ret;
- unsigned remaining;
+ unsigned int remaining;

ret = inline_xattr_iter_begin(&it->it, inode);
if (ret < 0)
@@ -338,7 +338,7 @@ static int shared_getxattr(struct inode *inode, struct getxattr_iter *it)
struct erofs_vnode *const vi = EROFS_V(inode);
struct super_block *const sb = inode->i_sb;
struct erofs_sb_info *const sbi = EROFS_SB(sb);
- unsigned i;
+ unsigned int i;
int ret = -ENOATTR;

for (i = 0; i < vi->xattr_shared_count; ++i) {
@@ -489,7 +489,7 @@ static int xattr_entrylist(struct xattr_iter *_it,
{
struct listxattr_iter *it =
container_of(_it, struct listxattr_iter, it);
- unsigned prefix_len;
+ unsigned int prefix_len;
const char *prefix;

const struct xattr_handler *h =
@@ -517,7 +517,7 @@ static int xattr_entrylist(struct xattr_iter *_it,
}

static int xattr_namelist(struct xattr_iter *_it,
- unsigned processed, char *buf, unsigned len)
+ unsigned int processed, char *buf, unsigned int len)
{
struct listxattr_iter *it =
container_of(_it, struct listxattr_iter, it);
@@ -528,7 +528,7 @@ static int xattr_namelist(struct xattr_iter *_it,
}

static int xattr_skipvalue(struct xattr_iter *_it,
- unsigned value_sz)
+ unsigned int value_sz)
{
struct listxattr_iter *it =
container_of(_it, struct listxattr_iter, it);
@@ -547,7 +547,7 @@ static const struct xattr_iter_handlers list_xattr_handlers = {
static int inline_listxattr(struct listxattr_iter *it)
{
int ret;
- unsigned remaining;
+ unsigned int remaining;

ret = inline_xattr_iter_begin(&it->it, d_inode(it->dentry));
if (ret < 0)
@@ -569,7 +569,7 @@ static int shared_listxattr(struct listxattr_iter *it)
struct erofs_vnode *const vi = EROFS_V(inode);
struct super_block *const sb = inode->i_sb;
struct erofs_sb_info *const sbi = EROFS_SB(sb);
- unsigned i;
+ unsigned int i;
int ret = 0;

for (i = 0; i < vi->xattr_shared_count; ++i) {
--
2.18.0


2018-09-10 03:58:09

by Gao Xiang

[permalink] [raw]
Subject: Re: [PATCH] MAINTAINERS: add tree location for staging/erofs



On 2018/9/10 2:34, Thomas Weißschuh wrote:
> Hi Chao, hi Gao,
>
> On Sun, 2018-09-09T23:16+0800, Chao Yu wrote:
>> Hi Thomas,
>>
>> On 2018/9/8 11:28, Gao Xiang wrote:
>>> Hi Thomas,
>>>
>>> Thanks for your new patch.
>>>
>>> It seems that this patch also introduces 2 new 'WARNING: line over 80 characters',
>>> could you please fix it in the patch?
>
> @Chao,Gao: For some reason there seems to be a problem when receiving mails
> from you. The one I received now was the first one from you that reached me
> directly. Before I only got your messages in the quotes from Dan and now in the
> quotes from the mail I am responding to.
> (I will try to investigate the reason for this)
>
> Sorry for my slow responses before.
>
>> It will be better to fix that.
>
> A new patch will shortly follow.
>
>> Some reviewed cleanup patches are merged before this patch, then I failed to add
>> this one, so could you rebase on top of erofs dev branch in below link:
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git/log/?h=erofs
>
> I was not aware of this tree and worked off of staging / next.
> A patch is attached to this message that adds the tree to the MAINTAINERS file.

Hi Chao,

I think this tree has some PREVIEW patches which preview in linux-erofs mailing list only and
doesn't send to staging mailing list and LKML,

https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git/log/?h=erofs

so erofs tree is actually Greg's staging tree.

>
> -- >8 --
>
> Currently this location is not documented.
>
> Signed-off-by: Thomas Weißschuh <[email protected]>
> ---
> MAINTAINERS | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index a5b256b25905..9087e0b74821 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -13747,6 +13747,7 @@ F: drivers/staging/comedi/
> STAGING - EROFS FILE SYSTEM
> M: Gao Xiang <[email protected]>
> M: Chao Yu <[email protected]>
> +T: git git://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git erofs

Hi Thomas,
nope, the erofs tree is actually the same as staging tree, so any patch should be based
on Greg's upstream tree.

Thanks,
Gao Xiang

> L: [email protected]
> S: Maintained
> F: drivers/staging/erofs/
>

2018-09-10 08:12:10

by Greg Kroah-Hartman

[permalink] [raw]
Subject: Re: [PATCH v3] staging: erofs: use explicit unsigned int type

On Sun, Sep 09, 2018 at 08:37:53PM +0200, Thomas Wei?schuh wrote:
> Changes since v1:
>
> * Removed changes that conflicted with
> [PATCH 1/6] staging: erofs: formatting fix in unzip_vle_lz4.c
> * Added patch description
>
> Changes since v2:
>
> * Fixed conflicts with other patchsets
> * Don't introduce new style issues
>

These changes belong below the --- line, not above it. I'm not sure if
git will handle this line:

> -- >8 --

Correctly or not, have you tried it?

thanks,

greg k-h

2018-09-10 16:03:30

by Chao Yu

[permalink] [raw]
Subject: Re: [PATCH] MAINTAINERS: add tree location for staging/erofs

On 2018/9/10 11:56, Gao Xiang wrote:
>
>
> On 2018/9/10 2:34, Thomas Weißschuh wrote:
>> Hi Chao, hi Gao,
>>
>> On Sun, 2018-09-09T23:16+0800, Chao Yu wrote:
>>> Hi Thomas,
>>>
>>> On 2018/9/8 11:28, Gao Xiang wrote:
>>>> Hi Thomas,
>>>>
>>>> Thanks for your new patch.
>>>>
>>>> It seems that this patch also introduces 2 new 'WARNING: line over 80 characters',
>>>> could you please fix it in the patch?
>>
>> @Chao,Gao: For some reason there seems to be a problem when receiving mails
>> from you. The one I received now was the first one from you that reached me
>> directly. Before I only got your messages in the quotes from Dan and now in the
>> quotes from the mail I am responding to.
>> (I will try to investigate the reason for this)
>>
>> Sorry for my slow responses before.
>>
>>> It will be better to fix that.
>>
>> A new patch will shortly follow.
>>
>>> Some reviewed cleanup patches are merged before this patch, then I failed to add
>>> this one, so could you rebase on top of erofs dev branch in below link:
>>>
>>> https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git/log/?h=erofs
>>
>> I was not aware of this tree and worked off of staging / next.
>> A patch is attached to this message that adds the tree to the MAINTAINERS file.
>
> Hi Chao,
>
> I think this tree has some PREVIEW patches which preview in linux-erofs mailing list only and
> doesn't send to staging mailing list and LKML,
>
> https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git/log/?h=erofs
>
> so erofs tree is actually Greg's staging tree.

Thomas,

I confirmed that erofs git repository for linux upstream is Greg's staging tree.

Let me explain, in order to avoid sending buggy or preview patch, Xiang and me
plan to review patches in erofs mailing list first, and then cache reviewed
patches in my git tree before sending them to Greg and staging mailing list.

Based on that, I'm trying to serialize all erofs patches, expecting that can
help those patches sent to staging mailing list can be merged by Greg with
lesser conflict. But I made a mistake that my erofs branch has merged some
pending patches, result in failing to merge yours, that mislead me to ask you to
rebase the code, sorry about that.

Now I can confirm that your v2 patch can apply on Greg's staging-next, so fixing
warning reported by checkpatch.pl on your v2 patch is enough. :)

Thanks,

>
>>
>> -- >8 --
>>
>> Currently this location is not documented.
>>
>> Signed-off-by: Thomas Weißschuh <[email protected]>
>> ---
>> MAINTAINERS | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> diff --git a/MAINTAINERS b/MAINTAINERS
>> index a5b256b25905..9087e0b74821 100644
>> --- a/MAINTAINERS
>> +++ b/MAINTAINERS
>> @@ -13747,6 +13747,7 @@ F: drivers/staging/comedi/
>> STAGING - EROFS FILE SYSTEM
>> M: Gao Xiang <[email protected]>
>> M: Chao Yu <[email protected]>
>> +T: git git://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git erofs
>
> Hi Thomas,
> nope, the erofs tree is actually the same as staging tree, so any patch should be based
> on Greg's upstream tree.
>
> Thanks,
> Gao Xiang
>
>> L: [email protected]
>> S: Maintained
>> F: drivers/staging/erofs/
>>

2018-09-10 16:52:09

by Gao Xiang

[permalink] [raw]
Subject: Re: [PATCH] MAINTAINERS: add tree location for staging/erofs

Hi Thomas,

On 2018/9/10 23:59, Chao Yu wrote:
> On 2018/9/10 11:56, Gao Xiang wrote:
>>
>>
>> On 2018/9/10 2:34, Thomas Weißschuh wrote:
>>> Hi Chao, hi Gao,
>>>
>>> On Sun, 2018-09-09T23:16+0800, Chao Yu wrote:
>>>> Hi Thomas,
>>>>
>>>> On 2018/9/8 11:28, Gao Xiang wrote:
>>>>> Hi Thomas,
>>>>>
>>>>> Thanks for your new patch.
>>>>>
>>>>> It seems that this patch also introduces 2 new 'WARNING: line over 80 characters',
>>>>> could you please fix it in the patch?
>>>
>>> @Chao,Gao: For some reason there seems to be a problem when receiving mails
>>> from you. The one I received now was the first one from you that reached me
>>> directly. Before I only got your messages in the quotes from Dan and now in the
>>> quotes from the mail I am responding to.
>>> (I will try to investigate the reason for this)
>>>
>>> Sorry for my slow responses before.
>>>
>>>> It will be better to fix that.
>>>
>>> A new patch will shortly follow.
>>>
>>>> Some reviewed cleanup patches are merged before this patch, then I failed to add
>>>> this one, so could you rebase on top of erofs dev branch in below link:
>>>>
>>>> https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git/log/?h=erofs
>>>
>>> I was not aware of this tree and worked off of staging / next.
>>> A patch is attached to this message that adds the tree to the MAINTAINERS file.
>>
>> Hi Chao,
>>
>> I think this tree has some PREVIEW patches which preview in linux-erofs mailing list only and
>> doesn't send to staging mailing list and LKML,
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git/log/?h=erofs
>>
>> so erofs tree is actually Greg's staging tree.
>
> Thomas,
>
> I confirmed that erofs git repository for linux upstream is Greg's staging tree.
>
> Let me explain, in order to avoid sending buggy or preview patch, Xiang and me
> plan to review patches in erofs mailing list first, and then cache reviewed
> patches in my git tree before sending them to Greg and staging mailing list.
>
> Based on that, I'm trying to serialize all erofs patches, expecting that can
> help those patches sent to staging mailing list can be merged by Greg with
> lesser conflict. But I made a mistake that my erofs branch has merged some
> pending patches, result in failing to merge yours, that mislead me to ask you to
> rebase the code, sorry about that.

As Chao's said, we keep on fetching the latest Greg's staging tree and develop
, preview, and test new erofs features and bugfix based on it.

For the cleanup patches, it could be better directly based on Greg's upstream
staging tree. We will then rebase our developping code on your work. :)

>
> Now I can confirm that your v2 patch can apply on Greg's staging-next, so fixing
> warning reported by checkpatch.pl on your v2 patch is enough. :)

Yes, we are sorry about that. could you please send v4 patch which follows Greg's
and Chao's suggestions?

Thanks,
Gao Xiang

>
> Thanks,
>
>>
>>>
>>> -- >8 --
>>>
>>> Currently this location is not documented.
>>>
>>> Signed-off-by: Thomas Weißschuh <[email protected]>
>>> ---
>>> MAINTAINERS | 1 +
>>> 1 file changed, 1 insertion(+)
>>>
>>> diff --git a/MAINTAINERS b/MAINTAINERS
>>> index a5b256b25905..9087e0b74821 100644
>>> --- a/MAINTAINERS
>>> +++ b/MAINTAINERS
>>> @@ -13747,6 +13747,7 @@ F: drivers/staging/comedi/
>>> STAGING - EROFS FILE SYSTEM
>>> M: Gao Xiang <[email protected]>
>>> M: Chao Yu <[email protected]>
>>> +T: git git://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git erofs
>>
>> Hi Thomas,
>> nope, the erofs tree is actually the same as staging tree, so any patch should be based
>> on Greg's upstream tree.
>>
>> Thanks,
>> Gao Xiang
>>
>>> L: [email protected]
>>> S: Maintained
>>> F: drivers/staging/erofs/
>>>

2018-09-10 19:16:38

by Thomas Weißschuh

[permalink] [raw]
Subject: Re: [PATCH v3] staging: erofs: use explicit unsigned int type

Hi Greg,

On Mon, 2018-09-10T10:10+0200, Greg Kroah-Hartman wrote:
> On Sun, Sep 09, 2018 at 08:37:53PM +0200, Thomas Weißschuh wrote:
> > Changes since v1:
> >
> > * Removed changes that conflicted with
> > [PATCH 1/6] staging: erofs: formatting fix in unzip_vle_lz4.c
> > * Added patch description
> >
> > Changes since v2:
> >
> > * Fixed conflicts with other patchsets
> > * Don't introduce new style issues
> >
>
> These changes belong below the --- line, not above it. I'm not sure if
> git will handle this line:

>
> > -- >8 --

The patch was supposed to be applied with "git am --scissors".
To be honest, I am not sure if the scissors feature of git is to be used for
kernel development, or if I should have announced it.
If is not applicable I will be happy to resend the patch in another format.

The documentation for git-mailinfo(1) sounded it would fit my usecase perfectly:

...
This is useful if you want to begin your message in a discussion thread with comments and suggestions on the message you are responding to, and to conclude it with a
patch submission, separating the discussion and the beginning of the proposed commit log message with a scissors line.
...

> Correctly or not, have you tried it?

I tried to both apply and compile the patch, both succeeded.

Thomas

2018-09-10 19:42:56

by Thomas Weißschuh

[permalink] [raw]
Subject: [PATCH v4] staging: erofs: use explicit unsigned int type

Hi Chao,

On Mon, 2018-09-10T23:59+0800, Chao Yu wrote:
> [...]

>>> I was not aware of this tree and worked off of staging / next.
>>> A patch is attached to this message that adds the tree to the MAINTAINERS file.
>>
>> Hi Chao,
>>
>> I think this tree has some PREVIEW patches which preview in linux-erofs mailing list only and
>> doesn't send to staging mailing list and LKML,
>>
>> https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git/log/?h=erofs
>>
>> so erofs tree is actually Greg's staging tree.
>
> Thomas,
>
> I confirmed that erofs git repository for linux upstream is Greg's staging tree.
>
> Let me explain, in order to avoid sending buggy or preview patch, Xiang and me
> plan to review patches in erofs mailing list first, and then cache reviewed
> patches in my git tree before sending them to Greg and staging mailing list.
>
> Based on that, I'm trying to serialize all erofs patches, expecting that can
> help those patches sent to staging mailing list can be merged by Greg with
> lesser conflict. But I made a mistake that my erofs branch has merged some
> pending patches, result in failing to merge yours, that mislead me to ask you to
> rebase the code, sorry about that.

Thank you for clearing this up! And I am sorry for causing you all this work
for what is essentially a very small style cleanup.

> Now I can confirm that your v2 patch can apply on Greg's staging-next, so fixing
> warning reported by checkpatch.pl on your v2 patch is enough. :)

The patch follows.

Thomas


Changes since v1:

* Removed changes that conflicted with
[PATCH 1/6] staging: erofs: formatting fix in unzip_vle_lz4.c
* Added patch description

Changes since v2:

* Fixed conflicts with other patchsets
* Don't introduce new style issues

Changes since v3:

* Fixed conflicts with other patchsets

Note: This patchset should be applied with the "git am --scissors", to
remove the historic information and this note.

-- >8 --

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

Signed-off-by: Thomas Weißschuh <[email protected]>
---
drivers/staging/erofs/data.c | 4 +--
drivers/staging/erofs/dir.c | 15 +++++-----
drivers/staging/erofs/inode.c | 7 +++--
drivers/staging/erofs/namei.c | 28 +++++++++---------
drivers/staging/erofs/super.c | 2 +-
drivers/staging/erofs/unzip_vle.c | 48 +++++++++++++++----------------
drivers/staging/erofs/utils.c | 2 +-
drivers/staging/erofs/xattr.c | 44 ++++++++++++++--------------
8 files changed, 76 insertions(+), 74 deletions(-)

diff --git a/drivers/staging/erofs/data.c b/drivers/staging/erofs/data.c
index 3c0d9159514e..e1916101ad75 100644
--- a/drivers/staging/erofs/data.c
+++ b/drivers/staging/erofs/data.c
@@ -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 @@ static inline struct bio *erofs_read_raw_page(
.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))
diff --git a/drivers/staging/erofs/dir.c b/drivers/staging/erofs/dir.c
index be6ae3b1bdbe..d1cb0d78ab84 100644
--- a/drivers/staging/erofs/dir.c
+++ b/drivers/staging/erofs/dir.c
@@ -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)) {
diff --git a/drivers/staging/erofs/inode.c b/drivers/staging/erofs/inode.c
index fbf6ff25cd1b..c46a8d4c3b2c 100644
--- a/drivers/staging/erofs/inode.c
+++ b/drivers/staging/erofs/inode.c
@@ -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);

diff --git a/drivers/staging/erofs/namei.c b/drivers/staging/erofs/namei.c
index 546a47156101..0039b767afb3 100644
--- a/drivers/staging/erofs/namei.c
+++ b/drivers/staging/erofs/namei.c
@@ -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 @@ static struct page *find_target_block_classic(
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 @@ static struct page *find_target_block_classic(

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));
diff --git a/drivers/staging/erofs/super.c b/drivers/staging/erofs/super.c
index 1aec509c805f..5654cc7a5015 100644
--- a/drivers/staging/erofs/super.c
+++ b/drivers/staging/erofs/super.c
@@ -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);
diff --git a/drivers/staging/erofs/unzip_vle.c b/drivers/staging/erofs/unzip_vle.c
index 22f9a02a75f9..21874b79c434 100644
--- a/drivers/staging/erofs/unzip_vle.c
+++ b/drivers/staging/erofs/unzip_vle.c
@@ -27,7 +27,7 @@ void z_erofs_exit_zip_subsystem(void)

static inline int init_unzip_workqueue(void)
{
- const unsigned onlinecpus = num_possible_cpus();
+ const unsigned int onlinecpus = num_possible_cpus();

/*
* we don't need too many threads, limiting threads
@@ -89,7 +89,7 @@ struct z_erofs_vle_work_builder {

/* pages used for reading the compressed data */
struct page **compressed_pages;
- unsigned compressed_deficit;
+ unsigned int compressed_deficit;
};

#define VLE_WORK_BUILDER_INIT() \
@@ -232,7 +232,7 @@ static int z_erofs_vle_work_add_page(

ret = z_erofs_pagevec_ctor_enqueue(&builder->vector,
page, type, &occupied);
- builder->work->vcnt += (unsigned)ret;
+ builder->work->vcnt += (unsigned int)ret;

return ret ? 0 : -EAGAIN;
}
@@ -274,7 +274,7 @@ static inline bool try_to_claim_workgroup(
struct z_erofs_vle_work_finder {
struct super_block *sb;
pgoff_t idx;
- unsigned pageofs;
+ unsigned int pageofs;

struct z_erofs_vle_workgroup **grp_ret;
enum z_erofs_vle_work_role *role;
@@ -440,7 +440,7 @@ static int z_erofs_vle_work_iter_begin(struct z_erofs_vle_work_builder *builder,
struct erofs_map_blocks *map,
z_erofs_vle_owned_workgrp_t *owned_head)
{
- const unsigned clusterpages = erofs_clusterpages(EROFS_SB(sb));
+ const unsigned int clusterpages = erofs_clusterpages(EROFS_SB(sb));
struct z_erofs_vle_workgroup *grp;
const struct z_erofs_vle_work_finder finder = {
.sb = sb,
@@ -610,7 +610,7 @@ static int z_erofs_do_read_page(struct z_erofs_vle_frontend *fe,
#endif

enum z_erofs_page_type page_type;
- unsigned cur, end, spiltted, index;
+ unsigned int cur, end, spiltted, index;
int err;

/* register locked file pages as online pages in pack */
@@ -667,7 +667,7 @@ static int z_erofs_do_read_page(struct z_erofs_vle_frontend *fe,
tight &= builder_is_followed(builder);
work = builder->work;
hitted:
- cur = end - min_t(unsigned, offset + end - map->m_la, end);
+ cur = end - min_t(unsigned int, offset + end - map->m_la, end);
if (unlikely(!(map->m_flags & EROFS_MAP_MAPPED))) {
zero_user_segment(page, cur, end);
goto next_part;
@@ -741,7 +741,7 @@ static void z_erofs_vle_unzip_kickoff(void *ptr, int bios)
static inline void z_erofs_vle_read_endio(struct bio *bio)
{
const blk_status_t err = bio->bi_status;
- unsigned i;
+ unsigned int i;
struct bio_vec *bvec;
#ifdef EROFS_FS_HAS_MANAGED_CACHE
struct address_space *mngda = NULL;
@@ -793,16 +793,16 @@ static int z_erofs_vle_unzip(struct super_block *sb,
#ifdef EROFS_FS_HAS_MANAGED_CACHE
struct address_space *const mngda = sbi->managed_cache->i_mapping;
#endif
- const unsigned clusterpages = erofs_clusterpages(sbi);
+ const unsigned int clusterpages = erofs_clusterpages(sbi);

struct z_erofs_pagevec_ctor ctor;
- unsigned nr_pages;
+ unsigned int nr_pages;
#ifndef CONFIG_EROFS_FS_ZIP_MULTIREF
- unsigned sparsemem_pages = 0;
+ unsigned int sparsemem_pages = 0;
#endif
struct page *pages_onstack[Z_EROFS_VLE_VMAP_ONSTACK_PAGES];
struct page **pages, **compressed_pages, *page;
- unsigned i, llen;
+ unsigned int i, llen;

enum z_erofs_page_type page_type;
bool overlapped;
@@ -849,7 +849,7 @@ static int z_erofs_vle_unzip(struct super_block *sb,
Z_EROFS_VLE_INLINE_PAGEVECS, work->pagevec, 0);

for (i = 0; i < work->vcnt; ++i) {
- unsigned pagenr;
+ unsigned int pagenr;

page = z_erofs_pagevec_ctor_dequeue(&ctor, &page_type);

@@ -880,7 +880,7 @@ static int z_erofs_vle_unzip(struct super_block *sb,
compressed_pages = grp->compressed_pages;

for (i = 0; i < clusterpages; ++i) {
- unsigned pagenr;
+ unsigned int pagenr;

page = compressed_pages[i];

@@ -1105,7 +1105,7 @@ static bool z_erofs_vle_submit_all(struct super_block *sb,
bool force_fg)
{
struct erofs_sb_info *const sbi = EROFS_SB(sb);
- const unsigned clusterpages = erofs_clusterpages(sbi);
+ const unsigned int clusterpages = erofs_clusterpages(sbi);
const gfp_t gfp = GFP_NOFS;
#ifdef EROFS_FS_HAS_MANAGED_CACHE
struct address_space *const mngda = sbi->managed_cache->i_mapping;
@@ -1117,7 +1117,7 @@ static bool z_erofs_vle_submit_all(struct super_block *sb,
/* since bio will be NULL, no need to initialize last_index */
pgoff_t uninitialized_var(last_index);
bool force_submit = false;
- unsigned nr_bios;
+ unsigned int nr_bios;

if (unlikely(owned_head == Z_EROFS_VLE_WORKGRP_TAIL))
return false;
@@ -1149,7 +1149,7 @@ static bool z_erofs_vle_submit_all(struct super_block *sb,
struct z_erofs_vle_workgroup *grp;
struct page **compressed_pages, *oldpage, *page;
pgoff_t first_index;
- unsigned i = 0;
+ unsigned int i = 0;
#ifdef EROFS_FS_HAS_MANAGED_CACHE
unsigned int noio = 0;
bool cachemngd;
@@ -1337,7 +1337,7 @@ static int z_erofs_vle_normalaccess_readpage(struct file *file,
static inline int __z_erofs_vle_normalaccess_readpages(
struct file *filp,
struct address_space *mapping,
- struct list_head *pages, unsigned nr_pages, bool sync)
+ struct list_head *pages, unsigned int nr_pages, bool sync)
{
struct inode *const inode = mapping->host;

@@ -1398,7 +1398,7 @@ static inline int __z_erofs_vle_normalaccess_readpages(
static int z_erofs_vle_normalaccess_readpages(
struct file *filp,
struct address_space *mapping,
- struct list_head *pages, unsigned nr_pages)
+ struct list_head *pages, unsigned int nr_pages)
{
return __z_erofs_vle_normalaccess_readpages(filp,
mapping, pages, nr_pages,
@@ -1445,7 +1445,7 @@ vle_extent_blkaddr(struct inode *inode, pgoff_t index)
struct erofs_sb_info *sbi = EROFS_I_SB(inode);
struct erofs_vnode *vi = EROFS_V(inode);

- unsigned ofs = Z_EROFS_VLE_EXTENT_ALIGN(vi->inode_isize +
+ unsigned int ofs = Z_EROFS_VLE_EXTENT_ALIGN(vi->inode_isize +
vi->xattr_isize) + sizeof(struct erofs_extent_header) +
index * sizeof(struct z_erofs_vle_decompressed_index);

@@ -1458,7 +1458,7 @@ vle_extent_blkoff(struct inode *inode, pgoff_t index)
struct erofs_sb_info *sbi = EROFS_I_SB(inode);
struct erofs_vnode *vi = EROFS_V(inode);

- unsigned ofs = Z_EROFS_VLE_EXTENT_ALIGN(vi->inode_isize +
+ unsigned int ofs = Z_EROFS_VLE_EXTENT_ALIGN(vi->inode_isize +
vi->xattr_isize) + sizeof(struct erofs_extent_header) +
index * sizeof(struct z_erofs_vle_decompressed_index);

@@ -1476,9 +1476,9 @@ static erofs_off_t vle_get_logical_extent_head(
struct inode *inode,
struct page **page_iter,
void **kaddr_iter,
- unsigned lcn, /* logical cluster number */
+ unsigned int lcn, /* logical cluster number */
erofs_blk_t *pcn,
- unsigned *flags)
+ unsigned int *flags)
{
/* for extent meta */
struct page *page = *page_iter;
@@ -1531,7 +1531,7 @@ int z_erofs_map_blocks_iter(struct inode *inode,
unsigned long long ofs, end;
struct z_erofs_vle_decompressed_index *di;
erofs_blk_t e_blkaddr, pcn;
- unsigned lcn, logical_cluster_ofs, cluster_type;
+ unsigned int lcn, logical_cluster_ofs, cluster_type;
u32 ofs_rem;
struct page *mpage = *mpage_ret;
void *kaddr;
diff --git a/drivers/staging/erofs/utils.c b/drivers/staging/erofs/utils.c
index 595cf90af9bb..ddd220ac33fd 100644
--- a/drivers/staging/erofs/utils.c
+++ b/drivers/staging/erofs/utils.c
@@ -120,7 +120,7 @@ unsigned long erofs_shrink_workstation(struct erofs_sb_info *sbi,
{
pgoff_t first_index = 0;
void *batch[PAGEVEC_SIZE];
- unsigned freed = 0;
+ unsigned int freed = 0;

int i, found;
repeat:
diff --git a/drivers/staging/erofs/xattr.c b/drivers/staging/erofs/xattr.c
index 79d7fc8b7cc5..4942ca167957 100644
--- a/drivers/staging/erofs/xattr.c
+++ b/drivers/staging/erofs/xattr.c
@@ -19,7 +19,7 @@ struct xattr_iter {
void *kaddr;

erofs_blk_t blkaddr;
- unsigned ofs;
+ unsigned int ofs;
};

static inline void xattr_iter_end(struct xattr_iter *it, bool atomic)
@@ -45,7 +45,7 @@ static inline void xattr_iter_end_final(struct xattr_iter *it)
static int init_inode_xattrs(struct inode *inode)
{
struct xattr_iter it;
- unsigned i;
+ unsigned int i;
struct erofs_xattr_ibody_header *ih;
struct super_block *sb;
struct erofs_sb_info *sbi;
@@ -111,9 +111,9 @@ static int init_inode_xattrs(struct inode *inode)

struct xattr_iter_handlers {
int (*entry)(struct xattr_iter *, struct erofs_xattr_entry *);
- int (*name)(struct xattr_iter *, unsigned, char *, unsigned);
- int (*alloc_buffer)(struct xattr_iter *, unsigned);
- void (*value)(struct xattr_iter *, unsigned, char *, unsigned);
+ int (*name)(struct xattr_iter *, unsigned int, char *, unsigned int);
+ int (*alloc_buffer)(struct xattr_iter *, unsigned int);
+ void (*value)(struct xattr_iter *, unsigned int, char *, unsigned int);
};

static inline int xattr_iter_fixup(struct xattr_iter *it)
@@ -143,7 +143,7 @@ static int inline_xattr_iter_begin(struct xattr_iter *it,
{
struct erofs_vnode *const vi = EROFS_V(inode);
struct erofs_sb_info *const sbi = EROFS_SB(inode->i_sb);
- unsigned xattr_header_sz, inline_xattr_ofs;
+ unsigned int xattr_header_sz, inline_xattr_ofs;

xattr_header_sz = inlinexattr_header_size(inode);
if (unlikely(xattr_header_sz >= vi->xattr_isize)) {
@@ -168,7 +168,7 @@ static int xattr_foreach(struct xattr_iter *it,
const struct xattr_iter_handlers *op, unsigned int *tlimit)
{
struct erofs_xattr_entry entry;
- unsigned value_sz, processed, slice;
+ unsigned int value_sz, processed, slice;
int err;

/* 0. fixup blkaddr, ofs, ipage */
@@ -183,7 +183,7 @@ static int xattr_foreach(struct xattr_iter *it,
*/
entry = *(struct erofs_xattr_entry *)(it->kaddr + it->ofs);
if (tlimit != NULL) {
- unsigned entry_sz = EROFS_XATTR_ENTRY_SIZE(&entry);
+ unsigned int entry_sz = EROFS_XATTR_ENTRY_SIZE(&entry);

BUG_ON(*tlimit < entry_sz);
*tlimit -= entry_sz;
@@ -212,8 +212,8 @@ static int xattr_foreach(struct xattr_iter *it,
it->ofs = 0;
}

- slice = min_t(unsigned, PAGE_SIZE - it->ofs,
- entry.e_name_len - processed);
+ slice = min_t(unsigned int, PAGE_SIZE - it->ofs,
+ entry.e_name_len - processed);

/* handle name */
err = op->name(it, processed, it->kaddr + it->ofs, slice);
@@ -247,8 +247,8 @@ static int xattr_foreach(struct xattr_iter *it,
it->ofs = 0;
}

- slice = min_t(unsigned, PAGE_SIZE - it->ofs,
- value_sz - processed);
+ slice = min_t(unsigned int, PAGE_SIZE - it->ofs,
+ value_sz - processed);
op->value(it, processed, it->kaddr + it->ofs, slice);
it->ofs += slice;
processed += slice;
@@ -278,7 +278,7 @@ static int xattr_entrymatch(struct xattr_iter *_it,
}

static int xattr_namematch(struct xattr_iter *_it,
- unsigned processed, char *buf, unsigned len)
+ unsigned int processed, char *buf, unsigned int len)
{
struct getxattr_iter *it = container_of(_it, struct getxattr_iter, it);

@@ -286,7 +286,7 @@ static int xattr_namematch(struct xattr_iter *_it,
}

static int xattr_checkbuffer(struct xattr_iter *_it,
- unsigned value_sz)
+ unsigned int value_sz)
{
struct getxattr_iter *it = container_of(_it, struct getxattr_iter, it);
int err = it->buffer_size < value_sz ? -ERANGE : 0;
@@ -296,7 +296,7 @@ static int xattr_checkbuffer(struct xattr_iter *_it,
}

static void xattr_copyvalue(struct xattr_iter *_it,
- unsigned processed, char *buf, unsigned len)
+ unsigned int processed, char *buf, unsigned int len)
{
struct getxattr_iter *it = container_of(_it, struct getxattr_iter, it);

@@ -313,7 +313,7 @@ static const struct xattr_iter_handlers find_xattr_handlers = {
static int inline_getxattr(struct inode *inode, struct getxattr_iter *it)
{
int ret;
- unsigned remaining;
+ unsigned int remaining;

ret = inline_xattr_iter_begin(&it->it, inode);
if (ret < 0)
@@ -338,7 +338,7 @@ static int shared_getxattr(struct inode *inode, struct getxattr_iter *it)
struct erofs_vnode *const vi = EROFS_V(inode);
struct super_block *const sb = inode->i_sb;
struct erofs_sb_info *const sbi = EROFS_SB(sb);
- unsigned i;
+ unsigned int i;
int ret = -ENOATTR;

for (i = 0; i < vi->xattr_shared_count; ++i) {
@@ -489,7 +489,7 @@ static int xattr_entrylist(struct xattr_iter *_it,
{
struct listxattr_iter *it =
container_of(_it, struct listxattr_iter, it);
- unsigned prefix_len;
+ unsigned int prefix_len;
const char *prefix;

const struct xattr_handler *h =
@@ -517,7 +517,7 @@ static int xattr_entrylist(struct xattr_iter *_it,
}

static int xattr_namelist(struct xattr_iter *_it,
- unsigned processed, char *buf, unsigned len)
+ unsigned int processed, char *buf, unsigned int len)
{
struct listxattr_iter *it =
container_of(_it, struct listxattr_iter, it);
@@ -528,7 +528,7 @@ static int xattr_namelist(struct xattr_iter *_it,
}

static int xattr_skipvalue(struct xattr_iter *_it,
- unsigned value_sz)
+ unsigned int value_sz)
{
struct listxattr_iter *it =
container_of(_it, struct listxattr_iter, it);
@@ -547,7 +547,7 @@ static const struct xattr_iter_handlers list_xattr_handlers = {
static int inline_listxattr(struct listxattr_iter *it)
{
int ret;
- unsigned remaining;
+ unsigned int remaining;

ret = inline_xattr_iter_begin(&it->it, d_inode(it->dentry));
if (ret < 0)
@@ -569,7 +569,7 @@ static int shared_listxattr(struct listxattr_iter *it)
struct erofs_vnode *const vi = EROFS_V(inode);
struct super_block *const sb = inode->i_sb;
struct erofs_sb_info *const sbi = EROFS_SB(sb);
- unsigned i;
+ unsigned int i;
int ret = 0;

for (i = 0; i < vi->xattr_shared_count; ++i) {
--
2.18.0


2018-09-11 16:46:39

by Chao Yu

[permalink] [raw]
Subject: Re: [PATCH v4] staging: erofs: use explicit unsigned int type

On 2018/9/11 3:41, Thomas Weißschuh wrote:
> Hi Chao,
>
> On Mon, 2018-09-10T23:59+0800, Chao Yu wrote:
>> [...]
>
>>>> I was not aware of this tree and worked off of staging / next.
>>>> A patch is attached to this message that adds the tree to the MAINTAINERS file.
>>>
>>> Hi Chao,
>>>
>>> I think this tree has some PREVIEW patches which preview in linux-erofs mailing list only and
>>> doesn't send to staging mailing list and LKML,
>>>
>>> https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git/log/?h=erofs
>>>
>>> so erofs tree is actually Greg's staging tree.
>>
>> Thomas,
>>
>> I confirmed that erofs git repository for linux upstream is Greg's staging tree.
>>
>> Let me explain, in order to avoid sending buggy or preview patch, Xiang and me
>> plan to review patches in erofs mailing list first, and then cache reviewed
>> patches in my git tree before sending them to Greg and staging mailing list.
>>
>> Based on that, I'm trying to serialize all erofs patches, expecting that can
>> help those patches sent to staging mailing list can be merged by Greg with
>> lesser conflict. But I made a mistake that my erofs branch has merged some
>> pending patches, result in failing to merge yours, that mislead me to ask you to
>> rebase the code, sorry about that.
>
> Thank you for clearing this up! And I am sorry for causing you all this work
> for what is essentially a very small style cleanup.
>
>> Now I can confirm that your v2 patch can apply on Greg's staging-next, so fixing
>> warning reported by checkpatch.pl on your v2 patch is enough. :)
>
> The patch follows.
>
> Thomas
>
>
> Changes since v1:
>
> * Removed changes that conflicted with
> [PATCH 1/6] staging: erofs: formatting fix in unzip_vle_lz4.c
> * Added patch description
>
> Changes since v2:
>
> * Fixed conflicts with other patchsets
> * Don't introduce new style issues
>
> Changes since v3:
>
> * Fixed conflicts with other patchsets
>
> Note: This patchset should be applied with the "git am --scissors", to
> remove the historic information and this note.
>
> -- >8 --
>
> Fix coding style issue "Prefer 'unsigned int' to bare use of 'unsigned'"
> detected by checkpatch.pl.
>
> Signed-off-by: Thomas Weißschuh <[email protected]>

Reviewed-by: Chao Yu <[email protected]>

Thanks,

2018-09-12 06:22:35

by Gao Xiang

[permalink] [raw]
Subject: Re: [PATCH v4] staging: erofs: use explicit unsigned int type

Hi Thomas,

On 2018/9/11 3:41, Thomas Weißschuh wrote:
> Hi Chao,
>
> On Mon, 2018-09-10T23:59+0800, Chao Yu wrote:
>> [...]
>>>> I was not aware of this tree and worked off of staging / next.
>>>> A patch is attached to this message that adds the tree to the MAINTAINERS file.
>>> Hi Chao,
>>>
>>> I think this tree has some PREVIEW patches which preview in linux-erofs mailing list only and
>>> doesn't send to staging mailing list and LKML,
>>>
>>> https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git/log/?h=erofs
>>>
>>> so erofs tree is actually Greg's staging tree.
>> Thomas,
>>
>> I confirmed that erofs git repository for linux upstream is Greg's staging tree.
>>
>> Let me explain, in order to avoid sending buggy or preview patch, Xiang and me
>> plan to review patches in erofs mailing list first, and then cache reviewed
>> patches in my git tree before sending them to Greg and staging mailing list.
>>
>> Based on that, I'm trying to serialize all erofs patches, expecting that can
>> help those patches sent to staging mailing list can be merged by Greg with
>> lesser conflict. But I made a mistake that my erofs branch has merged some
>> pending patches, result in failing to merge yours, that mislead me to ask you to
>> rebase the code, sorry about that.
> Thank you for clearing this up! And I am sorry for causing you all this work
> for what is essentially a very small style cleanup.
>
>> Now I can confirm that your v2 patch can apply on Greg's staging-next, so fixing
>> warning reported by checkpatch.pl on your v2 patch is enough. :)
> The patch follows.
>
> Thomas

Could you please resend your patch seperately? Because it will be easier for Greg to merge.

>
>
> Changes since v1:
>
> * Removed changes that conflicted with
> [PATCH 1/6] staging: erofs: formatting fix in unzip_vle_lz4.c
> * Added patch description
>
> Changes since v2:
>
> * Fixed conflicts with other patchsets
> * Don't introduce new style issues
>
> Changes since v3:
>
> * Fixed conflicts with other patchsets
>
> Note: This patchset should be applied with the "git am --scissors", to
> remove the historic information and this note.
>
> -- >8 --

I personally think that is not the correct kernel patch style.

Just as Greg's said,
> These changes belong below the --- line, not above it.

LINK: https://lists.ozlabs.org/pipermail/linux-erofs/2018-August/000367.html

For reference, it will help the patch quickly get merged. ;)

and you could add,
Reviewed-by: Gao Xiang <[email protected]>

Thanks,
Gao Xiang

>
> Fix coding style issue "Prefer 'unsigned int' to bare use of 'unsigned'"
> detected by checkpatch.pl.
>
> Signed-off-by: Thomas Weißschuh <[email protected]>

2018-09-13 16:47:31

by Gao Xiang

[permalink] [raw]
Subject: Re: [PATCH v4] staging: erofs: use explicit unsigned int type

Hi Thomas,

ping...

On 2018/9/12 14:21, Gao Xiang wrote:
> Hi Thomas,
>
> On 2018/9/11 3:41, Thomas Weißschuh wrote:
>> Hi Chao,
>>
>> On Mon, 2018-09-10T23:59+0800, Chao Yu wrote:
>>> [...]
>>>>> I was not aware of this tree and worked off of staging / next.
>>>>> A patch is attached to this message that adds the tree to the MAINTAINERS file.
>>>> Hi Chao,
>>>>
>>>> I think this tree has some PREVIEW patches which preview in linux-erofs mailing list only and
>>>> doesn't send to staging mailing list and LKML,
>>>>
>>>> https://git.kernel.org/pub/scm/linux/kernel/git/chao/linux.git/log/?h=erofs
>>>>
>>>> so erofs tree is actually Greg's staging tree.
>>> Thomas,
>>>
>>> I confirmed that erofs git repository for linux upstream is Greg's staging tree.
>>>
>>> Let me explain, in order to avoid sending buggy or preview patch, Xiang and me
>>> plan to review patches in erofs mailing list first, and then cache reviewed
>>> patches in my git tree before sending them to Greg and staging mailing list.
>>>
>>> Based on that, I'm trying to serialize all erofs patches, expecting that can
>>> help those patches sent to staging mailing list can be merged by Greg with
>>> lesser conflict. But I made a mistake that my erofs branch has merged some
>>> pending patches, result in failing to merge yours, that mislead me to ask you to
>>> rebase the code, sorry about that.
>> Thank you for clearing this up! And I am sorry for causing you all this work
>> for what is essentially a very small style cleanup.
>>
>>> Now I can confirm that your v2 patch can apply on Greg's staging-next, so fixing
>>> warning reported by checkpatch.pl on your v2 patch is enough. :)
>> The patch follows.
>>
>> Thomas
>
> Could you please resend your patch seperately? Because it will be easier for Greg to merge.
>
>>
>>
>> Changes since v1:
>>
>> * Removed changes that conflicted with
>> [PATCH 1/6] staging: erofs: formatting fix in unzip_vle_lz4.c
>> * Added patch description
>>
>> Changes since v2:
>>
>> * Fixed conflicts with other patchsets
>> * Don't introduce new style issues
>>
>> Changes since v3:
>>
>> * Fixed conflicts with other patchsets
>>
>> Note: This patchset should be applied with the "git am --scissors", to
>> remove the historic information and this note.
>>
>> -- >8 --
>
> I personally think that is not the correct kernel patch style.
>
> Just as Greg's said,
>> These changes belong below the --- line, not above it.
>
> LINK: https://lists.ozlabs.org/pipermail/linux-erofs/2018-August/000367.html
>
> For reference, it will help the patch quickly get merged. ;)
>
> and you could add,
> Reviewed-by: Gao Xiang <[email protected]>
>
> Thanks,
> Gao Xiang
>

and HUAWEI email server cannot send my all emails to your mailbox successfully.
Since you change a lot of files,I need to rebase my rest preview patches one by one right now.

Could you please resend a acceptable independent final patch for Greg? :)

Thanks,
Gao Xiang

>>
>> Fix coding style issue "Prefer 'unsigned int' to bare use of 'unsigned'"
>> detected by checkpatch.pl.
>>
>> Signed-off-by: Thomas Weißschuh <[email protected]>
> _______________________________________________
> devel mailing list
> [email protected]
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
>