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 3/9] w1: add newlines after declarations
Date: Sun, 28 Oct 2018 23:09:22 +0100	[thread overview]
Message-ID: <20181028220927.56227-4-post@steffenvogel.de> (raw)
In-Reply-To: <20181028220927.56227-1-post@steffenvogel.de>

This satisfies a checkpatch warning

Signed-off-by: Steffen Vogel <post@steffenvogel.de>
---
 drivers/w1/w1.c         | 23 +++++++++++++++++++++++
 drivers/w1/w1_netlink.c |  7 +++++++
 2 files changed, 30 insertions(+)

diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index bd95dfe4041d..812186ce35d6 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -130,6 +130,7 @@ static ssize_t rw_write(struct file *filp, struct kobject *kobj,
 
 out_up:
 	mutex_unlock(&sl->master->mutex);
+
 	return count;
 }
 
@@ -142,6 +143,7 @@ static ssize_t rw_read(struct file *filp, struct kobject *kobj,
 	mutex_lock(&sl->master->mutex);
 	w1_read_block(sl->master, buf, count);
 	mutex_unlock(&sl->master->mutex);
+
 	return count;
 }
 
@@ -297,6 +299,7 @@ static ssize_t w1_master_attribute_show_pointer(struct device *dev,
 	mutex_lock(&md->mutex);
 	count = sprintf(buf, "0x%p\n", md->bus_master);
 	mutex_unlock(&md->mutex);
+
 	return count;
 }
 
@@ -304,7 +307,9 @@ static ssize_t w1_master_attribute_show_timeout(struct device *dev,
 	struct device_attribute *attr, char *buf)
 {
 	ssize_t count;
+
 	count = sprintf(buf, "%d\n", w1_timeout);
+
 	return count;
 }
 
@@ -312,7 +317,9 @@ static ssize_t w1_master_attribute_show_timeout_us(struct device *dev,
 	struct device_attribute *attr, char *buf)
 {
 	ssize_t count;
+
 	count = sprintf(buf, "%d\n", w1_timeout_us);
+
 	return count;
 }
 
@@ -369,6 +376,7 @@ static ssize_t w1_master_attribute_show_slave_count(struct device *dev,
 	mutex_lock(&md->mutex);
 	count = sprintf(buf, "%d\n", md->slave_count);
 	mutex_unlock(&md->mutex);
+
 	return count;
 }
 
@@ -399,8 +407,10 @@ static ssize_t w1_master_attribute_show_add(struct device *dev,
 	struct device_attribute *attr, char *buf)
 {
 	int c = PAGE_SIZE;
+
 	c -= snprintf(buf+PAGE_SIZE - c, c,
 		"write device id xx-xxxxxxxxxxxx to add slave\n");
+
 	return PAGE_SIZE - c;
 }
 
@@ -449,6 +459,7 @@ struct w1_slave *w1_slave_search_device(struct w1_master *dev,
 	struct w1_reg_num *rn)
 {
 	struct w1_slave *sl;
+
 	mutex_lock(&dev->list_mutex);
 	list_for_each_entry(sl, &dev->slist, w1_slave_entry) {
 		if (sl->reg_num.family == rn->family &&
@@ -459,6 +470,7 @@ struct w1_slave *w1_slave_search_device(struct w1_master *dev,
 		}
 	}
 	mutex_unlock(&dev->list_mutex);
+
 	return NULL;
 }
 
@@ -495,8 +507,10 @@ static ssize_t w1_master_attribute_show_remove(struct device *dev,
 	struct device_attribute *attr, char *buf)
 {
 	int c = PAGE_SIZE;
+
 	c -= snprintf(buf+PAGE_SIZE - c, c,
 		"write device id xx-xxxxxxxxxxxx to remove slave\n");
+
 	return PAGE_SIZE - c;
 }
 
@@ -674,6 +688,7 @@ static int w1_family_notify(unsigned long action, struct w1_slave *sl)
 			sysfs_remove_groups(&sl->dev.kobj, fops->groups);
 		break;
 	}
+
 	return 0;
 }
 
@@ -709,6 +724,7 @@ static int __w1_attach_slave_device(struct w1_slave *sl)
 			"Device registration [%s] failed. err=%d\n",
 			dev_name(&sl->dev), err);
 		put_device(&sl->dev);
+
 		return err;
 	}
 	w1_family_notify(BUS_NOTIFY_ADD_DEVICE, sl);
@@ -777,6 +793,7 @@ int w1_attach_slave_device(struct w1_master *dev, struct w1_reg_num *rn)
 		w1_family_put(sl->family);
 		atomic_dec(&sl->master->refcnt);
 		kfree(sl);
+
 		return err;
 	}
 
