aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/util.h
diff options
context:
space:
mode:
authorQing Wang <wangqing@vivo.com>2021-10-29 14:09:30 +0800
committerJens Axboe <axboe@kernel.dk>2021-10-29 06:43:21 -0600
commit1b86db5f4e025840e0bf7cef2b10e84531954386 (patch)
tree125977979d9d84e879d63bd866b9d5cfcb8bc134 /drivers/md/bcache/util.h
parentbcache: move uapi header bcache.h to bcache code directory (diff)
downloadlinux-dev-1b86db5f4e025840e0bf7cef2b10e84531954386.tar.xz
linux-dev-1b86db5f4e025840e0bf7cef2b10e84531954386.zip
bcache: replace snprintf in show functions with sysfs_emit
coccicheck complains about the use of snprintf() in sysfs show functions. Fix the following coccicheck warning: drivers/md/bcache/sysfs.h:54:12-20: WARNING: use scnprintf or sprintf. Implement sysfs_print() by sysfs_emit() and remove snprint() since no one uses it any more. Suggested-by: Coly Li <colyli@suse.de> Signed-off-by: Qing Wang <wangqing@vivo.com> Signed-off-by: Coly Li <colyli@suse.de> Link: https://lore.kernel.org/r/20211029060930.119923-3-colyli@suse.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to '')
-rw-r--r--drivers/md/bcache/util.h17
1 files changed, 0 insertions, 17 deletions
diff --git a/drivers/md/bcache/util.h b/drivers/md/bcache/util.h
index 6274d6a17e5e..cdb165517d0b 100644
--- a/drivers/md/bcache/util.h
+++ b/drivers/md/bcache/util.h
@@ -340,23 +340,6 @@ static inline int bch_strtoul_h(const char *cp, long *res)
_r; \
})
-#define snprint(buf, size, var) \
- snprintf(buf, size, \
- __builtin_types_compatible_p(typeof(var), int) \
- ? "%i\n" : \
- __builtin_types_compatible_p(typeof(var), unsigned int) \
- ? "%u\n" : \
- __builtin_types_compatible_p(typeof(var), long) \
- ? "%li\n" : \
- __builtin_types_compatible_p(typeof(var), unsigned long)\
- ? "%lu\n" : \
- __builtin_types_compatible_p(typeof(var), int64_t) \
- ? "%lli\n" : \
- __builtin_types_compatible_p(typeof(var), uint64_t) \
- ? "%llu\n" : \
- __builtin_types_compatible_p(typeof(var), const char *) \
- ? "%s\n" : "%i\n", var)
-
ssize_t bch_hprint(char *buf, int64_t v);
bool bch_is_zero(const char *p, size_t n);