mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Steffen Vogel <post@steffenvogel.de>
To: linux-kernel@vger.kernel.org
Cc: Evgeniy Polyakov <zbr@ioremap.net>, Steffen Vogel <post@steffenvogel.de>
Subject: [PATCH 4/9] w1: cleanup whitespaces according to coding style document
Date: Sun, 28 Oct 2018 23:09:23 +0100	[thread overview]
Message-ID: <20181028220927.56227-5-post@steffenvogel.de> (raw)
In-Reply-To: <20181028220927.56227-1-post@steffenvogel.de>

These changes fix several warnings emitted by the checkpatch tool.

Signed-off-by: Steffen Vogel <post@steffenvogel.de>
---
 drivers/w1/w1.c         | 20 +++++++++-----------
 drivers/w1/w1_family.c  |  2 +-
 drivers/w1/w1_io.c      | 17 +++++++++--------
 drivers/w1/w1_netlink.c |  2 +-
 4 files changed, 20 insertions(+), 21 deletions(-)

diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index 812186ce35d6..f64da16dbec9 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -775,7 +775,7 @@ int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn)
 	spin_lock(&w1_flock);
 	f = w1_family_registered(rn->family);
 	if (!f) {
-		f= &w1_default_family;
+		f = &w1_default_family;
 		dev_info(&dev->dev, "Family %x for %02x.%012llx.%02x is not registered.\n",
 			  rn->family, rn->family,
 			  (unsigned long long)rn->id, rn->crc);
@@ -997,7 +997,7 @@ void w1_search(struct w1_master *dev, u8 search_type,
 
 	desc_bit = 64;
 
-	while ( !last_device && (slave_count++ < dev->max_slave_count) ) {
+	while (!last_device && (slave_count++ < dev->max_slave_count)) {
 		last_rn = rn;
 		rn = 0;
 
@@ -1045,7 +1045,7 @@ void w1_search(struct w1_master *dev, u8 search_type,
 			triplet_ret = w1_triplet(dev, search_bit);
 
 			/* quit if no device responded */
-			if ( (triplet_ret & 0x03) == 0x03 )
+			if ((triplet_ret & 0x03) == 0x03)
 				break;
 
 			/* If both directions were valid, and we took the 0 path */
@@ -1064,13 +1064,12 @@ void w1_search(struct w1_master *dev, u8 search_type,
 		}
 		mutex_unlock(&dev->bus_mutex);
 
-		if ( (triplet_ret & 0x03) != 0x03 ) {
+		if ((triplet_ret & 0x03) != 0x03) {
 			if ((desc_bit == last_zero) || (last_zero < 0)) {
 				last_device = 1;
 				dev->search_id = 0;
-			} else {
+			} else
 				dev->search_id = rn;
-			}
 			desc_bit = last_zero;
 			cb(dev, rn);
 		}
@@ -1109,8 +1108,7 @@ void w1_search_process_cb(struct w1_master *dev, u8 search_type,
 			mutex_unlock(&dev->list_mutex);
 			w1_slave_detach(sl);
 			mutex_lock(&dev->list_mutex);
-		}
-		else if (test_bit(W1_SLAVE_ACTIVE, &sl->flags))
+		} else if (test_bit(W1_SLAVE_ACTIVE, &sl->flags))
 			sl->ttl = dev->slave_ttl;
 	}
 	mutex_unlock(&dev->list_mutex);
@@ -1142,7 +1140,8 @@ int w1_process_callbacks(struct w1_master *dev)
 		list_for_each_entry_safe(async_cmd, async_n, &dev->async_list,
 			async_entry) {
 			/* drop the lock, if it is a search it can take a long
-			 * time */
+			 * time
+			 */
 			mutex_unlock(&dev->list_mutex);
 			async_cmd->cb(dev, async_cmd);
 			ret = 1;
@@ -1199,8 +1198,7 @@ int w1_process(void *data)
 			if (!jremain)
 				jremain = jtime;
 			jremain = schedule_timeout(jremain);
-		}
-		else
+		} else
 			schedule();
 	}
 
diff --git a/drivers/w1/w1_family.c b/drivers/w1/w1_family.c
index ee90a6733472..5abbeb86de6e 100644
--- a/drivers/w1/w1_family.c
+++ b/drivers/w1/w1_family.c
@@ -83,7 +83,7 @@ EXPORT_SYMBOL(w1_unregister_family);
 /*
  * Should be called under w1_flock held.
  */
-struct w1_family * w1_family_registered(u8 fid)
+struct w1_family *w1_family_registered(u8 fid)
 {
 	struct list_head *ent, *n;
 	struct w1_family *f = NULL;
diff --git a/drivers/w1/w1_io.c b/drivers/w1/w1_io.c
index 2626a61852e9..283c89708c7c 100644
--- a/drivers/w1/w1_io.c
+++ b/drivers/w1/w1_io.c
@@ -140,13 +140,13 @@ void w1_write_8(struct w1_master *dev, u8 byte)
 	if (dev->bus_master->write_byte) {
 		w1_pre_write(dev);
 		dev->bus_master->write_byte(dev->bus_master->data, byte);
-	}
-	else
+	} else {
 		for (i = 0; i < 8; ++i) {
 			if (i == 7)
 				w1_pre_write(dev);
 			w1_touch_bit(dev, (byte >> i) & 0x1);
 		}
+	}
 	w1_post_write(dev);
 }
 EXPORT_SYMBOL_GPL(w1_write_8);