@@ -793,6 +810,7 @@ int w1_unref_slave(struct w1_slave *sl)
 {
 	struct w1_master *dev = sl->master;
 	int refcnt;
+
 	mutex_lock(&dev->list_mutex);
 	refcnt = atomic_sub_return(1, &sl->refcnt);
 	if (refcnt == 0) {
@@ -817,6 +835,7 @@ int w1_unref_slave(struct w1_slave *sl)
 	}
 	atomic_dec(&dev->refcnt);
 	mutex_unlock(&dev->list_mutex);
+
 	return refcnt;
 }
 
@@ -824,6 +843,7 @@ int w1_slave_detach(struct w1_slave *sl)
 {
 	/* Only detach a slave once as it decreases the refcnt each time. */
 	int destroy_now;
+
 	mutex_lock(&sl->master->list_mutex);
 	destroy_now = !test_bit(W1_SLAVE_DETACH, &sl->flags);
 	set_bit(W1_SLAVE_DETACH, &sl->flags);
@@ -831,6 +851,7 @@ int w1_slave_detach(struct w1_slave *sl)
 
 	if (destroy_now)
 		destroy_now = !w1_unref_slave(sl);
+
 	return destroy_now ? 0 : -EBUSY;
 }
 
@@ -996,6 +1017,7 @@ void w1_search(struct w1_master *dev, u8 search_type,
 		/* Do fast search on single slave bus */
 		if (dev->max_slave_count == 1) {
 			int rv;
+
 			w1_write_8(dev, W1_READ_ROM);
 			rv = w1_read_block(dev, (u8 *)&rn, 8);
 			mutex_unlock(&dev->bus_mutex);
@@ -1127,6 +1149,7 @@ int w1_process_callbacks(struct w1_master *dev)
 			mutex_lock(&dev->list_mutex);
 		}
 	}
+
 	return ret;
 }
 
diff --git a/drivers/w1/w1_netlink.c b/drivers/w1/w1_netlink.c
index 54a82bf69566..ff858bf4a94d 100644
--- a/drivers/w1/w1_netlink.c
+++ b/drivers/w1/w1_netlink.c
@@ -63,6 +63,7 @@ static void w1_unref_block(struct w1_cb_block *block)
 {
 	if (atomic_sub_return(1, &block->refcnt) == 0) {
 		u16 len = w1_reply_len(block);
+
 		if (len) {
 			cn_netlink_send_mult(block->first_cn, len,
 				block->portid, 0, GFP_KERNEL);
@@ -137,6 +138,7 @@ static void w1_netlink_queue_cmd(struct w1_cb_block *block,
 	struct w1_netlink_cmd *cmd)
 {
 	u32 space;
+
 	w1_reply_make_space(block, sizeof(struct cn_msg) +
 		sizeof(struct w1_netlink_msg) + sizeof(*cmd) + cmd->len);
 
@@ -165,6 +167,7 @@ static void w1_netlink_queue_status(struct w1_cb_block *block,
 	int error)
 {
 	u16 space = sizeof(struct cn_msg) + sizeof(*req_msg) + sizeof(*req_cmd);
+
 	w1_reply_make_space(block, space);
 	w1_netlink_setup_msg(block, block->request_cn.ack);
 
@@ -276,6 +279,7 @@ static int w1_get_slaves(struct w1_master *dev, struct w1_netlink_cmd *req_cmd)
 
 	if (req_cmd->cmd == W1_CMD_LIST_SLAVES) {
 		u64 rn;
+
 		mutex_lock(&dev->list_mutex);
 		list_for_each_entry(sl, &dev->slist, w1_slave_entry) {
 			memcpy(&rn, &sl->reg_num, sizeof(rn));
@@ -508,6 +512,7 @@ static void w1_list_count_cmds(struct w1_netlink_msg *msg, int *cmd_count,
 	u16 mlen = msg->len;
 	u16 len;
 	int slave_list = 0;
+
 	while (mlen) {
 		if (cmd->len + sizeof(struct w1_netlink_cmd) > mlen)
 			break;
@@ -526,6 +531,7 @@ static void w1_list_count_cmds(struct w1_netlink_msg *msg, int *cmd_count,
 
 	if (slave_list) {
 		struct w1_master *dev = w1_search_master_id(msg->id.mst.id);
+
 		if (dev) {
 			/* Bytes, and likely an overstimate, and if it isn't
 			 * the results can still be split between packets.
@@ -586,6 +592,7 @@ static void w1_cn_callback(struct cn_msg *cn, struct netlink_skb_parms *nsp)
 	if (node_count) {
 		int size;
 		int reply_size = sizeof(*cn) + cn->len + slave_len;
+
 		if (cn->flags & W1_CN_BUNDLE) {
 			/* bundling duplicats some of the messages */
 			reply_size += 2 * cmd_count * (sizeof(struct cn_msg) +
-- 
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 ` Steffen Vogel [this message]
2018-10-28 22:09 ` [PATCH 4/9] w1: cleanup whitespaces according to coding style document Steffen Vogel
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-4-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®