Re: [PATCH] Fixed a functions to rbd.c

From: Ozgur Karatas
Date: Sat Nov 26 2016 - 09:49:18 EST


Hello all,

I fixed to checkpatch.pl error and fixed two errors.

static char* obj_op_name(enum obj_operation_type op_type)
static bool single_major = false;

Signed-off-by: Ozgur Karatas <mueddib@xxxxxxxxxx>
---
Âdrivers/block/rbd.c
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c

@@ -2,7 +2,6 @@
Â/*
ÂÂÂÂrbd.c -- Export ceph rados objects as a Linux block device

-
ÂÂÂÂbased on drivers/block/osdblk.c:

ÂÂÂÂCopyright 2009 Red Hat, Inc.
@@ -24,7 +23,7 @@

ÂÂÂÂFor usage instructions, please refer to:

- Documentation/ABI/testing/sysfs-bus-rbd
+ Documentation/ABI/testing/sysfs-bus-rbd

ÂÂ*/

@@ -449,7 +448,7 @@ static struct workqueue_struct *rbd_wq;
ÂÂ* Default to false for now, as single-major requires >= 0.75 version of
ÂÂ* userspace rbd utility.
ÂÂ*/
-static bool single_major = false;
+static bool single_major;
Âmodule_param(single_major, bool, S_IRUGO);
ÂMODULE_PARM_DESC(single_major, "Use a single major number for all rbd devices (default: false)");

@@ -866,7 +865,7 @@ static int parse_rbd_opts_token(char *c, void *private)
ÂÂÂÂÂÂÂÂÂreturn 0;
Â}

-static char* obj_op_name(enum obj_operation_type op_type)
+static char *obj_op_name(enum obj_operation_type op_type)
Â{
ÂÂÂÂÂÂÂÂÂswitch (op_type) {
ÂÂÂÂÂÂÂÂÂcase OBJ_OP_READ:
@@ -5587,15 +5586,14 @@ static int rbd_dev_header_info(struct rbd_device *rbd_dev)
ÂÂ*/
Âstatic inline size_t next_token(const char **buf)
Â{
- /*
- * These are the characters that produce nonzero for
- * isspace() in the "C" and "POSIX" locales.
- */
- const char *spaces = " \f\n\r\t\v";
-
- *buf += strspn(*buf, spaces); /* Find start of token */
+/*
+ * These are the characters that produce nonzero for
+ * isspace() in the "C" and "POSIX" locales.
+*/

- return strcspn(*buf, spaces); /* Return token length */
+const char *spaces = " \f\n\r\t\v";
+*buf += strspn(*buf, spaces); /* Find start of token */
+return strcspn(*buf, spaces); /* Return token length */