Skip to contentSkip to conversation

Staging: lustre: lnet: libcfs: Fixed checkpatch.pl coding style errors

PATCH New Oleg Drokin 1 participant 1 message Mar 29, 2017 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/1 Staging: lustre: lnet: libcfs: Fixed checkpatch.pl coding style errors

Quoted 18 lines · On Mar 28, 2017, at 6:10 AM, <[email protected]> <[email protected]>…

From: Vaibhav Kothari <[email protected]>

Shifted open brace { to previous line for 8 functions as indicated by checkpatch.pl

---
drivers/staging/lustre/lnet/libcfs/hash.c | 43 +++++++++++--------------------

1 file changed, 15 insertions(+), 28 deletions(-)
drivers/staging/lustre/lnet/libcfs/hash.c +0 -0
index 5c2ce2e..bb966e2 100644
@@ -1348,8 +1348,7 @@ void cfs_hash_putref(struct cfs_hash *hs)
 EXPORT_SYMBOL(cfs_hash_lookup);
 

static void

drivers/staging/lustre/lnet/libcfs/hash.c

Quoted 3 lines
drivers/staging/lustre/lnet/libcfs/hash.c +1 -2
-cfs_hash_for_each_enter(struct cfs_hash *hs)
-{
+cfs_hash_for_each_enter(struct cfs_hash *hs) {

Ugh, no.
This is obviously a false positive in checkpatch.

Quoted 132 lines
	LASSERT(!cfs_hash_is_exiting(hs));

	if (!cfs_hash_with_rehash(hs))
drivers/staging/lustre/lnet/libcfs/hash.c +0 -0
@@ -1375,8 +1374,7 @@ void cfs_hash_putref(struct cfs_hash *hs)
 }
 

static void

drivers/staging/lustre/lnet/libcfs/hash.c +1 -2
-cfs_hash_for_each_exit(struct cfs_hash *hs)
-{
+cfs_hash_for_each_exit(struct cfs_hash *hs) {
	int remained;
	int bits;
drivers/staging/lustre/lnet/libcfs/hash.c +0 -0
@@ -1407,8 +1405,7 @@ void cfs_hash_putref(struct cfs_hash *hs)
 */

static u64
cfs_hash_for_each_tight(struct cfs_hash *hs, cfs_hash_for_each_cb_t func,

drivers/staging/lustre/lnet/libcfs/hash.c +1 -2
-			void *data, int remove_safe)
-{
+			void *data, int remove_safe) {
	struct hlist_node *hnode;
	struct hlist_node *pos;
	struct cfs_hash_bd bd;
drivers/staging/lustre/lnet/libcfs/hash.c +0 -0
@@ -1465,8 +1462,7 @@ struct cfs_hash_cond_arg {
 

static int
cfs_hash_cond_del_locked(struct cfs_hash *hs, struct cfs_hash_bd *bd,

drivers/staging/lustre/lnet/libcfs/hash.c +1 -2
-			 struct hlist_node *hnode, void *data)
-{
+			 struct hlist_node *hnode, void *data) {
	struct cfs_hash_cond_arg *cond = data;

	if (cond->func(cfs_hash_object(hs, hnode), cond->arg))
drivers/staging/lustre/lnet/libcfs/hash.c +0 -0
@@ -1480,8 +1476,8 @@ struct cfs_hash_cond_arg {
 * any object be reference.
 */

void

drivers/staging/lustre/lnet/libcfs/hash.c +2 -2
-cfs_hash_cond_del(struct cfs_hash *hs, cfs_hash_cond_opt_cb_t func, void *data)
-{
+cfs_hash_cond_del(struct cfs_hash *hs, cfs_hash_cond_opt_cb_t func,
+		void *data) {
	struct cfs_hash_cond_arg arg = {
		.func	= func,
		.arg	= data,
drivers/staging/lustre/lnet/libcfs/hash.c +0 -0
@@ -1493,31 +1489,27 @@ struct cfs_hash_cond_arg {
 

void
cfs_hash_for_each(struct cfs_hash *hs, cfs_hash_for_each_cb_t func,

drivers/staging/lustre/lnet/libcfs/hash.c +1 -2
-		  void *data)
-{
+		  void *data) {
	cfs_hash_for_each_tight(hs, func, data, 0);
}

EXPORT_SYMBOL(cfs_hash_for_each);

void
cfs_hash_for_each_safe(struct cfs_hash *hs, cfs_hash_for_each_cb_t func,

drivers/staging/lustre/lnet/libcfs/hash.c +1 -2
-		       void *data)
-{
+		       void *data) {
	cfs_hash_for_each_tight(hs, func, data, 1);
}

EXPORT_SYMBOL(cfs_hash_for_each_safe);

static int
cfs_hash_peek(struct cfs_hash *hs, struct cfs_hash_bd *bd,

drivers/staging/lustre/lnet/libcfs/hash.c +1 -2
-	      struct hlist_node *hnode, void *data)
-{
+	      struct hlist_node *hnode, void *data) {
	*(int *)data = 0;
	return 1; /* return 1 to break the loop */
}

int

drivers/staging/lustre/lnet/libcfs/hash.c +1 -2
-cfs_hash_is_empty(struct cfs_hash *hs)
-{
+cfs_hash_is_empty(struct cfs_hash *hs) {
	int empty = 1;

	cfs_hash_for_each_tight(hs, cfs_hash_peek, &empty, 0);
drivers/staging/lustre/lnet/libcfs/hash.c +0 -0
@@ -1526,8 +1518,7 @@ struct cfs_hash_cond_arg {
 EXPORT_SYMBOL(cfs_hash_is_empty);
 

u64

drivers/staging/lustre/lnet/libcfs/hash.c +1 -2
-cfs_hash_size_get(struct cfs_hash *hs)
-{
+cfs_hash_size_get(struct cfs_hash *hs) {
	return cfs_hash_with_counter(hs) ?
	       atomic_read(&hs->hs_count) :
	       cfs_hash_for_each_tight(hs, NULL, NULL, 0);
drivers/staging/lustre/lnet/libcfs/hash.c +0 -0
@@ -1551,8 +1542,7 @@ struct cfs_hash_cond_arg {
 */

static int
cfs_hash_for_each_relax(struct cfs_hash *hs, cfs_hash_for_each_cb_t func,

drivers/staging/lustre/lnet/libcfs/hash.c +1 -2
-			void *data, int start)
-{
+			void *data, int start) {
	struct hlist_node *hnode;
	struct hlist_node *tmp;
	struct cfs_hash_bd bd;
drivers/staging/lustre/lnet/libcfs/hash.c +0 -0
@@ -1629,8 +1619,7 @@ struct cfs_hash_cond_arg {
 

int
cfs_hash_for_each_nolock(struct cfs_hash *hs, cfs_hash_for_each_cb_t func,

drivers/staging/lustre/lnet/libcfs/hash.c +1 -2
-			 void *data, int start)
-{
+			 void *data, int start) {
	if (cfs_hash_with_no_lock(hs) ||
	    cfs_hash_with_rehash_key(hs) ||
	    !cfs_hash_with_no_itemref(hs))
drivers/staging/lustre/lnet/libcfs/hash.c +0 -0
@@ -1661,8 +1650,7 @@ struct cfs_hash_cond_arg {
 */

int
cfs_hash_for_each_empty(struct cfs_hash *hs, cfs_hash_for_each_cb_t func,

drivers/staging/lustre/lnet/libcfs/hash.c +1 -2
-			void *data)
-{
+			void *data) {
	unsigned int i = 0;

	if (cfs_hash_with_no_lock(hs))
drivers/staging/lustre/lnet/libcfs/hash.c +0 -0
@@ -1718,8 +1706,7 @@ struct cfs_hash_cond_arg {
 */

void
cfs_hash_for_each_key(struct cfs_hash *hs, const void *key,

drivers/staging/lustre/lnet/libcfs/hash.c +1 -2
-		      cfs_hash_for_each_cb_t func, void *data)
-{
+		      cfs_hash_for_each_cb_t func, void *data) {
	struct hlist_node *hnode;
	struct cfs_hash_bd bds[2];
	unsigned int i;
Signature · 1 line
1.9.1