summaryrefslogtreecommitdiffstats
path: root/block/bfq-iosched.c
diff options
context:
space:
mode:
authorweiping zhang <zhangweiping@didichuxing.com>2017-08-24 13:11:33 -0400
committerJens Axboe <axboe@kernel.dk>2017-08-28 12:01:08 -0400
commit235f8da119351ae583abfbbf577eb61a8b564203 (patch)
treebd6c28a7d55348202b1820ce8720aac567293f84 /block/bfq-iosched.c
parentf5cb2d51524a1218bb0c5d8b234044e9104f7062 (diff)
block, scheduler: convert xxx_var_store to void
The last parameter "count" never be used in xxx_var_store, convert these functions to void. Signed-off-by: weiping zhang <zhangweiping@didichuxing.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block/bfq-iosched.c')
-rw-r--r--block/bfq-iosched.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/block/bfq-iosched.c b/block/bfq-iosched.c
index ea2832b6698c..79484469c2f7 100644
--- a/block/bfq-iosched.c
+++ b/block/bfq-iosched.c
@@ -4801,16 +4801,13 @@ static ssize_t bfq_var_show(unsigned int var, char *page)
4801 return sprintf(page, "%u\n", var); 4801 return sprintf(page, "%u\n", var);
4802} 4802}
4803 4803
4804static ssize_t bfq_var_store(unsigned long *var, const char *page, 4804static void bfq_var_store(unsigned long *var, const char *page)
4805 size_t count)
4806{ 4805{
4807 unsigned long new_val; 4806 unsigned long new_val;
4808 int ret = kstrtoul(page, 10, &new_val); 4807 int ret = kstrtoul(page, 10, &new_val);
4809 4808
4810 if (ret == 0) 4809 if (ret == 0)
4811 *var = new_val; 4810 *var = new_val;
4812
4813 return count;
4814} 4811}
4815 4812
4816#define SHOW_FUNCTION(__FUNC, __VAR, __CONV) \ 4813#define SHOW_FUNCTION(__FUNC, __VAR, __CONV) \
@@ -4852,7 +4849,7 @@ __FUNC(struct elevator_queue *e, const char *page, size_t count) \
4852{ \ 4849{ \
4853 struct bfq_data *bfqd = e->elevator_data; \ 4850 struct bfq_data *bfqd = e->elevator_data; \
4854 unsigned long uninitialized_var(__data); \ 4851 unsigned long uninitialized_var(__data); \
4855 int ret = bfq_var_store(&__data, (page), count); \ 4852 bfq_var_store(&__data, (page)); \
4856 if (__data < (MIN)) \ 4853 if (__data < (MIN)) \
4857 __data = (MIN); \ 4854 __data = (MIN); \
4858 else if (__data > (MAX)) \ 4855 else if (__data > (MAX)) \
@@ -4863,7 +4860,7 @@ __FUNC(struct elevator_queue *e, const char *page, size_t count) \
4863 *(__PTR) = (u64)__data * NSEC_PER_MSEC; \ 4860 *(__PTR) = (u64)__data * NSEC_PER_MSEC; \
4864 else \ 4861 else \
4865 *(__PTR) = __data; \ 4862 *(__PTR) = __data; \
4866 return ret; \ 4863 return count; \
4867} 4864}
4868STORE_FUNCTION(bfq_fifo_expire_sync_store, &bfqd->bfq_fifo_expire[1], 1, 4865STORE_FUNCTION(bfq_fifo_expire_sync_store, &bfqd->bfq_fifo_expire[1], 1,
4869 INT_MAX, 2); 4866 INT_MAX, 2);
@@ -4880,13 +4877,13 @@ static ssize_t __FUNC(struct elevator_queue *e, const char *page, size_t count)\
4880{ \ 4877{ \
4881 struct bfq_data *bfqd = e->elevator_data; \ 4878 struct bfq_data *bfqd = e->elevator_data; \
4882 unsigned long uninitialized_var(__data); \ 4879 unsigned long uninitialized_var(__data); \
4883 int ret = bfq_var_store(&__data, (page), count); \ 4880 bfq_var_store(&__data, (page)); \
4884 if (__data < (MIN)) \ 4881 if (__data < (MIN)) \
4885 __data = (MIN); \ 4882 __data = (MIN); \
4886 else if (__data > (MAX)) \ 4883 else if (__data > (MAX)) \
4887 __data = (MAX); \ 4884 __data = (MAX); \
4888 *(__PTR) = (u64)__data * NSEC_PER_USEC; \ 4885 *(__PTR) = (u64)__data * NSEC_PER_USEC; \
4889 return ret; \ 4886 return count; \
4890} 4887}
4891USEC_STORE_FUNCTION(bfq_slice_idle_us_store, &bfqd->bfq_slice_idle, 0, 4888USEC_STORE_FUNCTION(bfq_slice_idle_us_store, &bfqd->bfq_slice_idle, 0,
4892 UINT_MAX); 4889 UINT_MAX);
@@ -4897,7 +4894,8 @@ static ssize_t bfq_max_budget_store(struct elevator_queue *e,
4897{ 4894{
4898 struct bfq_data *bfqd = e->elevator_data; 4895 struct bfq_data *bfqd = e->elevator_data;
4899 unsigned long uninitialized_var(__data); 4896 unsigned long uninitialized_var(__data);
4900 int ret = bfq_var_store(&__data, (page), count); 4897
4898 bfq_var_store(&__data, (page));
4901 4899
4902 if (__data == 0) 4900 if (__data == 0)
4903 bfqd->bfq_max_budget = bfq_calc_max_budget(bfqd); 4901 bfqd->bfq_max_budget = bfq_calc_max_budget(bfqd);
@@ -4909,7 +4907,7 @@ static ssize_t bfq_max_budget_store(struct elevator_queue *e,
4909 4907
4910 bfqd->bfq_user_max_budget = __data; 4908 bfqd->bfq_user_max_budget = __data;
4911 4909
4912 return ret; 4910 return count;
4913} 4911}
4914 4912
4915/* 4913/*
@@ -4921,7 +4919,8 @@ static ssize_t bfq_timeout_sync_store(struct elevator_queue *e,
4921{ 4919{
4922 struct bfq_data *bfqd = e->elevator_data; 4920 struct bfq_data *bfqd = e->elevator_data;
4923 unsigned long uninitialized_var(__data); 4921 unsigned long uninitialized_var(__data);
4924 int ret = bfq_var_store(&__data, (page), count); 4922
4923 bfq_var_store(&__data, (page));
4925 4924
4926 if (__data < 1) 4925 if (__data < 1)
4927 __data = 1; 4926 __data = 1;
@@ -4932,7 +4931,7 @@ static ssize_t bfq_timeout_sync_store(struct elevator_queue *e,
4932 if (bfqd->bfq_user_max_budget == 0) 4931 if (bfqd->bfq_user_max_budget == 0)
4933 bfqd->bfq_max_budget = bfq_calc_max_budget(bfqd); 4932 bfqd->bfq_max_budget = bfq_calc_max_budget(bfqd);
4934 4933
4935 return ret; 4934 return count;
4936} 4935}
4937 4936
4938static ssize_t bfq_strict_guarantees_store(struct elevator_queue *e, 4937static ssize_t bfq_strict_guarantees_store(struct elevator_queue *e,
@@ -4940,7 +4939,8 @@ static ssize_t bfq_strict_guarantees_store(struct elevator_queue *e,
4940{ 4939{
4941 struct bfq_data *bfqd = e->elevator_data; 4940 struct bfq_data *bfqd = e->elevator_data;
4942 unsigned long uninitialized_var(__data); 4941 unsigned long uninitialized_var(__data);
4943 int ret = bfq_var_store(&__data, (page), count); 4942
4943 bfq_var_store(&__data, (page));
4944 4944
4945 if (__data > 1) 4945 if (__data > 1)
4946 __data = 1; 4946 __data = 1;
@@ -4950,7 +4950,7 @@ static ssize_t bfq_strict_guarantees_store(struct elevator_queue *e,
4950 4950
4951 bfqd->strict_guarantees = __data; 4951 bfqd->strict_guarantees = __data;
4952 4952
4953 return ret; 4953 return count;
4954} 4954}
4955 4955
4956static ssize_t bfq_low_latency_store(struct elevator_queue *e, 4956static ssize_t bfq_low_latency_store(struct elevator_queue *e,
@@ -4958,7 +4958,8 @@ static ssize_t bfq_low_latency_store(struct elevator_queue *e,
4958{ 4958{
4959 struct bfq_data *bfqd = e->elevator_data; 4959 struct bfq_data *bfqd = e->elevator_data;
4960 unsigned long uninitialized_var(__data); 4960 unsigned long uninitialized_var(__data);
4961 int ret = bfq_var_store(&__data, (page), count); 4961
4962 bfq_var_store(&__data, (page));
4962 4963
4963 if (__data > 1) 4964 if (__data > 1)
4964 __data = 1; 4965 __data = 1;
@@ -4966,7 +4967,7 @@ static ssize_t bfq_low_latency_store(struct elevator_queue *e,
4966 bfq_end_wr(bfqd); 4967 bfq_end_wr(bfqd);
4967 bfqd->low_latency = __data; 4968 bfqd->low_latency = __data;
4968 4969
4969 return ret; 4970 return count;
4970} 4971}
4971 4972
4972#define BFQ_ATTR(name) \ 4973#define BFQ_ATTR(name) \