block: cleanup queue_wc_store
[sfrench/cifs-2.6.git] / block / blk-sysfs.c
index afc797fb0dfc4883b6335c69e4cb6949dcc46ceb..0cde6598fb2f4dcb8e16f2a75b3ffb4c84929a05 100644 (file)
@@ -449,21 +449,13 @@ static ssize_t queue_wc_show(struct request_queue *q, char *page)
 static ssize_t queue_wc_store(struct request_queue *q, const char *page,
                              size_t count)
 {
-       int set = -1;
-
        if (!strncmp(page, "write back", 10))
-               set = 1;
+               blk_queue_flag_set(QUEUE_FLAG_WC, q);
        else if (!strncmp(page, "write through", 13) ||
                 !strncmp(page, "none", 4))
-               set = 0;
-
-       if (set == -1)
-               return -EINVAL;
-
-       if (set)
-               blk_queue_flag_set(QUEUE_FLAG_WC, q);
-       else
                blk_queue_flag_clear(QUEUE_FLAG_WC, q);
+       else
+               return -EINVAL;
 
        return count;
 }