Skip to content

Commit

Permalink
staging/lustre: Convert all bare unsigned to unsigned int
Browse files Browse the repository at this point in the history
Highlighted by relatively new checkpatch test, warnings like:
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'

Signed-off-by: Oleg Drokin <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
verygreen authored and gregkh committed Dec 7, 2016
1 parent 6b02ac3 commit 8dde068
Show file tree
Hide file tree
Showing 17 changed files with 83 additions and 80 deletions.
6 changes: 3 additions & 3 deletions drivers/staging/lustre/include/linux/lnet/lnetst.h
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ typedef struct {
int lstio_ses_timeout; /* IN: session timeout */
int lstio_ses_force; /* IN: force create ? */
/** IN: session features */
unsigned lstio_ses_feats;
unsigned int lstio_ses_feats;
lst_sid_t __user *lstio_ses_idp; /* OUT: session id */
int lstio_ses_nmlen; /* IN: name length */
char __user *lstio_ses_namep; /* IN: session name */
Expand All @@ -255,7 +255,7 @@ typedef struct {
lst_sid_t __user *lstio_ses_idp; /* OUT: session id */
int __user *lstio_ses_keyp; /* OUT: local key */
/** OUT: session features */
unsigned __user *lstio_ses_featp;
unsigned int __user *lstio_ses_featp;
lstcon_ndlist_ent_t __user *lstio_ses_ndinfo; /* OUT: */
int lstio_ses_nmlen; /* IN: name length */
char __user *lstio_ses_namep; /* OUT: session name */
Expand Down Expand Up @@ -328,7 +328,7 @@ typedef struct {
char __user *lstio_grp_namep; /* IN: group name */
int lstio_grp_count; /* IN: # of nodes */
/** OUT: session features */
unsigned __user *lstio_grp_featp;
unsigned int __user *lstio_grp_featp;
lnet_process_id_t __user *lstio_grp_idsp; /* IN: nodes */
struct list_head __user *lstio_grp_resultp; /* OUT: list head of
result buffer */
Expand Down
3 changes: 2 additions & 1 deletion drivers/staging/lustre/lustre/include/lprocfs_status.h
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,8 @@ lprocfs_alloc_stats(unsigned int num, enum lprocfs_stats_flags flags);
void lprocfs_clear_stats(struct lprocfs_stats *stats);
void lprocfs_free_stats(struct lprocfs_stats **stats);
void lprocfs_counter_init(struct lprocfs_stats *stats, int index,
unsigned conf, const char *name, const char *units);
unsigned int conf, const char *name,
const char *units);
struct obd_export;
int lprocfs_exp_cleanup(struct obd_export *exp);
struct dentry *ldebugfs_add_simple(struct dentry *root,
Expand Down
8 changes: 4 additions & 4 deletions drivers/staging/lustre/lustre/ldlm/ldlm_resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,8 @@ static struct ldlm_resource *ldlm_resource_getref(struct ldlm_resource *res)
return res;
}

static unsigned ldlm_res_hop_hash(struct cfs_hash *hs,
const void *key, unsigned mask)
static unsigned int ldlm_res_hop_hash(struct cfs_hash *hs,
const void *key, unsigned int mask)
{
const struct ldlm_res_id *id = key;
unsigned int val = 0;
Expand All @@ -457,8 +457,8 @@ static unsigned ldlm_res_hop_hash(struct cfs_hash *hs,
return val & mask;
}

static unsigned ldlm_res_hop_fid_hash(struct cfs_hash *hs,
const void *key, unsigned mask)
static unsigned int ldlm_res_hop_fid_hash(struct cfs_hash *hs,
const void *key, unsigned int mask)
{
const struct ldlm_res_id *id = key;
struct lu_fid fid;
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/lustre/lustre/llite/llite_nfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ static int ll_encode_fh(struct inode *inode, __u32 *fh, int *plen,

static int ll_nfs_get_name_filldir(struct dir_context *ctx, const char *name,
int namelen, loff_t hash, u64 ino,
unsigned type)
unsigned int type)
{
/* It is hack to access lde_fid for comparison with lgd_fid.
* So the input 'name' must be part of the 'lu_dirent'.
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/lustre/lustre/llite/rw26.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ static int ll_prepare_partial_page(const struct lu_env *env, struct cl_io *io,
}

static int ll_write_begin(struct file *file, struct address_space *mapping,
loff_t pos, unsigned len, unsigned flags,
loff_t pos, unsigned int len, unsigned int flags,
struct page **pagep, void **fsdata)
{
struct ll_cl_context *lcc;
Expand Down Expand Up @@ -577,7 +577,7 @@ static int ll_write_end(struct file *file, struct address_space *mapping,
struct cl_io *io;
struct vvp_io *vio;
struct cl_page *page;
unsigned from = pos & (PAGE_SIZE - 1);
unsigned int from = pos & (PAGE_SIZE - 1);
bool unplug = false;
int result = 0;

Expand Down
6 changes: 3 additions & 3 deletions drivers/staging/lustre/lustre/llite/xattr_cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ struct ll_xattr_entry {
*/
char *xe_name; /* xattr name, \0-terminated */
char *xe_value; /* xattr value */
unsigned xe_namelen; /* strlen(xe_name) + 1 */
unsigned xe_vallen; /* xattr value length */
unsigned int xe_namelen; /* strlen(xe_name) + 1 */
unsigned int xe_vallen; /* xattr value length */
};

static struct kmem_cache *xattr_kmem;
Expand Down Expand Up @@ -104,7 +104,7 @@ static int ll_xattr_cache_find(struct list_head *cache,
static int ll_xattr_cache_add(struct list_head *cache,
const char *xattr_name,
const char *xattr_val,
unsigned xattr_val_len)
unsigned int xattr_val_len)
{
struct ll_xattr_entry *xattr;

Expand Down
3 changes: 2 additions & 1 deletion drivers/staging/lustre/lustre/lov/lov_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ static void lov_pool_putref_locked(struct pool_desc *pool)
* Chapter 6.4.
* Addison Wesley, 1973
*/
static __u32 pool_hashfn(struct cfs_hash *hash_body, const void *key, unsigned mask)
static __u32 pool_hashfn(struct cfs_hash *hash_body, const void *key,
unsigned int mask)
{
int i;
__u32 result;
Expand Down
3 changes: 2 additions & 1 deletion drivers/staging/lustre/lustre/obdclass/lprocfs_status.c
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,8 @@ int ldebugfs_register_stats(struct dentry *parent, const char *name,
EXPORT_SYMBOL_GPL(ldebugfs_register_stats);

void lprocfs_counter_init(struct lprocfs_stats *stats, int index,
unsigned conf, const char *name, const char *units)
unsigned int conf, const char *name,
const char *units)
{
struct lprocfs_counter_header *header;
struct lprocfs_counter *percpu_cntr;
Expand Down
6 changes: 3 additions & 3 deletions drivers/staging/lustre/lustre/obdclass/lu_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -914,8 +914,8 @@ static unsigned long lu_htable_order(struct lu_device *top)
return clamp_t(typeof(bits), bits, LU_SITE_BITS_MIN, bits_max);
}

static unsigned lu_obj_hop_hash(struct cfs_hash *hs,
const void *key, unsigned mask)
static unsigned int lu_obj_hop_hash(struct cfs_hash *hs,
const void *key, unsigned int mask)
{
struct lu_fid *fid = (struct lu_fid *)key;
__u32 hash;
Expand Down Expand Up @@ -1324,7 +1324,7 @@ static atomic_t lu_key_initing_cnt = ATOMIC_INIT(0);
* lu_context_refill(). No locking is provided, as initialization and shutdown
* are supposed to be externally serialized.
*/
static unsigned key_set_version;
static unsigned int key_set_version;

/**
* Register new key.
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/lustre/lustre/obdclass/obd_config.c
Original file line number Diff line number Diff line change
Expand Up @@ -1450,8 +1450,8 @@ EXPORT_SYMBOL(class_manual_cleanup);
* uuid<->export lustre hash operations
*/

static unsigned
uuid_hash(struct cfs_hash *hs, const void *key, unsigned mask)
static unsigned int
uuid_hash(struct cfs_hash *hs, const void *key, unsigned int mask)
{
return cfs_hash_djb2_hash(((struct obd_uuid *)key)->uuid,
sizeof(((struct obd_uuid *)key)->uuid), mask);
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/lustre/lustre/osc/osc_lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ static void osc_lock_lvb_update(const struct lu_env *env,
struct cl_object *obj = osc2cl(osc);
struct lov_oinfo *oinfo = osc->oo_oinfo;
struct cl_attr *attr = &osc_env_info(env)->oti_attr;
unsigned valid;
unsigned int valid;

valid = CAT_BLOCKS | CAT_ATIME | CAT_CTIME | CAT_MTIME | CAT_SIZE;
if (!lvb)
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/lustre/lustre/osc/osc_quota.c
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,8 @@ int osc_quota_setdq(struct client_obd *cli, const unsigned int qid[],
/*
* Hash operations for uid/gid <-> osc_quota_info
*/
static unsigned
oqi_hashfn(struct cfs_hash *hs, const void *key, unsigned mask)
static unsigned int
oqi_hashfn(struct cfs_hash *hs, const void *key, unsigned int mask)
{
return cfs_hash_u32_hash(*((__u32 *)key), mask);
}
Expand Down
6 changes: 3 additions & 3 deletions drivers/staging/lustre/lustre/osc/osc_request.c
Original file line number Diff line number Diff line change
Expand Up @@ -908,9 +908,9 @@ static int check_write_rcs(struct ptlrpc_request *req,
static inline int can_merge_pages(struct brw_page *p1, struct brw_page *p2)
{
if (p1->flag != p2->flag) {
unsigned mask = ~(OBD_BRW_FROM_GRANT | OBD_BRW_NOCACHE |
OBD_BRW_SYNC | OBD_BRW_ASYNC |
OBD_BRW_NOQUOTA | OBD_BRW_SOFT_SYNC);
unsigned int mask = ~(OBD_BRW_FROM_GRANT | OBD_BRW_NOCACHE |
OBD_BRW_SYNC | OBD_BRW_ASYNC |
OBD_BRW_NOQUOTA | OBD_BRW_SOFT_SYNC);

/* warn if we try to combine flags that we don't know to be
* safe to combine
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/lustre/lustre/ptlrpc/connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ void ptlrpc_connection_fini(void)
/*
* Hash operations for net_peer<->connection
*/
static unsigned
conn_hashfn(struct cfs_hash *hs, const void *key, unsigned mask)
static unsigned int
conn_hashfn(struct cfs_hash *hs, const void *key, unsigned int mask)
{
return cfs_hash_djb2_hash(key, sizeof(lnet_process_id_t), mask);
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/staging/lustre/lustre/ptlrpc/lproc_ptlrpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -479,8 +479,8 @@ static int ptlrpc_lprocfs_nrs_seq_show(struct seq_file *m, void *n)
struct ptlrpc_nrs_policy *policy;
struct ptlrpc_nrs_pol_info *infos;
struct ptlrpc_nrs_pol_info tmp;
unsigned num_pols;
unsigned pol_idx = 0;
unsigned int num_pols;
unsigned int pol_idx = 0;
bool hp = false;
int i;
int rc = 0;
Expand Down
6 changes: 3 additions & 3 deletions drivers/staging/lustre/lustre/ptlrpc/service.c
Original file line number Diff line number Diff line change
Expand Up @@ -343,9 +343,9 @@ ptlrpc_server_nthreads_check(struct ptlrpc_service *svc,
struct ptlrpc_service_conf *conf)
{
struct ptlrpc_service_thr_conf *tc = &conf->psc_thr;
unsigned init;
unsigned total;
unsigned nthrs;
unsigned int init;
unsigned int total;
unsigned int nthrs;
int weight;

/*
Expand Down
Loading

0 comments on commit 8dde068

Please sign in to comment.