From: "Pranay Kr. Srivastava" <pranjas@gmail.com>
To: mpa@pengutronix.de, nbd-general@lists.sourceforge.net,
linux-kernel@vger.kernel.org
Cc: "Pranay Kr. Srivastava" <pranjas@gmail.com>
Subject: [PATCH 2/4] fix various coding standard warnings
Date: Tue, 24 May 2016 14:26:26 +0300 [thread overview]
Message-ID: <1464089188-6155-3-git-send-email-pranjas@gmail.com> (raw)
In-Reply-To: <1464089188-6155-1-git-send-email-pranjas@gmail.com>
1 )nbd: fix checkpatch trailing space warning.
2) nbd: fix checkpatch warning use linux/uaccess.h
3) nbd : fix checkpatch pointer declaration warning
4) nbd: fix checkpatch warning no newline after decleration.
5) nbd: fix checkpatch warning no newline after decleration.
6) nbd : fix checkpatch line over 80 char warning
7) nbd: fix checkpatch trailing whitespace warning.
8) nbd: fix checkpatch trailing whitespace warning.
9) nbd : fix checkpatch structure declaration braces on next line warning.
10) nbd : fix checkpatch trailing whitespace warning
11) nbd : fix checkpatch printk warning
12) nbd: fix checkpatch no extra line after decleration warning
13) nbd: fix checkpatch printk warning to pr_info
14) nbd: fix checkpatch no new line after decleration warning
15) nbd: fix checkpatch printk warning to pr_info
Signed-off-by: Pranay Kr. Srivastava <pranjas@gmail.com>
---
drivers/block/nbd.c | 29 ++++++++++++++++-------------
1 file changed, 16 insertions(+), 13 deletions(-)
diff --git a/drivers/block/nbd.c b/drivers/block/nbd.c
index a5dab48..af86c9b 100644
--- a/drivers/block/nbd.c
+++ b/drivers/block/nbd.c
@@ -3,7 +3,7 @@
*
* Note that you can not swap over this thing, yet. Seems to work but
* deadlocks sometimes - you can not swap over TCP in general.
- *
+ *
* Copyright 1997-2000, 2008 Pavel Machek <pavel@ucw.cz>
* Parts copyright 2001 Steven Whitehouse <steve@chygwyn.com>
*
@@ -35,7 +35,7 @@
#include <linux/types.h>
#include <linux/debugfs.h>
-#include <asm/uaccess.h>
+#include <linux/uaccess.h>
#include <asm/types.h>
#include <linux/nbd.h>
@@ -43,7 +43,7 @@
struct nbd_device {
u32 flags;
- struct socket * sock; /* If == NULL, device is not ready, yet */
+ struct socket *sock; /* If == NULL, device is not ready, yet */
int magic;
spinlock_t queue_lock;
@@ -261,6 +261,7 @@ static inline int sock_send_bvec(struct nbd_device *nbd, struct bio_vec *bvec,
{
int result;
void *kaddr = kmap(bvec->bv_page);
+
result = sock_xmit(nbd, 1, kaddr + bvec->bv_offset,
bvec->bv_len, flags);
kunmap(bvec->bv_page);
@@ -358,6 +359,7 @@ static inline int sock_recv_bvec(struct nbd_device *nbd, struct bio_vec *bvec)
{
int result;
void *kaddr = kmap(bvec->bv_page);
+
result = sock_xmit(nbd, 0, kaddr + bvec->bv_offset, bvec->bv_len,
MSG_WAITALL);
kunmap(bvec->bv_page);
@@ -600,8 +602,8 @@ static int nbd_thread_send(void *data)
}
/*
- * We always wait for result of write, for now. It would be nice to make it optional
- * in future
+ * We always wait for result of write, for now. It would be nice to make it
+ * optional in future
* if ((rq_data_dir(req) == WRITE) && (nbd->flags & NBD_WRITE_NOCHK))
* { printk( "Warning: Ignoring result!\n"); nbd_end_request( req ); }
*/
@@ -610,7 +612,7 @@ static void nbd_request_handler(struct request_queue *q)
__releases(q->queue_lock) __acquires(q->queue_lock)
{
struct request *req;
-
+
while ((req = blk_fetch_request(q)) != NULL) {
struct nbd_device *nbd;
@@ -729,7 +731,7 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd,
nbd_send_req(nbd, &sreq);
return 0;
}
-
+
case NBD_CLEAR_SOCK:
sock_shutdown(nbd);
nbd_clear_que(nbd);
@@ -856,8 +858,7 @@ static int nbd_ioctl(struct block_device *bdev, fmode_t mode,
return error;
}
-static const struct block_device_operations nbd_fops =
-{
+static const struct block_device_operations nbd_fops = {
.owner = THIS_MODULE,
.ioctl = nbd_ioctl,
.compat_ioctl = nbd_ioctl,
@@ -1000,7 +1001,7 @@ static void nbd_dbg_close(void)
#endif
/*
- * And here should be modules and kernel interface
+ * And here should be modules and kernel interface
* (Just smiley confuses emacs :-)
*/
@@ -1013,7 +1014,7 @@ static int __init nbd_init(void)
BUILD_BUG_ON(sizeof(struct nbd_request) != 28);
if (max_part < 0) {
- printk(KERN_ERR "nbd: max_part must be >= 0\n");
+ pr_err("nbd: max_part must be >= 0\n");
return -EINVAL;
}
@@ -1044,6 +1045,7 @@ static int __init nbd_init(void)
for (i = 0; i < nbds_max; i++) {
struct gendisk *disk = alloc_disk(1 << part_shift);
+
if (!disk)
goto out;
nbd_dev[i].disk = disk;
@@ -1074,12 +1076,13 @@ static int __init nbd_init(void)
goto out;
}
- printk(KERN_INFO "nbd: registered device at major %d\n", NBD_MAJOR);
+ pr_info("nbd: registered device at major %d\n", NBD_MAJOR);
nbd_dbg_init();
for (i = 0; i < nbds_max; i++) {
struct gendisk *disk = nbd_dev[i].disk;
+
nbd_dev[i].magic = NBD_MAGIC;
INIT_LIST_HEAD(&nbd_dev[i].waiting_queue);
spin_lock_init(&nbd_dev[i].queue_lock);
@@ -1127,7 +1130,7 @@ static void __exit nbd_cleanup(void)
}
unregister_blkdev(NBD_MAJOR, "nbd");
kfree(nbd_dev);
- printk(KERN_INFO "nbd: unregistered device at major %d\n", NBD_MAJOR);
+ pr_info("nbd: unregistered device at major %d\n", NBD_MAJOR);
}
module_init(nbd_init);
--
1.7.9.5
next prev parent reply other threads:[~2016-05-24 11:26 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-24 11:26 [PATCH 0/4]nbd: fixes for nbd Pranay Kr. Srivastava
2016-05-24 11:26 ` [PATCH 1/4] fix might_sleep warning on socket shutdown Pranay Kr. Srivastava
2016-05-30 12:06 ` Markus Pargmann
2016-05-24 11:26 ` Pranay Kr. Srivastava [this message]
2016-05-24 11:26 ` [PATCH 3/4] make nbd device wait for its users Pranay Kr. Srivastava
2016-05-30 10:44 ` Markus Pargmann
2016-05-24 11:26 ` [PATCH 4/4] use device_attr macros for sysfs attribute Pranay Kr. Srivastava
2016-05-30 3:35 ` [PATCH 0/4]nbd: fixes for nbd Pranay Srivastava
2016-05-30 12:27 ` Markus Pargmann
2016-06-02 10:24 ` [PATCH v2 0/5] nbd: " Pranay Kr. Srivastava
2016-06-02 10:24 ` [PATCH v2 1/5] nbd: fix might_sleep warning on socket shutdown Pranay Kr. Srivastava
2016-06-09 10:03 ` Pranay Srivastava
2016-06-14 5:13 ` Pranay Srivastava
2016-06-14 8:52 ` Markus Pargmann
2016-06-14 9:50 ` Pranay Srivastava
2016-06-24 10:09 ` [PATCH v3 0/3] nbd: resolve bugs and limitations Pranay Kr. Srivastava
2016-06-24 10:09 ` [PATCH v3 1/3]nbd: fix might_sleep warning on socket shutdown Pranay Kr. Srivastava
2016-06-28 5:42 ` Pranay Srivastava
2016-06-29 7:18 ` Markus Pargmann
2016-06-24 10:09 ` [PATCH v3 2/3]nbd: cleanup nbd_set_socket Pranay Kr. Srivastava
2016-06-24 10:09 ` [PATCH 3/3]nbd: make nbd device wait for its users Pranay Kr. Srivastava
2016-06-24 13:42 ` [Nbd] " Eric Blake
2016-06-25 17:56 ` Pranay Srivastava
2016-06-25 18:01 ` Pranay Srivastava
2016-06-29 7:06 ` Markus Pargmann
2016-06-29 7:15 ` Pranay Srivastava
2016-06-02 10:24 ` [PATCH v2 2/5]nbd: cleanup nbd_set_socket Pranay Kr. Srivastava
2016-06-02 10:24 ` [PATCH v2 3/5]nbd: fix various coding standard warnings Pranay Kr. Srivastava
2016-06-02 10:25 ` [PATCH v2 4/5]nbd: make nbd device wait for its users Pranay Kr. Srivastava
2016-06-14 8:59 ` Markus Pargmann
2016-06-14 9:33 ` Pranay Srivastava
2016-06-15 6:30 ` Markus Pargmann
2016-06-15 7:00 ` [Nbd] " Wouter Verhelst
2016-06-15 9:18 ` Pranay Srivastava
2016-06-15 9:17 ` Pranay Srivastava
2016-06-24 9:29 ` [PATCH 1/2] nbd: " Markus Pargmann
2016-06-24 9:29 ` [PATCH 2/2] nbd: Disallow ioctls on disconnected block device Markus Pargmann
2016-07-16 7:42 ` Pranay Srivastava
2016-07-16 9:32 ` [Nbd] " Alex Bligh
2016-07-16 10:08 ` Pranay Srivastava
2016-07-16 11:26 ` Wouter Verhelst
2016-07-16 13:31 ` Pranay Srivastava
2016-06-24 9:39 ` [PATCH 1/2] nbd: make nbd device wait for its users Pranay Srivastava
2016-06-24 13:40 ` [Nbd] " Eric Blake
2016-06-25 17:52 ` Pranay Srivastava
2016-06-29 6:57 ` Markus Pargmann
2016-06-02 10:25 ` [PATCH v2 5/5]nbd: use device_attr macros for sysfs attribute Pranay Kr. Srivastava
[not found] ` <CA+aCy1E0S4ofa04xcO9qxQmuipaF5wdnrv3ubSvETn-rBYYisA@mail.gmail.com>
2016-06-06 11:07 ` [PATCH 0/4]nbd: fixes for nbd Pranay Srivastava
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=1464089188-6155-3-git-send-email-pranjas@gmail.com \
--to=pranjas@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mpa@pengutronix.de \
--cc=nbd-general@lists.sourceforge.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;
as well as URLs for NNTP newsgroup(s).