@@ -236,9 +236,10 @@ u8 w1_read_8(struct w1_master *dev)
 
 	if (dev->bus_master->read_byte)
 		res = dev->bus_master->read_byte(dev->bus_master->data);
-	else
+	else {
 		for (i = 0; i < 8; ++i)
-			res |= (w1_touch_bit(dev,1) << i);
+			res |= (w1_touch_bit(dev, 1) << i);
+	}
 
 	return res;
 }
@@ -257,10 +258,10 @@ void w1_write_block(struct w1_master *dev, const u8 *buf, int len)
 	if (dev->bus_master->write_block) {
 		w1_pre_write(dev);
 		dev->bus_master->write_block(dev->bus_master->data, buf, len);
-	}
-	else
+	} else {
 		for (i = 0; i < len; ++i)
 			w1_write_8(dev, buf[i]); /* calls w1_pre_write */
+	}
 	w1_post_write(dev);
 }
 EXPORT_SYMBOL_GPL(w1_write_block);
@@ -358,7 +359,7 @@ int w1_reset_bus(struct w1_master *dev)
 }
 EXPORT_SYMBOL_GPL(w1_reset_bus);
 
-u8 w1_calc_crc8(u8 * data, int len)
+u8 w1_calc_crc8(u8 *data, int len)
 {
 	u8 crc = 0;
 
@@ -400,7 +401,7 @@ int w1_reset_select_slave(struct w1_slave *sl)
 		w1_write_8(sl->master, W1_SKIP_ROM);
 	else {
 		u8 match[9] = {W1_MATCH_ROM, };
-		u64 rn = le64_to_cpu(*((u64*)&sl->reg_num));
+		u64 rn = le64_to_cpu(*((u64 *)&sl->reg_num));
 
 		memcpy(&match[1], &rn, 8);
 		w1_write_block(sl->master, match, 9);
diff --git a/drivers/w1/w1_netlink.c b/drivers/w1/w1_netlink.c
index ff858bf4a94d..b0c7abddd091 100644
--- a/drivers/w1/w1_netlink.c
+++ b/drivers/w1/w1_netlink.c
@@ -606,7 +606,7 @@ static void w1_cn_callback(struct cn_msg *cn, struct netlink_skb_parms *nsp)
 		 * space for replies which is the original message size plus
 		 * space for any list slave data and status messages
 		 * cn->len doesn't include itself which is part of the block
-		 * */
+		 */
 		size =  /* block + original message */
 			sizeof(struct w1_cb_block) + sizeof(*cn) + cn->len +
 			/* space for nodes */
-- 
2.11.0


  parent reply	other threads:[~2018-10-28 22:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-28 22:09 w1: coding style and checkpatch fixes Steffen Vogel
2018-10-28 22:09 ` [PATCH 1/9] w1: add SPDX identifiers Steffen Vogel
2018-10-28 22:09 ` [PATCH 2/9] w1: improve coding style by following strict 80 column line limit Steffen Vogel
2018-10-28 23:03   ` Joe Perches
2018-10-28 22:09 ` [PATCH 3/9] w1: add newlines after declarations Steffen Vogel
2018-10-28 22:09 ` Steffen Vogel [this message]
2018-10-28 22:09 ` [PATCH 5/9] w1: use octal numbers instead of macros for file mode Steffen Vogel
2018-10-29 13:46   ` Sebastian Reichel
2018-10-28 22:09 ` [PATCH 6/9] w1: do not log errors about failed memory allocations Steffen Vogel
2018-10-28 22:09 ` [PATCH 7/9] w1: use __func__ for logging the function name Steffen Vogel
2018-10-28 22:09 ` [PATCH 8/9] w1: fix whitespaces of struct declarations Steffen Vogel
2018-10-29  1:52   ` Joe Perches
2018-10-29  2:02     ` Steffen Vogel
2018-10-29  2:04       ` Joe Perches
2018-10-28 22:09 ` [PATCH 9/9] w1: using linux instead of asm prefix for includes Steffen Vogel
2018-10-28 22:53 ` w1: coding style and checkpatch fixes Linus Torvalds
2018-10-29  0:29   ` Steffen Vogel
2018-10-29  1:31     ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181028220927.56227-5-post@steffenvogel.de \
    --to=post@steffenvogel.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zbr@ioremap.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®