Commit 6ec1be50 authored by Bryan Gurney's avatar Bryan Gurney Committed by Mike Snitzer

dm dust: change result vars to r

Change the "result" variables to "r" in dust_status() and
dust_message().
Signed-off-by: default avatarBryan Gurney <bgurney@redhat.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent 26b924b9
...@@ -375,7 +375,7 @@ static int dust_message(struct dm_target *ti, unsigned int argc, char **argv, ...@@ -375,7 +375,7 @@ static int dust_message(struct dm_target *ti, unsigned int argc, char **argv,
struct dust_device *dd = ti->private; struct dust_device *dd = ti->private;
sector_t size = i_size_read(dd->dev->bdev->bd_inode) >> SECTOR_SHIFT; sector_t size = i_size_read(dd->dev->bdev->bd_inode) >> SECTOR_SHIFT;
bool invalid_msg = false; bool invalid_msg = false;
int result = -EINVAL; int r = -EINVAL;
unsigned long long tmp, block; unsigned long long tmp, block;
unsigned long flags; unsigned long flags;
char dummy; char dummy;
...@@ -388,45 +388,45 @@ static int dust_message(struct dm_target *ti, unsigned int argc, char **argv, ...@@ -388,45 +388,45 @@ static int dust_message(struct dm_target *ti, unsigned int argc, char **argv,
} else if (!strcasecmp(argv[0], "disable")) { } else if (!strcasecmp(argv[0], "disable")) {
DMINFO("disabling read failures on bad sectors"); DMINFO("disabling read failures on bad sectors");
dd->fail_read_on_bb = false; dd->fail_read_on_bb = false;
result = 0; r = 0;
} else if (!strcasecmp(argv[0], "enable")) { } else if (!strcasecmp(argv[0], "enable")) {
DMINFO("enabling read failures on bad sectors"); DMINFO("enabling read failures on bad sectors");
dd->fail_read_on_bb = true; dd->fail_read_on_bb = true;
result = 0; r = 0;
} else if (!strcasecmp(argv[0], "countbadblocks")) { } else if (!strcasecmp(argv[0], "countbadblocks")) {
spin_lock_irqsave(&dd->dust_lock, flags); spin_lock_irqsave(&dd->dust_lock, flags);
DMINFO("countbadblocks: %llu badblock(s) found", DMINFO("countbadblocks: %llu badblock(s) found",
dd->badblock_count); dd->badblock_count);
spin_unlock_irqrestore(&dd->dust_lock, flags); spin_unlock_irqrestore(&dd->dust_lock, flags);
result = 0; r = 0;
} else if (!strcasecmp(argv[0], "clearbadblocks")) { } else if (!strcasecmp(argv[0], "clearbadblocks")) {
result = dust_clear_badblocks(dd); r = dust_clear_badblocks(dd);
} else if (!strcasecmp(argv[0], "quiet")) { } else if (!strcasecmp(argv[0], "quiet")) {
if (!dd->quiet_mode) if (!dd->quiet_mode)
dd->quiet_mode = true; dd->quiet_mode = true;
else else
dd->quiet_mode = false; dd->quiet_mode = false;
result = 0; r = 0;
} else { } else {
invalid_msg = true; invalid_msg = true;
} }
} else if (argc == 2) { } else if (argc == 2) {
if (sscanf(argv[1], "%llu%c", &tmp, &dummy) != 1) if (sscanf(argv[1], "%llu%c", &tmp, &dummy) != 1)
return result; return r;
block = tmp; block = tmp;
sector_div(size, dd->sect_per_block); sector_div(size, dd->sect_per_block);
if (block > size) { if (block > size) {
DMERR("selected block value out of range"); DMERR("selected block value out of range");
return result; return r;
} }
if (!strcasecmp(argv[0], "addbadblock")) if (!strcasecmp(argv[0], "addbadblock"))
result = dust_add_block(dd, block); r = dust_add_block(dd, block);
else if (!strcasecmp(argv[0], "removebadblock")) else if (!strcasecmp(argv[0], "removebadblock"))
result = dust_remove_block(dd, block); r = dust_remove_block(dd, block);
else if (!strcasecmp(argv[0], "queryblock")) else if (!strcasecmp(argv[0], "queryblock"))
result = dust_query_block(dd, block); r = dust_query_block(dd, block);
else else
invalid_msg = true; invalid_msg = true;
...@@ -436,7 +436,7 @@ static int dust_message(struct dm_target *ti, unsigned int argc, char **argv, ...@@ -436,7 +436,7 @@ static int dust_message(struct dm_target *ti, unsigned int argc, char **argv,
if (invalid_msg) if (invalid_msg)
DMERR("unrecognized message '%s' received", argv[0]); DMERR("unrecognized message '%s' received", argv[0]);
return result; return r;
} }
static void dust_status(struct dm_target *ti, status_type_t type, static void dust_status(struct dm_target *ti, status_type_t type,
...@@ -499,12 +499,12 @@ static struct target_type dust_target = { ...@@ -499,12 +499,12 @@ static struct target_type dust_target = {
static int __init dm_dust_init(void) static int __init dm_dust_init(void)
{ {
int result = dm_register_target(&dust_target); int r = dm_register_target(&dust_target);
if (result < 0) if (r < 0)
DMERR("dm_register_target failed %d", result); DMERR("dm_register_target failed %d", r);
return result; return r;
} }
static void __exit dm_dust_exit(void) static void __exit dm_dust_exit(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment