Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/dm dm: style + whitespace + indentation fixes
details: https://anonhg.NetBSD.org/src/rev/bf4207098636
branches: trunk
changeset: 465812:bf4207098636
user: tkusumi <tkusumi%NetBSD.org@localhost>
date: Wed Dec 04 15:31:12 2019 +0000
description:
dm: style + whitespace + indentation fixes
No functional changes.
diffstat:
sys/dev/dm/device-mapper.c | 26 +++++++-------------------
sys/dev/dm/dm_dev.c | 15 +++++----------
sys/dev/dm/dm_ioctl.c | 22 ++++++++--------------
sys/dev/dm/dm_pdev.c | 5 ++---
sys/dev/dm/dm_table.c | 18 ++++++++----------
sys/dev/dm/dm_target.c | 17 ++++++-----------
6 files changed, 36 insertions(+), 67 deletions(-)
diffs (truncated from 436 to 300 lines):
diff -r 4b801974438c -r bf4207098636 sys/dev/dm/device-mapper.c
--- a/sys/dev/dm/device-mapper.c Wed Dec 04 14:09:47 2019 +0000
+++ b/sys/dev/dm/device-mapper.c Wed Dec 04 15:31:12 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: device-mapper.c,v 1.42 2019/12/03 15:36:00 tkusumi Exp $ */
+/* $NetBSD: device-mapper.c,v 1.43 2019/12/04 15:31:12 tkusumi Exp $ */
/*
* Copyright (c) 2010 The NetBSD Foundation, Inc.
@@ -149,7 +149,7 @@
{ .cmd = "reload", .fn = dm_table_load_ioctl, .allowed = 0 },
{ .cmd = "status", .fn = dm_table_status_ioctl, .allowed = 1 },
{ .cmd = "table", .fn = dm_table_status_ioctl, .allowed = 1 },
- { .cmd = NULL, .fn = NULL, .allowed = 0 }
+ { .cmd = NULL, .fn = NULL, .allowed = 0 }
};
#ifdef _MODULE
@@ -194,11 +194,8 @@
config_cfdriver_detach(&dm_cd);
break;
}
-
dm_doinit();
-
break;
-
case MODULE_CMD_FINI:
/*
* Disable unloading of dm module if there are any devices
@@ -220,7 +217,6 @@
break;
case MODULE_CMD_STAT:
return ENOTTY;
-
default:
return ENOTTY;
}
@@ -364,7 +360,7 @@
aprint_debug("dmioctl called\n");
KASSERT(data != NULL);
- if (( r = disk_ioctl_switch(dev, cmd, data)) == ENOTTY) {
+ if ((r = disk_ioctl_switch(dev, cmd, data)) == ENOTTY) {
struct plistref *pref = (struct plistref *) data;
/* Check if we were called with NETBSD_DM_IOCTL ioctl
@@ -429,7 +425,6 @@
{
switch(cmd) {
-
case NETBSD_DM_IOCTL:
aprint_debug("dm NetBSD_DM_IOCTL called\n");
break;
@@ -511,8 +506,7 @@
* Call sync target routine for all table entries. Target sync
* routine basically call DIOCCACHESYNC on underlying devices.
*/
- SLIST_FOREACH(table_en, tbl, next)
- {
+ SLIST_FOREACH(table_en, tbl, next) {
(void)table_en->target->sync(table_en);
}
dm_table_release(&dmv->table_head, DM_TABLE_ACTIVE);
@@ -556,7 +550,6 @@
break;
}
-
default:
aprint_debug("unknown disk_ioctl called\n");
return ENOTTY;
@@ -622,8 +615,7 @@
/*
* Find out what tables I want to select.
*/
- SLIST_FOREACH(table_en, tbl, next)
- {
+ SLIST_FOREACH(table_en, tbl, next) {
/* I need need number of bytes not blocks. */
table_start = table_en->start * DEV_BSIZE;
/*
@@ -672,8 +664,6 @@
dm_table_release(&dmv->table_head, DM_TABLE_ACTIVE);
dm_dev_unbusy(dmv);
-
- return;
}
@@ -697,15 +687,13 @@
dm_dev_t *dmv;
uint64_t size;
- size = 0;
-
if ((dmv = dm_dev_lookup(NULL, NULL, minor(dev))) == NULL)
- return -ENOENT;
+ return -ENOENT;
size = dm_table_size(&dmv->table_head);
dm_dev_unbusy(dmv);
- return size;
+ return size;
}
static void
diff -r 4b801974438c -r bf4207098636 sys/dev/dm/dm_dev.c
--- a/sys/dev/dm/dm_dev.c Wed Dec 04 14:09:47 2019 +0000
+++ b/sys/dev/dm/dm_dev.c Wed Dec 04 15:31:12 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dm_dev.c,v 1.12 2019/12/03 16:22:01 tkusumi Exp $ */
+/* $NetBSD: dm_dev.c,v 1.13 2019/12/04 15:31:12 tkusumi Exp $ */
/*
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dm_dev.c,v 1.12 2019/12/03 16:22:01 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_dev.c,v 1.13 2019/12/04 15:31:12 tkusumi Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -133,7 +133,6 @@
return NULL;
TAILQ_FOREACH(dmv, &dm_dev_list, next_devlist) {
-
dlen = strlen(dmv->name);
if (slen != dlen)
@@ -162,7 +161,6 @@
return NULL;
TAILQ_FOREACH(dmv, &dm_dev_list, next_devlist) {
-
if (strlen(dmv->uuid) != len)
continue;
@@ -190,9 +188,7 @@
if (((dmv = dm_dev_lookup_uuid(dev->uuid)) == NULL) &&
((dmv = dm_dev_lookup_name(dev->name)) == NULL) &&
((dmv = dm_dev_lookup_minor(dev->minor)) == NULL)) {
-
TAILQ_INSERT_TAIL(&dm_dev_list, dev, next_devlist);
-
} else
r = EEXIST;
@@ -288,7 +284,6 @@
mutex_enter(&dm_dev_mutex);
while (TAILQ_FIRST(&dm_dev_list) != NULL) {
-
dmv = TAILQ_FIRST(&dm_dev_list);
TAILQ_REMOVE(&dm_dev_list, TAILQ_FIRST(&dm_dev_list),
@@ -311,7 +306,7 @@
mutex_destroy(&dmv->dev_mtx);
cv_destroy(&dmv->dev_cv);
- (void) kmem_free(dmv, sizeof(dm_dev_t));
+ (void)kmem_free(dmv, sizeof(dm_dev_t));
}
mutex_exit(&dm_dev_mutex);
@@ -345,9 +340,9 @@
cv_destroy(&dmv->dev_cv);
if (dmv->diskp != NULL)
- (void) kmem_free(dmv->diskp, sizeof(struct disk));
+ (void)kmem_free(dmv->diskp, sizeof(struct disk));
- (void) kmem_free(dmv, sizeof(dm_dev_t));
+ (void)kmem_free(dmv, sizeof(dm_dev_t));
return 0;
}
diff -r 4b801974438c -r bf4207098636 sys/dev/dm/dm_ioctl.c
--- a/sys/dev/dm/dm_ioctl.c Wed Dec 04 14:09:47 2019 +0000
+++ b/sys/dev/dm/dm_ioctl.c Wed Dec 04 15:31:12 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dm_ioctl.c,v 1.36 2019/12/03 15:47:38 tkusumi Exp $ */
+/* $NetBSD: dm_ioctl.c,v 1.37 2019/12/04 15:31:12 tkusumi Exp $ */
/*
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dm_ioctl.c,v 1.36 2019/12/03 15:47:38 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_ioctl.c,v 1.37 2019/12/04 15:31:12 tkusumi Exp $");
/*
* Locking is used to synchronise between ioctl calls and between dm_table's
@@ -297,7 +297,6 @@
dm_dev_list_ioctl(prop_dictionary_t dm_dict)
{
prop_array_t dev_list;
-
uint32_t flags;
flags = 0;
@@ -452,9 +451,9 @@
* Add status flags for tables I have to check both active and
* inactive tables.
*/
- if ((j = dm_table_get_target_count(&dmv->table_head, DM_TABLE_ACTIVE))) {
+ if ((j = dm_table_get_target_count(&dmv->table_head, DM_TABLE_ACTIVE)))
DM_ADD_FLAG(flags, DM_ACTIVE_PRESENT_FLAG);
- } else
+ else
DM_REMOVE_FLAG(flags, DM_ACTIVE_PRESENT_FLAG);
prop_dictionary_set_uint32(dm_dict, DM_IOCTL_TARGET_COUNT, j);
@@ -665,7 +664,7 @@
tbl = dm_table_get_entry(&dmv->table_head, table_type);
SLIST_FOREACH(table_en, tbl, next)
- table_en->target->deps(table_en, cmd_array);
+ table_en->target->deps(table_en, cmd_array);
dm_table_release(&dmv->table_head, table_type);
dm_dev_unbusy(dmv);
@@ -699,9 +698,7 @@
prop_dictionary_t target_dict;
const char *name, *uuid, *type;
-
uint32_t flags, ret, minor;
-
char *str;
ret = 0;
@@ -749,7 +746,6 @@
prop_dictionary_set_uint32(dm_dict, DM_IOCTL_MINOR, dmv->minor);
while ((target_dict = prop_object_iterator_next(iter)) != NULL) {
-
prop_dictionary_get_cstring_nocopy(target_dict,
DM_TABLE_TYPE, &type);
/*
@@ -797,7 +793,6 @@
if ((ret = target->init(dmv, &table_en->target_config,
str)) != 0) {
-
dm_table_release(&dmv->table_head, DM_TABLE_INACTIVE);
dm_table_destroy(&dmv->table_head, DM_TABLE_INACTIVE);
free(str, M_TEMP);
@@ -885,16 +880,15 @@
else
table_type = DM_TABLE_ACTIVE;
- if (dm_table_get_target_count(&dmv->table_head, DM_TABLE_ACTIVE))
+ if (dm_table_get_target_count(&dmv->table_head, DM_TABLE_ACTIVE)) {
DM_ADD_FLAG(flags, DM_ACTIVE_PRESENT_FLAG);
- else {
+ } else {
DM_REMOVE_FLAG(flags, DM_ACTIVE_PRESENT_FLAG);
if (dm_table_get_target_count(&dmv->table_head, DM_TABLE_INACTIVE))
DM_ADD_FLAG(flags, DM_INACTIVE_PRESENT_FLAG);
- else {
+ else
DM_REMOVE_FLAG(flags, DM_INACTIVE_PRESENT_FLAG);
- }
}
if (dmv->flags & DM_SUSPEND_FLAG)
diff -r 4b801974438c -r bf4207098636 sys/dev/dm/dm_pdev.c
--- a/sys/dev/dm/dm_pdev.c Wed Dec 04 14:09:47 2019 +0000
+++ b/sys/dev/dm/dm_pdev.c Wed Dec 04 15:31:12 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: dm_pdev.c,v 1.13 2019/12/03 16:22:01 tkusumi Exp $ */
+/* $NetBSD: dm_pdev.c,v 1.14 2019/12/04 15:31:12 tkusumi Exp $ */
/*
* Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -29,7 +29,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: dm_pdev.c,v 1.13 2019/12/03 16:22:01 tkusumi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: dm_pdev.c,v 1.14 2019/12/04 15:31:12 tkusumi Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -192,7 +192,6 @@
mutex_enter(&dm_pdev_mutex);
while (!SLIST_EMPTY(&dm_pdev_list)) { /* List Deletion. */
-
dm_pdev = SLIST_FIRST(&dm_pdev_list);
Home |
Main Index |
Thread Index |
Old Index