summaryrefslogtreecommitdiff
path: root/drivers/w1
diff options
context:
space:
mode:
authorzuoqilin <zuoqilin@yulong.com>2021-06-18 17:24:18 +0800
committerKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>2023-05-08 08:14:50 +0200
commita8c4dda94115c4079d3aaa35ba238f2376b6aa53 (patch)
tree798170b35e40638344d0f5c25e127925aae4a678 /drivers/w1
parent4f5a5badb4eee46e43dc45be5e6058bff767eb80 (diff)
w1: Simplify the atribute show
There is no necessary to define variable assignment, return directly. Signed-off-by: zuoqilin <zuoqilin@yulong.com> Link: https://lore.kernel.org/r/20210618092418.1424-1-zuoqilin1@163.com Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Diffstat (limited to 'drivers/w1')
-rw-r--r--drivers/w1/w1.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index e7e42f9dabf4..0da9f528b6c1 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -295,17 +295,13 @@ static ssize_t w1_master_attribute_show_pointer(struct device *dev, struct devic
static ssize_t w1_master_attribute_show_timeout(struct device *dev, struct device_attribute *attr, char *buf)
{
- ssize_t count;
- count = sprintf(buf, "%d\n", w1_timeout);
- return count;
+ return sprintf(buf, "%d\n", w1_timeout);
}
static ssize_t w1_master_attribute_show_timeout_us(struct device *dev,
struct device_attribute *attr, char *buf)
{
- ssize_t count;
- count = sprintf(buf, "%d\n", w1_timeout_us);
- return count;
+ return sprintf(buf, "%d\n", w1_timeout_us);
}
static ssize_t w1_master_attribute_store_max_slave_count(struct device *dev,