diff options
Diffstat (limited to 'drivers/staging/lustre/lnet/libcfs/libcfs_lock.c')
-rw-r--r-- | drivers/staging/lustre/lnet/libcfs/libcfs_lock.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/drivers/staging/lustre/lnet/libcfs/libcfs_lock.c b/drivers/staging/lustre/lnet/libcfs/libcfs_lock.c index 83543f928279..1967b97c4afc 100644 --- a/drivers/staging/lustre/lnet/libcfs/libcfs_lock.c +++ b/drivers/staging/lustre/lnet/libcfs/libcfs_lock.c @@ -52,9 +52,9 @@ struct cfs_percpt_lock * cfs_percpt_lock_create(struct cfs_cpt_table *cptab, struct lock_class_key *keys) { - struct cfs_percpt_lock *pcl; - spinlock_t *lock; - int i; + struct cfs_percpt_lock *pcl; + spinlock_t *lock; + int i; /* NB: cptab can be NULL, pcl will be for HW CPUs on that case */ LIBCFS_ALLOC(pcl, sizeof(*pcl)); @@ -73,7 +73,7 @@ cfs_percpt_lock_create(struct cfs_cpt_table *cptab, cfs_percpt_for_each(lock, i, pcl->pcl_locks) { spin_lock_init(lock); - if (keys != NULL) + if (keys) lockdep_set_class(lock, &keys[i]); } @@ -94,8 +94,8 @@ void cfs_percpt_lock(struct cfs_percpt_lock *pcl, int index) __acquires(pcl->pcl_locks) { - int ncpt = cfs_cpt_number(pcl->pcl_cptab); - int i; + int ncpt = cfs_cpt_number(pcl->pcl_cptab); + int i; LASSERT(index >= CFS_PERCPT_LOCK_EX && index < ncpt); @@ -114,7 +114,7 @@ cfs_percpt_lock(struct cfs_percpt_lock *pcl, int index) /* exclusive lock request */ for (i = 0; i < ncpt; i++) { spin_lock(pcl->pcl_locks[i]); - if (i == 0) { + if (!i) { LASSERT(!pcl->pcl_locked); /* nobody should take private lock after this * so I wouldn't starve for too long time @@ -130,8 +130,8 @@ void cfs_percpt_unlock(struct cfs_percpt_lock *pcl, int index) __releases(pcl->pcl_locks) { - int ncpt = cfs_cpt_number(pcl->pcl_cptab); - int i; + int ncpt = cfs_cpt_number(pcl->pcl_cptab); + int i; index = ncpt == 1 ? 0 : index; @@ -141,7 +141,7 @@ cfs_percpt_unlock(struct cfs_percpt_lock *pcl, int index) } for (i = ncpt - 1; i >= 0; i--) { - if (i == 0) { + if (!i) { LASSERT(pcl->pcl_locked); pcl->pcl_locked = 0; } |